From 1841ef1c5458634a88ef4faad5883552d9f354b2 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Tue, 3 Oct 2017 23:37:02 +0300 Subject: 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 --- sql/events.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sql/events.cc') diff --git a/sql/events.cc b/sql/events.cc index 11d54894d1d..ad2f13fc35c 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -334,6 +334,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)) @@ -416,6 +417,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 */ } @@ -456,6 +461,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); @@ -540,6 +548,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 */ } @@ -580,6 +592,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. @@ -601,6 +615,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 } -- cgit v1.2.1 From 70c23321de0769b4fdb92e6df250fd0dc056df20 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Wed, 4 Oct 2017 22:47:59 +0300 Subject: MW-416 Changed return code for replicatio error to TRUE. This is aligned with native mysql convention to return TRUE (defined to 1) or FALSE (defined to 0) from a bool function. This is wrong, but follows the mysql conventiosn, at least... --- sql/events.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/events.cc') diff --git a/sql/events.cc b/sql/events.cc index ad2f13fc35c..1f2501646cb 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -419,7 +419,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data) DBUG_RETURN(ret); #ifdef WITH_WSREP error: - DBUG_RETURN(true); + DBUG_RETURN(TRUE); #endif /* WITH_WSREP */ } -- cgit v1.2.1 From d76f5774fe70c51577cfbfdddcbfb3309d51f06e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Sep 2017 14:52:42 +0200 Subject: MDEV-13459 Warnings, when compiling with gcc-7.x mostly caused by -Wimplicit-fallthrough --- sql/events.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sql/events.cc') diff --git a/sql/events.cc b/sql/events.cc index 763c75e77b0..008b6223702 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -185,8 +185,8 @@ common_1_lev_code: expr= tmp_expr - (tmp_expr/60)*60; /* the code after the switch will finish */ - } break; + } case INTERVAL_HOUR_SECOND: { ulonglong tmp_expr= expr; @@ -202,8 +202,8 @@ common_1_lev_code: expr= tmp_expr - (tmp_expr/60)*60; /* the code after the switch will finish */ - } break; + } case INTERVAL_DAY_SECOND: { ulonglong tmp_expr= expr; @@ -225,8 +225,8 @@ common_1_lev_code: expr= tmp_expr - (tmp_expr/60)*60; /* the code after the switch will finish */ - } break; + } case INTERVAL_DAY_MICROSECOND: case INTERVAL_HOUR_MICROSECOND: case INTERVAL_MINUTE_MICROSECOND: @@ -240,6 +240,8 @@ common_1_lev_code: break; case INTERVAL_WEEK: expr/= 7; + close_quote= FALSE; + break; default: close_quote= FALSE; break; -- cgit v1.2.1