mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MW-416 Replicating DDL after ACL check, 5.6 version
Re-implemented the fix for MW-416 according to 5.7 version
This commit is contained in:
@ -2079,6 +2079,8 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name,
|
||||
bool error;
|
||||
int argc=orig_argc;
|
||||
char **argv=orig_argv;
|
||||
unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE] =
|
||||
{ MYSQL_AUDIT_GENERAL_CLASSMASK };
|
||||
DBUG_ENTER("mysql_install_plugin");
|
||||
|
||||
if (opt_noacl)
|
||||
@ -2090,6 +2092,7 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name,
|
||||
tables.init_one_table("mysql", 5, "plugin", 6, "plugin", TL_WRITE);
|
||||
if (check_table_access(thd, INSERT_ACL, &tables, FALSE, 1, FALSE))
|
||||
DBUG_RETURN(TRUE);
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
|
||||
|
||||
/* need to open before acquiring LOCK_plugin or it will deadlock */
|
||||
if (! (table = open_ltable(thd, &tables, TL_WRITE,
|
||||
@ -2123,8 +2126,7 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name,
|
||||
|
||||
See also mysql_uninstall_plugin() and initialize_audit_plugin()
|
||||
*/
|
||||
unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE] =
|
||||
{ MYSQL_AUDIT_GENERAL_CLASSMASK };
|
||||
|
||||
mysql_audit_acquire_plugins(thd, event_class_mask);
|
||||
|
||||
mysql_mutex_lock(&LOCK_plugin);
|
||||
@ -2155,6 +2157,10 @@ err:
|
||||
if (argv)
|
||||
free_defaults(argv);
|
||||
DBUG_RETURN(error);
|
||||
#ifdef WITH_WSREP
|
||||
error:
|
||||
DBUG_RETURN(TRUE);
|
||||
#endif /* WITH_WSREP */
|
||||
}
|
||||
|
||||
|
||||
@ -2221,6 +2227,8 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
|
||||
TABLE_LIST tables;
|
||||
LEX_STRING dl= *dl_arg;
|
||||
bool error= false;
|
||||
unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE] =
|
||||
{ MYSQL_AUDIT_GENERAL_CLASSMASK };
|
||||
DBUG_ENTER("mysql_uninstall_plugin");
|
||||
|
||||
if (opt_noacl)
|
||||
@ -2233,6 +2241,7 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
|
||||
|
||||
if (check_table_access(thd, DELETE_ACL, &tables, FALSE, 1, FALSE))
|
||||
DBUG_RETURN(TRUE);
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
|
||||
|
||||
/* need to open before acquiring LOCK_plugin or it will deadlock */
|
||||
if (! (table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT)))
|
||||
@ -2259,8 +2268,6 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
|
||||
|
||||
See also mysql_install_plugin() and initialize_audit_plugin()
|
||||
*/
|
||||
unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE] =
|
||||
{ MYSQL_AUDIT_GENERAL_CLASSMASK };
|
||||
mysql_audit_acquire_plugins(thd, event_class_mask);
|
||||
|
||||
mysql_mutex_lock(&LOCK_plugin);
|
||||
@ -2290,6 +2297,10 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
|
||||
|
||||
mysql_mutex_unlock(&LOCK_plugin);
|
||||
DBUG_RETURN(error);
|
||||
#ifdef WITH_WSREP
|
||||
error:
|
||||
DBUG_RETURN(TRUE);
|
||||
#endif /* WITH_WSREP */
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user