diff options
Diffstat (limited to 'sql/event_db_repository.cc')
-rw-r--r-- | sql/event_db_repository.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 753e9d21b65..0696652deb1 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -572,9 +572,9 @@ Event_db_repository::open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE_LIST tables; DBUG_ENTER("Event_db_repository::open_event_table"); - tables.init_one_table("mysql", "event", lock_type); + tables.init_one_table("mysql", 5, "event", 5, "event", lock_type); - if (simple_open_n_lock_tables(thd, &tables)) + if (open_and_lock_tables(thd, &tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT)) { close_thread_tables(thd); DBUG_RETURN(TRUE); @@ -1053,8 +1053,8 @@ update_timing_fields_for_event(THD *thd, Turn off row binlogging of event timing updates. These are not used for RBR of events replicated to the slave. */ - save_binlog_row_based= thd->current_stmt_binlog_row_based; - thd->clear_current_stmt_binlog_row_based(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); DBUG_ASSERT(thd->security_ctx->master_access & SUPER_ACL); @@ -1097,7 +1097,9 @@ end: if (table) close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(test(ret)); } @@ -1127,11 +1129,10 @@ Event_db_repository::check_system_tables(THD *thd) DBUG_ENTER("Event_db_repository::check_system_tables"); DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd)); - /* Check mysql.db */ - tables.init_one_table("mysql", "db", TL_READ); + tables.init_one_table("mysql", 5, "db", 2, "db", TL_READ); - if (simple_open_n_lock_tables(thd, &tables)) + if (open_and_lock_tables(thd, &tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT)) { ret= 1; sql_print_error("Cannot open mysql.db"); @@ -1144,9 +1145,9 @@ Event_db_repository::check_system_tables(THD *thd) close_thread_tables(thd); } /* Check mysql.user */ - tables.init_one_table("mysql", "user", TL_READ); + tables.init_one_table("mysql", 5, "user", 4, "user", TL_READ); - if (simple_open_n_lock_tables(thd, &tables)) + if (open_and_lock_tables(thd, &tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT)) { ret= 1; sql_print_error("Cannot open mysql.user"); @@ -1164,9 +1165,9 @@ Event_db_repository::check_system_tables(THD *thd) close_thread_tables(thd); } /* Check mysql.event */ - tables.init_one_table("mysql", "event", TL_READ); + tables.init_one_table("mysql", 5, "event", 5, "event", TL_READ); - if (simple_open_n_lock_tables(thd, &tables)) + if (open_and_lock_tables(thd, &tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT)) { ret= 1; sql_print_error("Cannot open mysql.event"); |