diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-02-06 13:28:06 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-02-06 13:28:06 +0300 |
commit | a72f90bc43a809e6678e1343a1ee760878061be3 (patch) | |
tree | 16fe2efa0a3d5e40e00972a1dc3bc4e13f71170c /sql/events.cc | |
parent | ba678eef7de4a8c5fbea07928b87fef84765f22b (diff) | |
parent | b38ef2b5f7bc231b63b770c28688ee9f0109c88b (diff) | |
download | mariadb-git-a72f90bc43a809e6678e1343a1ee760878061be3.tar.gz |
Merge next-mr -> next-4284.
mysql-test/t/disabled.def:
Restore disabled ssl tests: SSL certificates were updated.
Disable sp_sync.test, the test case can't work in next-4284.
mysql-test/t/partition_innodb.test:
Disable parsing of the test case for Bug#47343,
the test can not work in next-4284.
mysql-test/t/ps_ddl.test:
Update results (CREATE TABLE IF NOT EXISTS takes
into account existence of the temporary table).
Diffstat (limited to 'sql/events.cc')
-rw-r--r-- | sql/events.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/sql/events.cc b/sql/events.cc index 2d76f00c897..6629bb9aefd 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -294,6 +294,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) { int ret; + bool save_binlog_row_based; DBUG_ENTER("Events::create_event"); if (check_if_system_tables_error()) @@ -325,8 +326,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for CREATE EVENT command. */ - if (thd->is_current_stmt_binlog_format_row()) - thd->clear_current_stmt_binlog_format_row(); + save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); + thd->clear_current_stmt_binlog_format_row(); mysql_mutex_lock(&LOCK_event_metadata); @@ -366,6 +367,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, { sql_print_error("Event Error: An error occurred while creating query string, " "before writing it into binary log."); + /* Restore the state of binlog format */ + thd->current_stmt_binlog_row_based= save_binlog_row_based; DBUG_RETURN(TRUE); } /* If the definer is not set or set to CURRENT_USER, the value of CURRENT_USER @@ -374,6 +377,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, } } mysql_mutex_unlock(&LOCK_event_metadata); + /* Restore the state of binlog format */ + thd->current_stmt_binlog_row_based= save_binlog_row_based; DBUG_RETURN(ret); } @@ -403,6 +408,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, LEX_STRING *new_dbname, LEX_STRING *new_name) { int ret; + bool save_binlog_row_based; Event_queue_element *new_element; DBUG_ENTER("Events::update_event"); @@ -449,8 +455,8 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for UPDATE EVENT command. */ - if (thd->is_current_stmt_binlog_format_row()) - thd->clear_current_stmt_binlog_format_row(); + save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); + thd->clear_current_stmt_binlog_format_row(); mysql_mutex_lock(&LOCK_event_metadata); @@ -486,6 +492,8 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, } } mysql_mutex_unlock(&LOCK_event_metadata); + /* Restore the state of binlog format */ + thd->current_stmt_binlog_row_based= save_binlog_row_based; DBUG_RETURN(ret); } @@ -519,6 +527,7 @@ bool Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) { int ret; + bool save_binlog_row_based; DBUG_ENTER("Events::drop_event"); if (check_if_system_tables_error()) @@ -531,8 +540,8 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for DROP EVENT command. */ - if (thd->is_current_stmt_binlog_format_row()) - thd->clear_current_stmt_binlog_format_row(); + save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); + thd->clear_current_stmt_binlog_format_row(); mysql_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ @@ -545,6 +554,8 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } mysql_mutex_unlock(&LOCK_event_metadata); + /* Restore the state of binlog format */ + thd->current_stmt_binlog_row_based= save_binlog_row_based; DBUG_RETURN(ret); } @@ -738,7 +749,7 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */) if (thd->lex->sql_command == SQLCOM_SHOW_EVENTS) { DBUG_ASSERT(thd->lex->select_lex.db); - if (!is_infoschema_db(thd->lex->select_lex.db) && // There is no events in I_S + if (!is_infoschema_db(thd->lex->select_lex.db) && // There is no events in I_S check_access(thd, EVENT_ACL, thd->lex->select_lex.db, NULL, NULL, 0, 0)) DBUG_RETURN(1); |