summaryrefslogtreecommitdiff
path: root/sql/events.cc
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2017-12-12 17:47:06 +0100
committerSergei Golubchik <serg@mariadb.org>2017-12-18 16:41:40 +0100
commit91daf8819cf84828b4c96be6f0b35caca97bb61c (patch)
tree8fd1abd06e982068d72c98f0cebba4c7dbf62131 /sql/events.cc
parentbeabe6b2167ee7e8c2659da9507e33ddd56a9c29 (diff)
downloadmariadb-git-91daf8819cf84828b4c96be6f0b35caca97bb61c.tar.gz
MW-416
Moved TOI replication to happen after ACL checking for commands: SQLCOM_CREATE_EVENT SQLCOM_ALTER_EVENT SQLCOM_DROP_EVENT SQLCOM_CREATE_VIEW SQLCOM_CREATE_TRIGGER SQLCOM_DROP_TRIGGER SQLCOM_INSTALL_PLUGIN SQLCOM_UNINSTALL_PLUGIN
Diffstat (limited to 'sql/events.cc')
-rw-r--r--sql/events.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/events.cc b/sql/events.cc
index 51f68ca4c03..cdc15f41716 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -335,6 +335,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data)
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
DBUG_RETURN(TRUE);
+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
if (lock_object_name(thd, MDL_key::EVENT,
parse_data->dbname.str, parse_data->name.str))
@@ -417,6 +418,10 @@ Events::create_event(THD *thd, Event_parse_data *parse_data)
thd->restore_stmt_binlog_format(save_binlog_format);
DBUG_RETURN(ret);
+#ifdef WITH_WSREP
+ error:
+ DBUG_RETURN(true);
+#endif /* WITH_WSREP */
}
@@ -457,6 +462,9 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
DBUG_RETURN(TRUE);
+
+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
+
if (lock_object_name(thd, MDL_key::EVENT,
parse_data->dbname.str, parse_data->name.str))
DBUG_RETURN(TRUE);
@@ -541,6 +549,10 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
thd->restore_stmt_binlog_format(save_binlog_format);
DBUG_RETURN(ret);
+#ifdef WITH_WSREP
+error:
+ DBUG_RETURN(TRUE);
+#endif /* WITH_WSREP */
}
@@ -581,6 +593,8 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0))
DBUG_RETURN(TRUE);
+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
+
/*
Turn off row binlogging of this statement and use statement-based so
that all supporting tables are updated for DROP EVENT command.
@@ -602,6 +616,10 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
thd->restore_stmt_binlog_format(save_binlog_format);
DBUG_RETURN(ret);
+#ifdef WITH_WSREP
+error:
+ DBUG_RETURN(TRUE);
+#endif
}