diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 41a8e0d9ddad..81bf18c0ca1e 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -3765,14 +3765,22 @@ int unlock_plugin_data() { } bool Sql_cmd_install_plugin::execute(THD *thd) { + // install plugin doesn't generate any binlog event + // Thus, it is safe to execute even in readonly + thd->set_skip_readonly_check(); bool st = mysql_install_plugin(thd, m_comment, &m_ident); + thd->reset_skip_readonly_check(); if (!st) my_ok(thd); mysql_audit_release(thd); return st; } bool Sql_cmd_uninstall_plugin::execute(THD *thd) { + // uninstall plugin doesn't generate any binlog event + // Thus, it is safe to execute even in readonly + thd->set_skip_readonly_check(); bool st = mysql_uninstall_plugin(thd, m_comment); + thd->reset_skip_readonly_check(); if (!st) my_ok(thd); return st; }