From e879caf845f3f1209eb2065fc4463a293ad9518c Mon Sep 17 00:00:00 2001 From: Ashish Agarwal Date: Tue, 2 Jul 2013 11:58:39 +0530 Subject: [PATCH 01/51] WL#7076: Backporting wl6715 to support both formats in 5.5, 5.6, 5.7 Backporting wl6715 to mysql-5.5 --- include/mysql/plugin_audit.h | 6 ++- include/mysql/plugin_audit.h.pp | 4 ++ libmysqld/lib_sql.cc | 13 +++--- sql/log.cc | 8 ++-- sql/mysqld.cc | 41 ++++++++++++++++- sql/mysqld.h | 1 + sql/sql_acl.cc | 66 ++++++++++++++------------ sql/sql_audit.cc | 4 ++ sql/sql_audit.h | 80 +++++++++++++++++++++++--------- sql/sql_class.cc | 82 ++++++++++++++++++++++++++------- sql/sql_class.h | 18 ++++++-- sql/sql_connect.cc | 45 ++++++++++-------- sql/sql_db.cc | 4 +- sql/sql_insert.cc | 5 +- sql/sql_parse.cc | 8 ++-- sql/sql_show.cc | 21 +++++---- 16 files changed, 288 insertions(+), 118 deletions(-) diff --git a/include/mysql/plugin_audit.h b/include/mysql/plugin_audit.h index eee32a9e523..0d3f9b8d180 100644 --- a/include/mysql/plugin_audit.h +++ b/include/mysql/plugin_audit.h @@ -25,7 +25,7 @@ #define MYSQL_AUDIT_CLASS_MASK_SIZE 1 -#define MYSQL_AUDIT_INTERFACE_VERSION 0x0300 +#define MYSQL_AUDIT_INTERFACE_VERSION 0x0301 /************************************************************************* @@ -59,6 +59,10 @@ struct mysql_event_general struct charset_info_st *general_charset; unsigned long long general_time; unsigned long long general_rows; + MYSQL_LEX_STRING general_host; + MYSQL_LEX_STRING general_sql_command; + MYSQL_LEX_STRING general_external_user; + MYSQL_LEX_STRING general_ip; }; diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp index 5d90b3efc37..794e2679356 100644 --- a/include/mysql/plugin_audit.h.pp +++ b/include/mysql/plugin_audit.h.pp @@ -210,6 +210,10 @@ struct mysql_event_general struct charset_info_st *general_charset; unsigned long long general_time; unsigned long long general_rows; + MYSQL_LEX_STRING general_host; + MYSQL_LEX_STRING general_sql_command; + MYSQL_LEX_STRING general_external_user; + MYSQL_LEX_STRING general_ip; }; struct mysql_event_connection { diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 2de7217f10b..36dd07159cc 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -699,7 +699,8 @@ int check_embedded_connection(MYSQL *mysql, const char *db) thd_init_client_charset(thd, mysql->charset->number); thd->update_charset(); Security_context *sctx= thd->security_ctx; - sctx->host_or_ip= sctx->host= (char*) my_localhost; + sctx->set_phost(my_localhost); + sctx->host_or_ip= sctx->get_host()->ptr(); strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1); strmake(sctx->priv_user, mysql->user, USERNAME_LENGTH-1); sctx->user= my_strdup(mysql->user, MYF(0)); @@ -727,14 +728,14 @@ int check_embedded_connection(MYSQL *mysql, const char *db) if (mysql->options.client_ip) { - sctx->host= my_strdup(mysql->options.client_ip, MYF(0)); - sctx->ip= my_strdup(sctx->host, MYF(0)); + sctx->set_host(my_strdup(mysql->options.client_ip, MYF(0))); + sctx->set_ip(my_strdup(sctx->host()->ptr(), MYF(0))); } else - sctx->host= (char*)my_localhost; - sctx->host_or_ip= sctx->host; + sctx->set_host((char*)my_localhost); + sctx->host_or_ip= sctx->host->ptr(); - if (acl_check_host(sctx->host, sctx->ip)) + if (acl_check_host(sctx->get_host()->ptr(), sctx->get_ip()->ptr())) goto err; /* construct a COM_CHANGE_USER packet */ diff --git a/sql/log.cc b/sql/log.cc index a5e99f344a4..83ba7b0dd1a 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1218,9 +1218,11 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length, user_host_len= (strxnmov(user_host_buff, MAX_USER_HOST_SIZE, sctx->priv_user ? sctx->priv_user : "", "[", sctx->user ? sctx->user : "", "] @ ", - sctx->host ? sctx->host : "", " [", - sctx->ip ? sctx->ip : "", "]", NullS) - - user_host_buff); + sctx->get_host()->length() ? + sctx->get_host()->ptr() : "", " [", + sctx->get_ip()->length() ? sctx->get_ip()->ptr() : + "", "]", NullS) - user_host_buff); + current_time= my_time_possible_from_micro(current_utime); if (thd->start_utime) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c97a8c542d6..2a3e47b832b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3085,6 +3085,44 @@ SHOW_VAR com_status_vars[]= { {NullS, NullS, SHOW_LONG} }; +LEX_CSTRING sql_statement_names[(uint) SQLCOM_END + 1]; + +void init_sql_statement_names() +{ + static LEX_CSTRING empty= { C_STRING_WITH_LEN("") }; + + char *first_com= (char*) offsetof(STATUS_VAR, com_stat[0]); + char *last_com= (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_END]); + int record_size= (char*) offsetof(STATUS_VAR, com_stat[1]) + - (char*) offsetof(STATUS_VAR, com_stat[0]); + char *ptr; + uint i; + uint com_index; + + for (i= 0; i < ((uint) SQLCOM_END + 1); i++) + sql_statement_names[i]= empty; + + SHOW_VAR *var= &com_status_vars[0]; + while (var->name != NULL) + { + ptr= var->value; + if ((first_com <= ptr) && (ptr <= last_com)) + { + com_index= ((int)(ptr - first_com))/record_size; + DBUG_ASSERT(com_index < (uint) SQLCOM_END); + sql_statement_names[com_index].str= var->name; + /* TODO: Change SHOW_VAR::name to a LEX_STRING, to avoid strlen() */ + sql_statement_names[com_index].length= strlen(var->name); + } + var++; + } + + DBUG_ASSERT(strcmp(sql_statement_names[(uint) SQLCOM_SELECT].str, "select") == 0); + DBUG_ASSERT(strcmp(sql_statement_names[(uint) SQLCOM_SIGNAL].str, "signal") == 0); + + sql_statement_names[(uint) SQLCOM_END].str= "error"; +} + /** Create the name of the default general log file @@ -4274,6 +4312,7 @@ int mysqld_main(int argc, char **argv) /* Must be initialized early for comparison of options name */ system_charset_info= &my_charset_utf8_general_ci; + init_sql_statement_names(); sys_var_init(); #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE @@ -5352,7 +5391,7 @@ void handle_connections_sockets() continue; } if (sock == unix_sock) - thd->security_ctx->host=(char*) my_localhost; + thd->security_ctx->set_host((char*) my_localhost); create_new_thread(thd); } diff --git a/sql/mysqld.h b/sql/mysqld.h index 2857094dba3..8a201925286 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -218,6 +218,7 @@ extern I_List threads; extern char err_shared_dir[]; extern TYPELIB thread_handling_typelib; extern my_decimal decimal_zero; +void init_sql_statement_names(); /* THR_MALLOC is a key which will be used to set/get MEM_ROOT** for a thread, diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 4fd7c02d8da..32a8e49fa7c 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1309,8 +1309,8 @@ bool acl_getroot(Security_context *sctx, char *user, char *host, (host ? host : "(NULL)"), (ip ? ip : "(NULL)"), user, (db ? db : "(NULL)"))); sctx->user= user; - sctx->host= host; - sctx->ip= ip; + sctx->set_host(host); + sctx->set_ip(ip); sctx->host_or_ip= host ? host : (ip ? ip : ""); if (!initialized) @@ -2205,7 +2205,7 @@ static bool test_if_create_new_users(THD *thd) C_STRING_WITH_LEN("user"), "user", TL_WRITE); create_new_users= 1; - db_access=acl_get(sctx->host, sctx->ip, + db_access=acl_get(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), sctx->priv_user, tl.db, 0); if (!(db_access & INSERT_ACL)) { @@ -4631,7 +4631,8 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, } continue; } - GRANT_TABLE *grant_table= table_hash_search(sctx->host, sctx->ip, + GRANT_TABLE *grant_table= table_hash_search(sctx->get_host()->ptr(), + sctx->get_ip()->ptr(), tl->get_db_name(), sctx->priv_user, tl->get_table_name(), @@ -4721,10 +4722,10 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, if (grant->version != grant_version) { grant->grant_table= - table_hash_search(sctx->host, sctx->ip, db_name, - sctx->priv_user, + table_hash_search(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + db_name, sctx->priv_user, table_name, 0); /* purecov: inspected */ - grant->version= grant_version; /* purecov: inspected */ + grant->version= grant_version; /* purecov: inspected */ } if (!(grant_table= grant->grant_table)) goto err; /* purecov: deadcode */ @@ -4871,8 +4872,8 @@ bool check_grant_all_columns(THD *thd, ulong want_access_arg, if (grant->version != grant_version) { grant->grant_table= - table_hash_search(sctx->host, sctx->ip, db_name, - sctx->priv_user, + table_hash_search(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + db_name, sctx->priv_user, table_name, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ } @@ -4930,7 +4931,8 @@ static bool check_grant_db_routine(THD *thd, const char *db, HASH *hash) if (strcmp(item->user, sctx->priv_user) == 0 && strcmp(item->db, db) == 0 && - compare_hostname(&item->host, sctx->host, sctx->ip)) + compare_hostname(&item->host, sctx->get_host()->ptr(), + sctx->get_ip()->ptr())) { return FALSE; } @@ -4974,7 +4976,8 @@ bool check_grant_db(THD *thd,const char *db) idx); if (len < grant_table->key_length && !memcmp(grant_table->hash_key,helping,len) && - compare_hostname(&grant_table->host, sctx->host, sctx->ip)) + compare_hostname(&grant_table->host, sctx->get_host()->ptr(), + sctx->get_ip()->ptr())) { error= FALSE; /* Found match. */ break; @@ -5025,8 +5028,8 @@ bool check_grant_routine(THD *thd, ulong want_access, for (table= procs; table; table= table->next_global) { GRANT_NAME *grant_proc; - if ((grant_proc= routine_hash_search(host, sctx->ip, table->db, user, - table->table_name, is_proc, 0))) + if ((grant_proc= routine_hash_search(host, sctx->get_ip()->ptr(), table->db, + user, table->table_name, is_proc, 0))) table->grant.privilege|= grant_proc->privs; if (want_access & ~table->grant.privilege) @@ -5081,7 +5084,7 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name, Security_context *sctx= thd->security_ctx; mysql_rwlock_rdlock(&LOCK_grant); if ((grant_proc= routine_hash_search(sctx->priv_host, - sctx->ip, db, + sctx->get_ip()->ptr(), db, sctx->priv_user, name, is_proc, 0))) no_routine_acl= !(grant_proc->privs & SHOW_PROC_ACLS); @@ -5105,8 +5108,8 @@ ulong get_table_grant(THD *thd, TABLE_LIST *table) #ifdef EMBEDDED_LIBRARY grant_table= NULL; #else - grant_table= table_hash_search(sctx->host, sctx->ip, db, sctx->priv_user, - table->table_name, 0); + grant_table= table_hash_search(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + db, sctx->priv_user, table->table_name, 0); #endif table->grant.grant_table=grant_table; // Remember for column test table->grant.version=grant_version; @@ -5150,7 +5153,7 @@ ulong get_column_grant(THD *thd, GRANT_INFO *grant, { Security_context *sctx= thd->security_ctx; grant->grant_table= - table_hash_search(sctx->host, sctx->ip, + table_hash_search(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), db_name, sctx->priv_user, table_name, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ @@ -7126,9 +7129,11 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name, if ((au= find_acl_user(combo->host.str=(char*)sctx->host_or_ip,combo->user.str,FALSE))) goto found_acl; - if ((au= find_acl_user(combo->host.str=(char*)sctx->host, combo->user.str,FALSE))) + if ((au= find_acl_user(combo->host.str=(char*)sctx->get_host()->ptr(), + combo->user.str,FALSE))) goto found_acl; - if ((au= find_acl_user(combo->host.str=(char*)sctx->ip, combo->user.str,FALSE))) + if ((au= find_acl_user(combo->host.str=(char*)sctx->get_ip()->ptr(), + combo->user.str,FALSE))) goto found_acl; if((au= find_acl_user(combo->host.str=(char*)"%", combo->user.str, FALSE))) goto found_acl; @@ -7303,9 +7308,9 @@ acl_check_proxy_grant_access(THD *thd, const char *host, const char *user, { ACL_PROXY_USER *proxy= dynamic_element(&acl_proxy_users, i, ACL_PROXY_USER *); - if (proxy->matches(thd->security_ctx->host, + if (proxy->matches(thd->security_ctx->get_host()->ptr(), thd->security_ctx->user, - thd->security_ctx->ip, + thd->security_ctx->get_ip()->ptr(), user) && proxy->get_with_grant()) { @@ -7758,7 +7763,8 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, Security_context *sctx= thd->security_ctx; DBUG_ENTER("fill_effective_table_privileges"); DBUG_PRINT("enter", ("Host: '%s', Ip: '%s', User: '%s', table: `%s`.`%s`", - sctx->priv_host, (sctx->ip ? sctx->ip : "(NULL)"), + sctx->priv_host, (sctx->get_ip()->length() ? + sctx->get_ip()->ptr() : "(NULL)"), (sctx->priv_user ? sctx->priv_user : "(NULL)"), db, table)); /* --skip-grants */ @@ -7780,14 +7786,15 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, } /* db privileges */ - grant->privilege|= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, 0); + grant->privilege|= acl_get(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + sctx->priv_user, db, 0); /* table privileges */ mysql_rwlock_rdlock(&LOCK_grant); if (grant->version != grant_version) { grant->grant_table= - table_hash_search(sctx->host, sctx->ip, db, + table_hash_search(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), db, sctx->priv_user, table, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ @@ -9374,8 +9381,8 @@ server_mpvio_initialize(THD *thd, MPVIO_EXT *mpvio, uint connect_errors, mpvio->thread_id= thd->thread_id; mpvio->server_status= &thd->server_status; mpvio->net= &thd->net; - mpvio->ip= thd->security_ctx->ip; - mpvio->host= thd->security_ctx->host; + mpvio->ip= (char *) thd->security_ctx->get_ip()->ptr(); + mpvio->host= (char *) thd->security_ctx->get_host()->ptr(); mpvio->charset_adapter= charset_adapter; } @@ -9524,9 +9531,10 @@ acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_len) const char *auth_user = acl_user->user ? acl_user->user : ""; ACL_PROXY_USER *proxy_user; /* check if the user is allowed to proxy as another user */ - proxy_user= acl_find_proxy_user(auth_user, sctx->host, sctx->ip, + proxy_user= acl_find_proxy_user(auth_user, sctx->get_host()->ptr(), + sctx->get_ip()->ptr(), mpvio.auth_info.authenticated_as, - &is_proxy_user); + &is_proxy_user); if (is_proxy_user) { ACL_USER *acl_proxy_user; @@ -9651,7 +9659,7 @@ acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_len) } if (mpvio.auth_info.external_user[0]) - sctx->external_user= my_strdup(mpvio.auth_info.external_user, MYF(0)); + sctx->set_external_user(my_strdup(mpvio.auth_info.external_user, MYF(0))); if (res == CR_OK_HANDSHAKE_COMPLETE) thd->stmt_da->disable_status(); diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc index d0a9f412a43..424738890b8 100644 --- a/sql/sql_audit.cc +++ b/sql/sql_audit.cc @@ -83,6 +83,10 @@ static void general_class_handler(THD *thd, uint event_subtype, va_list ap) event.general_query_length= va_arg(ap, unsigned int); event.general_charset= va_arg(ap, struct charset_info_st *); event.general_rows= (unsigned long long) va_arg(ap, ha_rows); + event.general_sql_command= va_arg(ap, MYSQL_LEX_STRING); + event.general_host= va_arg(ap, MYSQL_LEX_STRING); + event.general_external_user= va_arg(ap, MYSQL_LEX_STRING); + event.general_ip= va_arg(ap, MYSQL_LEX_STRING); event_class_dispatch(thd, MYSQL_AUDIT_GENERAL_CLASS, &event); } diff --git a/sql/sql_audit.h b/sql/sql_audit.h index 51c695d091d..408a346540c 100644 --- a/sql/sql_audit.h +++ b/sql/sql_audit.h @@ -49,8 +49,9 @@ static inline uint make_user_name(THD *thd, char *buf) return strxnmov(buf, MAX_USER_HOST_SIZE, sctx->priv_user[0] ? sctx->priv_user : "", "[", sctx->user ? sctx->user : "", "] @ ", - sctx->host ? sctx->host : "", " [", - sctx->ip ? sctx->ip : "", "]", NullS) - buf; + sctx->get_host()->length() ? sctx->get_host()->ptr() : + "", " [", sctx->get_ip()->length() ? sctx->get_ip()->ptr() : + "", "]", NullS) - buf; } /** @@ -75,16 +76,38 @@ void mysql_audit_general_log(THD *thd, time_t time, #ifndef EMBEDDED_LIBRARY if (mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK) { - CHARSET_INFO *clientcs= thd ? thd->variables.character_set_client - : global_system_variables.character_set_client; + MYSQL_LEX_STRING sql_command, ip, host, external_user; + static MYSQL_LEX_STRING empty= { C_STRING_WITH_LEN("") }; + + if (thd) + { + ip.str= (char *) thd->security_ctx->get_ip()->ptr(); + ip.length= thd->security_ctx->get_ip()->length(); + host.str= (char *) thd->security_ctx->get_host()->ptr(); + host.length= thd->security_ctx->get_host()->length(); + external_user.str= (char *) thd->security_ctx->get_external_user()->ptr(); + external_user.length= thd->security_ctx->get_external_user()->length(); + sql_command.str= (char *) sql_statement_names[thd->lex->sql_command].str; + sql_command.length= sql_statement_names[thd->lex->sql_command].length; + } + else + { + ip= empty; + host= empty; + external_user= empty; + sql_command= empty; + } + const CHARSET_INFO *clientcs= thd ? thd->variables.character_set_client + : global_system_variables.character_set_client; mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, MYSQL_AUDIT_GENERAL_LOG, - 0, time, user, userlen, cmd, cmdlen, - query, querylen, clientcs, 0); + 0, time, user, userlen, cmd, cmdlen, query, querylen, + clientcs, 0, sql_command, host, external_user, ip); } #endif } + /** Call audit plugins of GENERAL audit class. event_subtype should be set to one of: @@ -106,11 +129,13 @@ void mysql_audit_general(THD *thd, uint event_subtype, { time_t time= my_time(0); uint msglen= msg ? strlen(msg) : 0; - const char *user; uint userlen; + const char *user; char user_buff[MAX_USER_HOST_SIZE]; CSET_STRING query; + MYSQL_LEX_STRING ip, host, external_user, sql_command; ha_rows rows; + static MYSQL_LEX_STRING empty= { C_STRING_WITH_LEN("") }; if (thd) { @@ -118,17 +143,30 @@ void mysql_audit_general(THD *thd, uint event_subtype, user= user_buff; userlen= make_user_name(thd, user_buff); rows= thd->warning_info->current_row_for_warning(); + ip.str= (char *) thd->security_ctx->get_ip()->ptr(); + ip.length= thd->security_ctx->get_ip()->length(); + host.str= (char *) thd->security_ctx->get_host()->ptr(); + host.length= thd->security_ctx->get_host()->length(); + external_user.str= (char *) thd->security_ctx->get_external_user()->ptr(); + external_user.length= thd->security_ctx->get_external_user()->length(); + sql_command.str= (char *) sql_statement_names[thd->lex->sql_command].str; + sql_command.length= sql_statement_names[thd->lex->sql_command].length; } else { user= 0; userlen= 0; + ip= empty; + host= empty; + external_user= empty; + sql_command= empty; rows= 0; } mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, event_subtype, error_code, time, user, userlen, msg, msglen, - query.str(), query.length(), query.charset(), rows); + query.str(), query.length(), query.charset(), rows, + sql_command, host, external_user, ip); } #endif } @@ -139,14 +177,13 @@ void mysql_audit_general(THD *thd, uint event_subtype, (thd)->thread_id, (thd)->security_ctx->user,\ (thd)->security_ctx->user ? strlen((thd)->security_ctx->user) : 0,\ (thd)->security_ctx->priv_user, strlen((thd)->security_ctx->priv_user),\ - (thd)->security_ctx->external_user,\ - (thd)->security_ctx->external_user ?\ - strlen((thd)->security_ctx->external_user) : 0,\ + (thd)->security_ctx->get_external_user()->ptr(),\ + (thd)->security_ctx->get_external_user()->length(),\ (thd)->security_ctx->proxy_user, strlen((thd)->security_ctx->proxy_user),\ - (thd)->security_ctx->host,\ - (thd)->security_ctx->host ? strlen((thd)->security_ctx->host) : 0,\ - (thd)->security_ctx->ip,\ - (thd)->security_ctx->ip ? strlen((thd)->security_ctx->ip) : 0,\ + (thd)->security_ctx->get_host()->ptr(),\ + (thd)->security_ctx->get_host()->length(),\ + (thd)->security_ctx->get_ip()->ptr(),\ + (thd)->security_ctx->get_ip()->length(),\ (thd)->db, (thd)->db ? strlen((thd)->db) : 0) #define MYSQL_AUDIT_NOTIFY_CONNECTION_DISCONNECT(thd, errcode)\ @@ -160,14 +197,13 @@ void mysql_audit_general(THD *thd, uint event_subtype, (thd)->thread_id, (thd)->security_ctx->user,\ (thd)->security_ctx->user ? strlen((thd)->security_ctx->user) : 0,\ (thd)->security_ctx->priv_user, strlen((thd)->security_ctx->priv_user),\ - (thd)->security_ctx->external_user,\ - (thd)->security_ctx->external_user ?\ - strlen((thd)->security_ctx->external_user) : 0,\ + (thd)->security_ctx->get_external_user()->ptr(),\ + (thd)->security_ctx->get_external_user()->length(),\ (thd)->security_ctx->proxy_user, strlen((thd)->security_ctx->proxy_user),\ - (thd)->security_ctx->host,\ - (thd)->security_ctx->host ? strlen((thd)->security_ctx->host) : 0,\ - (thd)->security_ctx->ip,\ - (thd)->security_ctx->ip ? strlen((thd)->security_ctx->ip) : 0,\ + (thd)->security_ctx->get_host()->ptr(),\ + (thd)->security_ctx->get_host()->length(),\ + (thd)->security_ctx->get_ip()->ptr(),\ + (thd)->security_ctx->get_ip()->length(),\ (thd)->db, (thd)->db ? strlen((thd)->db) : 0) #endif /* SQL_AUDIT_INCLUDED */ diff --git a/sql/sql_class.cc b/sql/sql_class.cc index fb4ed99b8bb..fbe42e0c2da 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -675,7 +675,7 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length, unsigned int max_query_len) { String str(buffer, length, &my_charset_latin1); - const Security_context *sctx= &thd->main_security_ctx; + Security_context *sctx= &thd->main_security_ctx; char header[256]; int len; /* @@ -695,16 +695,16 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length, str.length(0); str.append(header, len); - if (sctx->host) + if (sctx->get_host()->length()) { str.append(' '); - str.append(sctx->host); + str.append(sctx->get_host()->ptr()); } - if (sctx->ip) + if (sctx->get_ip()->length()) { str.append(' '); - str.append(sctx->ip); + str.append(sctx->get_ip()->ptr()); } if (sctx->user) @@ -3341,7 +3341,10 @@ void THD::set_status_var_init() void Security_context::init() { - host= user= ip= external_user= 0; + user= 0; + ip.set("", 0, system_charset_info); + host.set("", 0, system_charset_info); + external_user.set("", 0, system_charset_info); host_or_ip= "connecting host"; priv_user[0]= priv_host[0]= proxy_user[0]= '\0'; master_access= 0; @@ -3350,29 +3353,35 @@ void Security_context::init() #endif } - void Security_context::destroy() { - // If not pointer to constant - if (host != my_localhost) + if (host.ptr() != my_localhost && host.length()) { - my_free(host); - host= NULL; + char *c= (char *) host.ptr(); + host.set("", 0, system_charset_info); + my_free(c); } - if (user != delayed_user) + + if (user) { my_free(user); user= NULL; } - if (external_user) + if (external_user.length()) { - my_free(external_user); - user= NULL; + char *c= (char *) external_user.ptr(); + external_user.set("", 0, system_charset_info); + my_free(c); + } + + if (ip.length()) + { + char *c= (char *) ip.ptr(); + ip.set("", 0, system_charset_info); + my_free(c); } - my_free(ip); - ip= NULL; } @@ -3392,6 +3401,45 @@ bool Security_context::set_user(char *user_arg) return user == 0; } +String *Security_context::get_host() +{ + return (&host); +} + +String *Security_context::get_ip() +{ + return (&ip); +} + +String *Security_context::get_external_user() +{ + return (&external_user); +} + +void Security_context::set_host(const char *str) +{ + uint len= str ? strlen(str) : 0; + host.set(str, len, system_charset_info); +} + +void Security_context::set_ip(const char *str) +{ + uint len= str ? strlen(str) : 0; + ip.set(str, len, system_charset_info); +} + +void Security_context::set_external_user(const char *str) +{ + uint len= str ? strlen(str) : 0; + external_user.set(str, len, system_charset_info); +} + +void Security_context::set_host(const char * str, size_t len) +{ + host.set(str, len, system_charset_info); + host.c_ptr_quick(); +} + #ifndef NO_EMBEDDED_ACCESS_CHECKS /** Initialize this security context from the passed in credentials diff --git a/sql/sql_class.h b/sql/sql_class.h index 093758ce389..6e5e53f4d8f 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -388,6 +388,7 @@ extern const LEX_STRING Diag_condition_item_names[]; #include "sql_lex.h" /* Must be here */ +extern LEX_CSTRING sql_statement_names[(uint) SQLCOM_END + 1]; class Delayed_insert; class select_result; class Time_zone; @@ -895,6 +896,11 @@ void xid_cache_delete(XID_STATE *xid_state); */ class Security_context { +private: + +String host; +String ip; +String external_user; public: Security_context() {} /* Remove gcc warning */ /* @@ -904,13 +910,11 @@ public: priv_user - The user privilege we are using. May be "" for anonymous user. ip - client IP */ - char *host, *user, *ip; + char *user; char priv_user[USERNAME_LENGTH]; char proxy_user[USERNAME_LENGTH + MAX_HOSTNAME + 5]; /* The host privilege we are using */ char priv_host[MAX_HOSTNAME]; - /* The external user (if available) */ - char *external_user; /* points to host if host is available, otherwise points to ip */ const char *host_or_ip; ulong master_access; /* Global privileges from mysql.user */ @@ -925,7 +929,13 @@ public: } bool set_user(char *user_arg); - + String *get_host(); + String *get_ip(); + String *get_external_user(); + void set_host(const char *p); + void set_ip(const char *p); + void set_external_user(const char *p); + void set_host(const char *str, size_t len); #ifndef NO_EMBEDDED_ACCESS_CHECKS bool change_security_context(THD *thd, diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 14a1acdef5e..666d6e7d5e0 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -38,6 +38,7 @@ #include "sql_acl.h" // acl_getroot, NO_ACCESS, SUPER_ACL #include "sql_callback.h" + #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) /* Without SSL the handshake consists of one packet. This packet @@ -490,7 +491,7 @@ static int check_connection(THD *thd) thd->set_active_vio(net->vio); #endif - if (!thd->main_security_ctx.host) // If TCP/IP connection + if (!thd->main_security_ctx.get_host()->length()) // If TCP/IP connection { char ip[NI_MAXHOST]; @@ -512,25 +513,30 @@ static int check_connection(THD *thd) };); /* END : DEBUG */ - if (!(thd->main_security_ctx.ip= my_strdup(ip,MYF(MY_WME)))) + thd->main_security_ctx.set_ip(my_strdup(ip, MYF(MY_WME))); + if (!(thd->main_security_ctx.get_ip()->length())) return 1; /* The error is set by my_strdup(). */ - thd->main_security_ctx.host_or_ip= thd->main_security_ctx.ip; + thd->main_security_ctx.host_or_ip= thd->main_security_ctx.get_ip()->ptr(); if (!(specialflag & SPECIAL_NO_RESOLVE)) { - if (ip_to_hostname(&net->vio->remote, thd->main_security_ctx.ip, - &thd->main_security_ctx.host, &connect_errors)) + char *host= (char *) thd->main_security_ctx.get_host()->ptr(); + if (ip_to_hostname(&net->vio->remote, + thd->main_security_ctx.get_ip()->ptr(), + &host, &connect_errors)) { my_error(ER_BAD_HOST_ERROR, MYF(0)); return 1; } /* Cut very long hostnames to avoid possible overflows */ - if (thd->main_security_ctx.host) + if (thd->main_security_ctx.get_host()->length()) { - if (thd->main_security_ctx.host != my_localhost) - thd->main_security_ctx.host[min(strlen(thd->main_security_ctx.host), - HOSTNAME_LENGTH)]= 0; - thd->main_security_ctx.host_or_ip= thd->main_security_ctx.host; + if (thd->main_security_ctx.get_host()->ptr() != my_localhost) + thd->main_security_ctx.set_host(thd->main_security_ctx.get_host()->ptr(), + min(thd->main_security_ctx.get_host()->length(), + HOSTNAME_LENGTH)); + thd->main_security_ctx.host_or_ip= + thd->main_security_ctx.get_host()->ptr(); } if (connect_errors > max_connect_errors) { @@ -539,11 +545,14 @@ static int check_connection(THD *thd) } } DBUG_PRINT("info",("Host: %s ip: %s", - (thd->main_security_ctx.host ? - thd->main_security_ctx.host : "unknown host"), - (thd->main_security_ctx.ip ? - thd->main_security_ctx.ip : "unknown ip"))); - if (acl_check_host(thd->main_security_ctx.host, thd->main_security_ctx.ip)) + (thd->main_security_ctx.get_host()->length() ? + thd->main_security_ctx.get_host()->ptr() : + "unknown host"), + (thd->main_security_ctx.get_ip()->length() ? + thd->main_security_ctx.get_ip()->ptr() + : "unknown ip"))); + if (acl_check_host(thd->main_security_ctx.get_host()->ptr(), + thd->main_security_ctx.get_ip()->ptr())) { my_error(ER_HOST_NOT_PRIVILEGED, MYF(0), thd->main_security_ctx.host_or_ip); @@ -552,9 +561,9 @@ static int check_connection(THD *thd) } else /* Hostname given means that the connection was on a socket */ { - DBUG_PRINT("info",("Host: %s", thd->main_security_ctx.host)); - thd->main_security_ctx.host_or_ip= thd->main_security_ctx.host; - thd->main_security_ctx.ip= 0; + DBUG_PRINT("info",("Host: %s", thd->main_security_ctx.get_host()->ptr())); + thd->main_security_ctx.host_or_ip= thd->main_security_ctx.get_host()->ptr(); + thd->main_security_ctx.set_ip(""); /* Reset sin_addr */ bzero((char*) &net->vio->remote, sizeof(net->vio->remote)); } diff --git a/sql/sql_db.cc b/sql/sql_db.cc index ee02e811f67..6f5a79ad12f 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1529,8 +1529,8 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) db_access= test_all_bits(sctx->master_access, DB_ACLS) ? DB_ACLS : - acl_get(sctx->host, - sctx->ip, + acl_get(sctx->get_host()->ptr(), + sctx->get_ip()->ptr(), sctx->priv_user, new_db_file_name.str, FALSE) | sctx->master_access; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 94f4403d02e..8dc56965749 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1893,7 +1893,7 @@ public: { DBUG_ENTER("Delayed_insert constructor"); thd.security_ctx->user=(char*) delayed_user; - thd.security_ctx->host=(char*) my_localhost; + thd.security_ctx->set_host(my_localhost); strmake(thd.security_ctx->priv_user, thd.security_ctx->user, USERNAME_LENGTH); thd.current_tablenr=0; @@ -1939,7 +1939,8 @@ public: mysql_cond_destroy(&cond_client); thd.unlink(); // Must be unlinked under lock my_free(thd.query()); - thd.security_ctx->user= thd.security_ctx->host=0; + thd.security_ctx->set_host(""); + thd.security_ctx->user= (char *) thd.security_ctx->get_host()->ptr(); thread_count--; delayed_insert_threads--; mysql_mutex_unlock(&LOCK_thread_count); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ef3454ec9c9..dd9dc53be71 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4806,8 +4806,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, if (!(sctx->master_access & SELECT_ACL)) { if (db && (!thd->db || db_is_pattern || strcmp(db, thd->db))) - db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, - db_is_pattern); + db_access= acl_get(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + sctx->priv_user, db, db_is_pattern); else { /* get access for current db */ @@ -4855,8 +4855,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, } if (db && (!thd->db || db_is_pattern || strcmp(db,thd->db))) - db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, - db_is_pattern); + db_access= acl_get(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + sctx->priv_user, db, db_is_pattern); else db_access= sctx->db_access; DBUG_PRINT("info",("db_access: %lu want_access: %lu", diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2811483a0b1..b620fed9405 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -795,8 +795,8 @@ bool mysqld_show_create_db(THD *thd, char *dbname, if (test_all_bits(sctx->master_access, DB_ACLS)) db_access=DB_ACLS; else - db_access= (acl_get(sctx->host, sctx->ip, sctx->priv_user, dbname, 0) | - sctx->master_access); + db_access= (acl_get(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + sctx->priv_user, dbname, 0) | sctx->master_access); if (!(db_access & DB_ACLS) && check_grant_db(thd,dbname)) { my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), @@ -1832,8 +1832,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) thd_info->user= thd->strdup(tmp_sctx->user ? tmp_sctx->user : (tmp->system_thread ? "system user" : "unauthenticated user")); - if (tmp->peer_port && (tmp_sctx->host || tmp_sctx->ip) && - thd->security_ctx->host_or_ip[0]) + if (tmp->peer_port && (tmp_sctx->get_host()->length() || + tmp_sctx->get_ip()->length()) && thd->security_ctx->host_or_ip[0]) { if ((thd_info->host= (char*) thd->alloc(LIST_PROCESS_HOST_LEN+1))) my_snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN, @@ -1842,7 +1842,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) else thd_info->host= thd->strdup(tmp_sctx->host_or_ip[0] ? tmp_sctx->host_or_ip : - tmp_sctx->host ? tmp_sctx->host : ""); + tmp_sctx->get_host()->length() ? + tmp_sctx->get_host()->ptr() : ""); if ((thd_info->db=tmp->db)) // Safe test thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; @@ -1934,8 +1935,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) (tmp->system_thread ? "system user" : "unauthenticated user"); table->field[1]->store(val, strlen(val), cs); /* HOST */ - if (tmp->peer_port && (tmp_sctx->host || tmp_sctx->ip) && - thd->security_ctx->host_or_ip[0]) + if (tmp->peer_port && (tmp_sctx->get_host()->length() || + tmp_sctx->get_ip()->length()) && thd->security_ctx->host_or_ip[0]) { char host[LIST_PROCESS_HOST_LEN + 1]; my_snprintf(host, LIST_PROCESS_HOST_LEN, "%s:%u", @@ -3746,7 +3747,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) &thd->col_access, NULL, 0, 1) || (!thd->col_access && check_grant_db(thd, db_name->str))) || sctx->master_access & (DB_ACLS | SHOW_DB_ACL) || - acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0)) + acl_get(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + sctx->priv_user, db_name->str, 0)) #endif { List table_names; @@ -3917,7 +3919,8 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond) } #ifndef NO_EMBEDDED_ACCESS_CHECKS if (sctx->master_access & (DB_ACLS | SHOW_DB_ACL) || - acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0) || + acl_get(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), + sctx->priv_user, db_name->str, 0) || !check_grant_db(thd, db_name->str)) #endif { From 3a97df69bf512fb776f9811d8f51b209e9712c7a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Jul 2013 19:41:40 +0200 Subject: [PATCH 02/51] Raise version number after cloning 5.5.33 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b44efde92ba..26414adb678 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=33 +MYSQL_VERSION_PATCH=34 MYSQL_VERSION_EXTRA= From c5cea24c03afcb1e62f50ca6489005abd9683b38 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jul 2013 13:19:53 +0200 Subject: [PATCH 03/51] Raise version number after cloning 5.1.71 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3df96a547d2..333307ccf4b 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.71], [], [mysql]) +AC_INIT([MySQL Server], [5.1.72], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM From 0d71a36d46abeaec07d138e4ca449bd1be7cd146 Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Wed, 10 Jul 2013 10:49:17 +0530 Subject: [PATCH 04/51] Bug #14017206 WITH CONSISTENT SNAPSHOT DOES NOT WORK WITH ISOLATION LEVEL SERIALIZABLE Problem: The documentation claims that WITH CONSISTENT SNAPSHOT will work for both REPEATABLE READ and SERIALIZABLE isolation levels. But it will work only for REPEATABLE READ isolation level. Also, the clause WITH CONSISTENT SNAPSHOT is silently ignored when it is not applicable to the given isolation level. Solution: Generate a warning when the clause WITH CONSISTENT SNAPSHOT is ignored. rb#2797 approved by Kevin. Note: Support team wanted to push this to 5.5+. --- sql/sql_class.cc | 4 ++++ storage/innobase/handler/ha_innodb.cc | 29 +++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index fb4ed99b8bb..03b8cff3e25 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3552,6 +3552,10 @@ extern "C" unsigned long thd_get_thread_id(const MYSQL_THD thd) return((unsigned long)thd->thread_id); } +extern "C" enum_tx_isolation thd_get_trx_isolation(const MYSQL_THD thd) +{ + return thd->tx_isolation; +} #ifdef INNODB_COMPATIBILITY_HOOKS extern "C" struct charset_info_st *thd_charset(MYSQL_THD thd) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 02bae038192..163c89d6cc5 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -87,6 +87,9 @@ extern "C" { #include "ha_prototypes.h" #include "ut0mem.h" #include "ibuf0ibuf.h" + +enum_tx_isolation thd_get_trx_isolation(const THD* thd); + } #include "ha_innodb.h" @@ -391,6 +394,15 @@ innobase_alter_table_flags( /*=======================*/ uint flags); +/******************************************************************//** +Maps a MySQL trx isolation level code to the InnoDB isolation level code +@return InnoDB isolation level */ +static inline +ulint +innobase_map_isolation_level( +/*=========================*/ + enum_tx_isolation iso); /*!< in: MySQL isolation level code */ + static const char innobase_hton_name[]= "InnoDB"; /*************************************************************//** @@ -2705,9 +2717,22 @@ innobase_start_trx_and_assign_read_view( trx_start_if_not_started(trx); - /* Assign a read view if the transaction does not have it yet */ + /* Assign a read view if the transaction does not have it yet. + Do this only if transaction is using REPEATABLE READ isolation + level. */ + trx->isolation_level = innobase_map_isolation_level( + thd_get_trx_isolation(thd)); - trx_assign_read_view(trx); + if (trx->isolation_level == TRX_ISO_REPEATABLE_READ) { + trx_assign_read_view(trx); + } else { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + HA_ERR_UNSUPPORTED, + "InnoDB: WITH CONSISTENT SNAPSHOT " + "was ignored because this phrase " + "can only be used with " + "REPEATABLE READ isolation level."); + } /* Set the MySQL flag to mark that there is an active transaction */ From 5d95304c0541695b968023a359c4198fd7dc7d97 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Wed, 10 Jul 2013 14:00:30 +0800 Subject: [PATCH 05/51] Fix Bug #16710923 - FALSE REPORTS OF DB_FOREIGN_EXCEED_MAX_CASCADE rb://2582 approved by Inaam --- storage/innobase/handler/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 163c89d6cc5..cd6ef0adb5a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -933,7 +933,7 @@ convert_error_code_to_mysql( case DB_INTERRUPTED: my_error(ER_QUERY_INTERRUPTED, MYF(0)); - /* fall through */ + return(-1); case DB_FOREIGN_EXCEED_MAX_CASCADE: push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, From c088c9c4c5f84b7f9f0b1d8bc49d1fce89317c88 Mon Sep 17 00:00:00 2001 From: sayantan dutta Date: Wed, 17 Jul 2013 14:24:02 +0530 Subject: [PATCH 06/51] Bug #17035577 - MTR V1 FAILS TO START SERVER MTR_VERSION=1 PERL MYSQL-TEST-RUN.PL 1ST --- mysql-test/lib/v1/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 12792b297ac..857a28d648f 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -4088,7 +4088,7 @@ sub mysqld_arguments ($$$$) { } mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix); - mtr_add_arg($args, "%s--sort_buffer=256K", $prefix); + mtr_add_arg($args, "%s--sort_buffer_size=256K", $prefix); mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix); if ( $opt_ssl_supported ) From 30a37ca99b7454de9382346901b0caeb9bf8c8cd Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Thu, 18 Jul 2013 11:40:08 +0530 Subject: [PATCH 07/51] BUG#15844882: MYSQLDUMP FROM 5.5 FAILS WITH AN ERROR WHEN TRYING TO DUMP DATA FROM MYSQL-5.6 Analysis -------- Dumping mysql-5.6 data using mysql-5.1/mysql-5.5 'myqldump' utility fails with a syntax error. Server system variable 'sql_quote_show_create' which quotes the identifiers is set in the mysqldump utility. The mysldump utility of mysql-5.1/mysql-5.5 uses deprecated syntax 'SET OPTION' to set the 'sql_quote_show_create' option. The support for the syntax is removed in mysql-5.6. Hence syntax error is reported while taking the dump. Fix: --- Changed the 'mysqldump' code to use the syntax 'SET SQL_QUOTE_SHOW_CREATE' to set the 'sql_quote_show_create' option. That syntax is supported on mysql-5.1, mysql-5.5 and mysql-5.6. NOTE: I have not added an mtr test case since it is difficult to simulate the condition. Also the syntax may not be further simplified in the future. --- client/mysqldump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index b603c9e91af..91226cb45d0 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2502,7 +2502,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, verbose_msg("-- Retrieving table structure for table %s...\n", table); len= my_snprintf(query_buff, sizeof(query_buff), - "SET OPTION SQL_QUOTE_SHOW_CREATE=%d", + "SET SQL_QUOTE_SHOW_CREATE=%d", (opt_quoted || opt_keywords)); if (!create_options) strmov(query_buff+len, @@ -5063,7 +5063,7 @@ static my_bool get_view_structure(char *table, char* db) verbose_msg("-- Retrieving view structure for table %s...\n", table); #ifdef NOT_REALLY_USED_YET - sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d", + sprintf(insert_pat, "SET SQL_QUOTE_SHOW_CREATE=%d", (opt_quoted || opt_keywords)); #endif From 44ac825c5d233ae2afbfd5f71c87f12fb93304fd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Jul 2013 11:59:38 +0530 Subject: [PATCH 08/51] From ce60d8e84fd5927c23d5c4bd56591a16c6fb15ee Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Jul 2013 12:03:00 +0530 Subject: [PATCH 09/51] From 489922f8147a4cf8cf49bea8bde9989deda5417a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Jul 2013 12:15:57 +0530 Subject: [PATCH 10/51] From c38ddd971e95cfec0a723fabf91be753dacc894b Mon Sep 17 00:00:00 2001 From: Astha Pareek Date: Tue, 23 Jul 2013 18:13:43 +0530 Subject: [PATCH 11/51] BUG#16295518 - SYS_VARS.RPL_INIT_SLAVE_FUNC IS FAILING ON MYSQL-5.1 BUG#12535301- SYS_VARS.RPL_INIT_SLAVE_FUNC MISMATCHES IN DAILY-5.5 Problem: sys_vars.rpl_init_slave_func test was not recorded after the last edit. It was disabled on 5.1 after seeing failures due to the above reason. No old failures as this suite never ran with pb2 on 5.1 Fix: Added assert condition after wait for checks. Recorded test and enabled it. --- .../sys_vars/r/rpl_init_slave_func.result | 21 +++++++------------ mysql-test/suite/sys_vars/t/disabled.def | 1 - .../suite/sys_vars/t/rpl_init_slave_func.test | 10 +++++---- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result index bdb586e84c2..ede412c28b7 100644 --- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result +++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result @@ -1,9 +1,5 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; +include/master-slave.inc +[connection master] connection slave SET @start_max_connections= @@global.max_connections; SET @start_init_slave= @@global.init_slave; @@ -18,23 +14,19 @@ SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connec @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1' 1 Expect 1 -SELECT @@global.max_connections= @start_max_connections; -@@global.max_connections= @start_max_connections -1 -Expect 1 +include/assert.inc [@@global.max_connections = @start_max_connections] STOP SLAVE; RESET MASTER; RESET SLAVE; START SLAVE; -SELECT @@global.max_connections = @start_max_connections + 1; -@@global.max_connections = @start_max_connections + 1 -1 -Expect 1 +include/wait_for_slave_to_start.inc +include/assert.inc [@@global.max_connections = @start_max_connections + 1] SET @@global.init_slave = "SET @a=5"; STOP SLAVE; RESET MASTER; RESET SLAVE; START SLAVE; +include/wait_for_slave_to_start.inc SHOW VARIABLES LIKE 'init_slave'; Variable_name Value init_slave SET @a=5 @@ -44,3 +36,4 @@ NULL Expect NULL SET @@global.max_connections= @start_max_connections; SET @@global.init_slave= @start_init_slave; +include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def index c0a343c92ef..98625a2ec54 100644 --- a/mysql-test/suite/sys_vars/t/disabled.def +++ b/mysql-test/suite/sys_vars/t/disabled.def @@ -20,4 +20,3 @@ sys_vars.identity_basic : bug#16295418 2013-02-09 veduggir sys_vars.key_buffer_size_basic_64 : bug#16295418 2013-02-09 veduggir sys_vars.key_buffer_size_func : bug#16295418 2013-02-09 veduggir sys_vars.timestamp_basic_64 : bug#16295457 2013-02-09 veduggir -sys_vars.rpl_init_slave_func : bug#16295518 2013-02-09 veduggir diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test index d4607dc6bf1..edc77816c9c 100644 --- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test +++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test @@ -59,8 +59,9 @@ let $wait_timeout= 240; let $wait_condition= SELECT @@global.max_connections = @start_max_connections; --source include/wait_condition_sp.inc # check that the action in init_slave does not happen immediately -SELECT @@global.max_connections= @start_max_connections; ---echo Expect 1 +--let $assert_text= @@global.max_connections = @start_max_connections +--let $assert_cond= @@global.max_connections = @start_max_connections +--source include/assert.inc # # reset of the server STOP SLAVE; @@ -75,8 +76,9 @@ let $wait_timeout= 90; let $wait_condition= SELECT @@global.max_connections = @start_max_connections + 1; --source include/wait_condition_sp.inc # check that the action in init_slave was executed and had the intended effect -SELECT @@global.max_connections = @start_max_connections + 1; ---echo Expect 1 +--let $assert_text= @@global.max_connections = @start_max_connections + 1 +--let $assert_cond= @@global.max_connections = @start_max_connections + 1 +--source include/assert.inc # # Setting a variable(which is local to a session) and must not be visible SET @@global.init_slave = "SET @a=5"; From 03940a7bd88131d3d9eacd1b2827f346d24e1483 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Wed, 24 Jul 2013 15:44:41 +0530 Subject: [PATCH 12/51] Bug#16865959 - PLEASE BACKPORT BUG 14749800. Since log_throttle is not available in 5.5. Logging of error message for failure of thread to create new connection in "create_thread_to_handle_connection" is not backported. Since, function "my_plugin_log_message" is not available in 5.5 version and since there is incompatibility between sql_print_XXX function compiled with g++ and alog files with gcc to use sql_print_error, changes related to audit log plugin is not backported. --- mysys/my_winthread.c | 6 ++- sql/event_scheduler.cc | 80 ++++++++++++++++++++++++--------------- sql/event_scheduler.h | 2 +- sql/events.cc | 7 ++-- sql/events.h | 2 +- sql/mysqld.cc | 68 ++++++++++++++++++++------------- sql/slave.cc | 6 ++- sql/sql_manager.cc | 9 +++-- sql/sys_vars.cc | 8 +++- storage/myisam/mi_check.c | 12 +++--- 10 files changed, 123 insertions(+), 77 deletions(-) diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c index ac30cf14268..ae7c0926034 100644 --- a/mysys/my_winthread.c +++ b/mysys/my_winthread.c @@ -69,6 +69,7 @@ int pthread_create(pthread_t *thread_id, const pthread_attr_t *attr, uintptr_t handle; struct thread_start_parameter *par; unsigned int stack_size; + int error_no; DBUG_ENTER("pthread_create"); par= (struct thread_start_parameter *)malloc(sizeof(*par)); @@ -89,9 +90,10 @@ int pthread_create(pthread_t *thread_id, const pthread_attr_t *attr, DBUG_RETURN(0); error_return: + error_no= errno; DBUG_PRINT("error", - ("Can't create thread to handle request (error %d)",errno)); - DBUG_RETURN(-1); + ("Can't create thread to handle request (error %d)",error_no)); + DBUG_RETURN(error_no); } diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index f1c684add2b..3fb80203338 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -241,6 +241,12 @@ event_scheduler_thread(void *arg) my_free(arg); if (!res) scheduler->run(thd); + else + { + thd->proc_info= "Clearing"; + net_end(&thd->net); + delete thd; + } DBUG_LEAVE; // Against gcc warnings my_thread_end(); @@ -360,26 +366,26 @@ Event_scheduler::~Event_scheduler() } -/* +/** Starts the scheduler (again). Creates a new THD and passes it to a forked thread. Does not wait for acknowledgement from the new thread that it has started. Asynchronous starting. Most of the needed initializations are done in the current thread to minimize the chance of failure in the spawned thread. - SYNOPSIS - Event_scheduler::start() + @param[out] err_no - errno indicating type of error which caused + failure to start scheduler thread. - RETURN VALUE - FALSE OK - TRUE Error (not reported) + @return + @retval false Success. + @retval true Error. */ bool -Event_scheduler::start() +Event_scheduler::start(int *err_no) { THD *new_thd= NULL; - bool ret= FALSE; + bool ret= false; pthread_t th; struct scheduler_param *scheduler_param_value; DBUG_ENTER("Event_scheduler::start"); @@ -389,10 +395,16 @@ Event_scheduler::start() if (state > INITIALIZED) goto end; + DBUG_EXECUTE_IF("event_scheduler_thread_create_failure", { + *err_no= 11; + Events::opt_event_scheduler= Events::EVENTS_OFF; + ret= true; + goto end; }); + if (!(new_thd= new THD)) { sql_print_error("Event Scheduler: Cannot initialize the scheduler thread"); - ret= TRUE; + ret= true; goto end; } pre_init_event_thread(new_thd); @@ -415,28 +427,30 @@ Event_scheduler::start() DBUG_PRINT("info", ("Setting state go RUNNING")); state= RUNNING; DBUG_PRINT("info", ("Forking new thread for scheduler. THD: 0x%lx", (long) new_thd)); - if (mysql_thread_create(key_thread_event_scheduler, - &th, &connection_attrib, event_scheduler_thread, - (void*)scheduler_param_value)) + if ((*err_no= mysql_thread_create(key_thread_event_scheduler, + &th, &connection_attrib, + event_scheduler_thread, + (void*)scheduler_param_value))) { DBUG_PRINT("error", ("cannot create a new thread")); - state= INITIALIZED; - scheduler_thd= NULL; - ret= TRUE; + sql_print_error("Event scheduler: Failed to start scheduler," + " Can not create thread for event scheduler (errno=%d)", + *err_no); new_thd->proc_info= "Clearing"; DBUG_ASSERT(new_thd->net.buff != 0); net_end(&new_thd->net); - mysql_mutex_lock(&LOCK_thread_count); - thread_count--; - dec_thread_running(); + + state= INITIALIZED; + scheduler_thd= NULL; delete new_thd; - mysql_cond_broadcast(&COND_thread_count); - mysql_mutex_unlock(&LOCK_thread_count); + + delete scheduler_param_value; + ret= true; } + end: UNLOCK_DATA(); - DBUG_RETURN(ret); } @@ -547,7 +561,20 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name) if ((res= mysql_thread_create(key_thread_event_worker, &th, &connection_attrib, event_worker_thread, event_name))) + { + mysql_mutex_lock(&LOCK_global_system_variables); + Events::opt_event_scheduler= Events::EVENTS_OFF; + mysql_mutex_unlock(&LOCK_global_system_variables); + + sql_print_error("Event_scheduler::execute_top: Can not create event worker" + " thread (errno=%d). Stopping event scheduler", res); + + new_thd->proc_info= "Clearing"; + DBUG_ASSERT(new_thd->net.buff != 0); + net_end(&new_thd->net); + goto error; + } ++started_events; @@ -557,17 +584,8 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name) error: DBUG_PRINT("error", ("Event_scheduler::execute_top() res: %d", res)); if (new_thd) - { - new_thd->proc_info= "Clearing"; - DBUG_ASSERT(new_thd->net.buff != 0); - net_end(&new_thd->net); - mysql_mutex_lock(&LOCK_thread_count); - thread_count--; - dec_thread_running(); delete new_thd; - mysql_cond_broadcast(&COND_thread_count); - mysql_mutex_unlock(&LOCK_thread_count); - } + delete event_name; DBUG_RETURN(TRUE); } diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h index aca4b74dd95..9435ee548d9 100644 --- a/sql/event_scheduler.h +++ b/sql/event_scheduler.h @@ -78,7 +78,7 @@ public: /* State changing methods follow */ bool - start(); + start(int *err_no); bool stop(); diff --git a/sql/events.cc b/sql/events.cc index 2cedb007462..8ef90fdb622 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -798,6 +798,7 @@ Events::init(my_bool opt_noacl_or_bootstrap) { THD *thd; + int err_no; bool res= FALSE; DBUG_ENTER("Events::init"); @@ -869,7 +870,7 @@ Events::init(my_bool opt_noacl_or_bootstrap) } if (event_queue->init_queue(thd) || load_events_from_db(thd) || - (opt_event_scheduler == EVENTS_ON && scheduler->start())) + (opt_event_scheduler == EVENTS_ON && scheduler->start(&err_no))) { sql_print_error("Event Scheduler: Error while loading from disk."); res= TRUE; /* fatal error: request unireg_abort */ @@ -1017,9 +1018,9 @@ Events::dump_internal_status() DBUG_VOID_RETURN; } -bool Events::start() +bool Events::start(int *err_no) { - return scheduler->start(); + return scheduler->start(err_no); } bool Events::stop() diff --git a/sql/events.h b/sql/events.h index a337b29049a..f176a81ea9d 100644 --- a/sql/events.h +++ b/sql/events.h @@ -79,7 +79,7 @@ public: /* Protected using LOCK_global_system_variables only. */ static ulong opt_event_scheduler; static bool check_if_system_tables_error(); - static bool start(); + static bool start(int *err_no); static bool stop(); public: diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c97a8c542d6..287ca3e4aa4 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1258,11 +1258,12 @@ void kill_mysql(void) if (!kill_in_progress) { pthread_t tmp; + int error; abort_loop=1; - if (mysql_thread_create(0, /* Not instrumented */ - &tmp, &connection_attrib, kill_server_thread, - (void*) 0)) - sql_print_error("Can't create thread to kill server"); + if ((error= mysql_thread_create(0, /* Not instrumented */ + &tmp, &connection_attrib, + kill_server_thread, (void*) 0))) + sql_print_error("Can't create thread to kill server (errno= %d).", error); } #endif DBUG_VOID_RETURN; @@ -2728,10 +2729,12 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) #endif #ifdef USE_ONE_SIGNAL_HAND pthread_t tmp; - if (mysql_thread_create(0, /* Not instrumented */ - &tmp, &connection_attrib, kill_server_thread, - (void*) &sig)) - sql_print_error("Can't create thread to kill server"); + if ((error= mysql_thread_create(0, /* Not instrumented */ + &tmp, &connection_attrib, + kill_server_thread, + (void*) &sig))) + sql_print_error("Can't create thread to kill server (errno= %d)", + error); #else kill_server((void*) sig); // MIT THREAD has a alarm thread #endif @@ -4116,9 +4119,12 @@ static void create_shutdown_thread() #ifdef __WIN__ hEventShutdown=CreateEvent(0, FALSE, FALSE, shutdown_event_name); pthread_t hThread; - if (mysql_thread_create(key_thread_handle_shutdown, - &hThread, &connection_attrib, handle_shutdown, 0)) - sql_print_warning("Can't create thread to handle shutdown requests"); + int error; + if ((error= mysql_thread_create(key_thread_handle_shutdown, + &hThread, &connection_attrib, + handle_shutdown, 0))) + sql_print_warning("Can't create thread to handle shutdown requests" + " (errno= %d)", error); // On "Stop Service" we have to do regular shutdown Service.SetShutdownEvent(hEventShutdown); @@ -4132,6 +4138,7 @@ static void create_shutdown_thread() static void handle_connections_methods() { pthread_t hThread; + int error; DBUG_ENTER("handle_connections_methods"); if (hPipe == INVALID_HANDLE_VALUE && (!have_tcpip || opt_disable_networking) && @@ -4147,22 +4154,24 @@ static void handle_connections_methods() if (hPipe != INVALID_HANDLE_VALUE) { handler_count++; - if (mysql_thread_create(key_thread_handle_con_namedpipes, - &hThread, &connection_attrib, - handle_connections_namedpipes, 0)) + if ((error= mysql_thread_create(key_thread_handle_con_namedpipes, + &hThread, &connection_attrib, + handle_connections_namedpipes, 0))) { - sql_print_warning("Can't create thread to handle named pipes"); + sql_print_warning("Can't create thread to handle named pipes" + " (errno= %d)", error); handler_count--; } } if (have_tcpip && !opt_disable_networking) { handler_count++; - if (mysql_thread_create(key_thread_handle_con_sockets, - &hThread, &connection_attrib, - handle_connections_sockets_thread, 0)) + if ((error= mysql_thread_create(key_thread_handle_con_sockets, + &hThread, &connection_attrib, + handle_connections_sockets_thread, 0))) { - sql_print_warning("Can't create thread to handle TCP/IP"); + sql_print_warning("Can't create thread to handle TCP/IP", + " (errno= %d)", error); handler_count--; } } @@ -4170,11 +4179,12 @@ static void handle_connections_methods() if (opt_enable_shared_memory) { handler_count++; - if (mysql_thread_create(key_thread_handle_con_sharedmem, - &hThread, &connection_attrib, - handle_connections_shared_memory, 0)) + if ((error= mysql_thread_create(key_thread_handle_con_sharedmem, + &hThread, &connection_attrib, + handle_connections_shared_memory, 0))) { - sql_print_warning("Can't create thread to handle shared memory"); + sql_print_warning("Can't create thread to handle shared memory", + " (errno= %d)", error); handler_count--; } } @@ -4909,11 +4919,14 @@ static void bootstrap(MYSQL_FILE *file) bootstrap_file=file; #ifndef EMBEDDED_LIBRARY // TODO: Enable this - if (mysql_thread_create(key_thread_bootstrap, - &thd->real_id, &connection_attrib, handle_bootstrap, - (void*) thd)) + int error; + if ((error= mysql_thread_create(key_thread_bootstrap, + &thd->real_id, &connection_attrib, + handle_bootstrap, + (void*) thd))) { - sql_print_warning("Can't create thread to handle bootstrap"); + sql_print_warning("Can't create thread to handle bootstrap (errno= %d)", + error); bootstrap_error=-1; DBUG_VOID_RETURN; } @@ -5012,6 +5025,7 @@ void create_thread_to_handle_connection(THD *thd) DBUG_PRINT("error", ("Can't create thread to handle request (error %d)", error)); + thread_count--; thd->killed= THD::KILL_CONNECTION; // Safety mysql_mutex_unlock(&LOCK_thread_count); diff --git a/sql/slave.cc b/sql/slave.cc index 7fbe206c8a3..6e7c80e5803 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -709,6 +709,7 @@ int start_slave_thread( { pthread_t th; ulong start_id; + int error; DBUG_ENTER("start_slave_thread"); DBUG_ASSERT(mi->inited); @@ -735,9 +736,10 @@ int start_slave_thread( } start_id= *slave_run_id; DBUG_PRINT("info",("Creating new slave thread")); - if (mysql_thread_create(thread_key, - &th, &connection_attrib, h_func, (void*)mi)) + if ((error = mysql_thread_create(thread_key, + &th, &connection_attrib, h_func, (void*)mi))) { + sql_print_error("Can't create slave thread (errno= %d).", error); if (start_lock) mysql_mutex_unlock(start_lock); DBUG_RETURN(ER_SLAVE_THREAD); diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc index 221ba56130a..74a670346e0 100644 --- a/sql/sql_manager.cc +++ b/sql/sql_manager.cc @@ -136,9 +136,12 @@ void start_handle_manager() if (flush_time && flush_time != ~(ulong) 0L) { pthread_t hThread; - if (mysql_thread_create(key_thread_handle_manager, - &hThread, &connection_attrib, handle_manager, 0)) - sql_print_warning("Can't create handle_manager thread"); + int error; + if ((error= mysql_thread_create(key_thread_handle_manager, + &hThread, &connection_attrib, + handle_manager, 0))) + sql_print_warning("Can't create handle_manager thread (errno= %d)", + error); } DBUG_VOID_RETURN; } diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 2430a54ffd7..1d0f9691629 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -746,6 +746,7 @@ static bool event_scheduler_check(sys_var *self, THD *thd, set_var *var) } static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type) { + int err_no= 0; uint opt_event_scheduler_value= Events::opt_event_scheduler; mysql_mutex_unlock(&LOCK_global_system_variables); /* @@ -765,11 +766,14 @@ static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type) for deadlocks. See bug#51160. */ bool ret= opt_event_scheduler_value == Events::EVENTS_ON - ? Events::start() + ? Events::start(&err_no) : Events::stop(); mysql_mutex_lock(&LOCK_global_system_variables); if (ret) - my_error(ER_EVENT_SET_VAR_ERROR, MYF(0), 0); + { + Events::opt_event_scheduler= Events::EVENTS_OFF; + my_error(ER_EVENT_SET_VAR_ERROR, MYF(0), err_no); + } return ret; } diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 5b0977bf8d9..995be75ef6a 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -2648,6 +2648,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, ulonglong UNINIT_VAR(key_map); pthread_attr_t thr_attr; ulong max_pack_reclength; + int error; DBUG_ENTER("mi_repair_parallel"); start_records=info->state->records; @@ -2942,12 +2943,13 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, #else param->sort_buffer_length*sort_param[i].key_length/total_key_length; #endif - if (mysql_thread_create(mi_key_thread_find_all_keys, - &sort_param[i].thr, &thr_attr, - thr_find_all_keys, - (void *) (sort_param+i))) + if ((error= mysql_thread_create(mi_key_thread_find_all_keys, + &sort_param[i].thr, &thr_attr, + thr_find_all_keys, + (void *) (sort_param+i)))) { - mi_check_print_error(param,"Cannot start a repair thread"); + mi_check_print_error(param,"Cannot start a repair thread (errno= %d)", + error); /* Cleanup: Detach from the share. Avoid others to be blocked. */ if (io_share.total_threads) remove_io_thread(&sort_param[i].read_cache); From 992a66306d57cc9b368c2ade489be7d4abaaa3c6 Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Wed, 24 Jul 2013 14:33:52 +0200 Subject: [PATCH 13/51] Fix for Bug#16614004 CRASH AFTER READING FREED MEMORY AFTER DOING DDL IN STORED ROUTINE Inside a loop in a stored procedure, we create a partitioned table. The CREATE statement is thus treated as a prepared statement: it is prepared once, and then executed by each iteration. Thus its Lex is reused many times. This Lex contains a part_info member, which describes how the partitions should be laid out, including the partitioning function. Each execution of the CREATE does this, in open_table_from_share (): tmp= mysql_unpack_partition(thd, share->partition_info_str, share->partition_info_str_len, outparam, is_create_table, share->default_part_db_type, &work_part_info_used); ... tmp= fix_partition_func(thd, outparam, is_create_table); The first line calls init_lex_with_single_table() which creates a TABLE_LIST, necessary for the "field fixing" which will be done by the second line; this is how it is created: if ((!(table_ident= new Table_ident(thd, table->s->db, table->s->table_name, TRUE))) || (!(table_list= select_lex->add_table_to_list(thd, table_ident, NULL, 0)))) return TRUE; it is allocated in the execution memory root. Then the partitioning function ("id", stored in Lex -> part_info) is fixed, which calls Item_ident:: fix_fields (), which resolves "id" to the table_list above, and stores in the item's cached_table a pointer to this table_list. The table is created, later it is dropped by another statement, then we execute again the prepared CREATE. This reuses the Lex, thus also its part_info, thus also the item representing the partitioning function (part_info is cloned but it's a shallow cloning); CREATE wants to fix the item again (which is normal, every execution fixes items again), fix_fields () sees that the cached_table pointer is set and picks up the pointed table_list. But this last object does not exist anymore (it was allocated in the execution memory root of the previous execution, so it has been freed), so we access invalid memory. The solution: when creating the table_list, mark that it cannot be cached. --- sql/sql_partition.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index cd4652b19be..7e8e76f5e13 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1007,6 +1007,7 @@ init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex) table->map= 1; //To ensure correct calculation of const item table->get_fields_in_item_tree= TRUE; table_list->table= table; + table_list->cacheable_table= false; return FALSE; } From a1ccfcf84d6528134d6c2b1e51182822821ca6ab Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Thu, 25 Jul 2013 14:53:23 +0530 Subject: [PATCH 14/51] Bug #17076737 DUPLICATE CONSTRAINTS DISPLAYED WHEN NAME INCLUDES "_IBFK_" Problem: When the user specified foreign key name contains "_ibfk_", InnoDB wrongly tries to rename it. Solution: When a table is renamed, all its associated foreign keys will also be renamed, only if the foreign key names are automatically generated. If the foreign key names are given by the user, even if it has _ibfk_ in it, it must not be renamed. rb#2935 approved by Jimmy, Krunal and Satya --- storage/innobase/handler/ha_innodb.cc | 28 +++++----------------- storage/innobase/row/row0mysql.c | 20 +++++++++++++++- storage/innodb_plugin/handler/ha_innodb.cc | 6 +++-- storage/innodb_plugin/row/row0mysql.c | 22 +++++++++++++++-- 4 files changed, 49 insertions(+), 27 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 4ac4a6d200e..9f5ba543a47 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -943,7 +943,8 @@ innobase_convert_from_id( } /********************************************************************** -Converts an identifier from my_charset_filename to UTF-8 charset. */ +Converts an identifier from my_charset_filename to UTF-8 charset. +@return result string length, as returned by strconvert() */ extern "C" uint innobase_convert_to_system_charset( @@ -953,23 +954,15 @@ innobase_convert_to_system_charset( ulint len, /* in: length of 'to', in bytes */ uint* errors) /* out: error return */ { - uint rlen; CHARSET_INFO* cs1 = &my_charset_filename; CHARSET_INFO* cs2 = system_charset_info; - rlen = strconvert(cs1, from, cs2, to, len, errors); - - if (*errors) { - fprintf(stderr, "InnoDB: There was a problem in converting" - "'%s' in charset %s to charset %s", from, cs1->name, - cs2->name); - } - - return(rlen); + return(strconvert(cs1, from, cs2, to, len, errors)); } /********************************************************************** -Converts an identifier from my_charset_filename to UTF-8 charset. */ +Converts an identifier from my_charset_filename to UTF-8 charset. +@return result string length, as returned by strconvert() */ extern "C" uint innobase_convert_to_filename_charset( @@ -979,19 +972,10 @@ innobase_convert_to_filename_charset( ulint len) /* in: length of 'to', in bytes */ { uint errors; - uint rlen; CHARSET_INFO* cs_to = &my_charset_filename; CHARSET_INFO* cs_from = system_charset_info; - rlen = strconvert(cs_from, from, cs_to, to, len, &errors); - - if (errors) { - fprintf(stderr, "InnoDB: There was a problem in converting" - "'%s' in charset %s to charset %s", from, cs_from->name, - cs_to->name); - } - - return(rlen); + return(strconvert(cs_from, from, cs_to, to, len, &errors)); } diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index e513dd6f2a8..037fb576a48 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -3802,12 +3802,28 @@ row_rename_table_for_mysql( if (!new_is_tmp) { /* Rename all constraints. */ char new_table_name[MAX_TABLE_NAME_LEN] = ""; + char old_table_utf8[MAX_TABLE_NAME_LEN] = ""; uint errors = 0; + strncpy(old_table_utf8, old_name, MAX_TABLE_NAME_LEN); + innobase_convert_to_system_charset( + strchr(old_table_utf8, '/') + 1, + strchr(old_name, '/') +1, + MAX_TABLE_NAME_LEN, &errors); + + if (errors) { + /* Table name could not be converted from charset + my_charset_filename to UTF-8. This means that the + table name is already in UTF-8 (#mysql#50). */ + strncpy(old_table_utf8, old_name, MAX_TABLE_NAME_LEN); + } + info = pars_info_create(); pars_info_add_str_literal(info, "new_table_name", new_name); pars_info_add_str_literal(info, "old_table_name", old_name); + pars_info_add_str_literal(info, "old_table_name_utf8", + old_table_utf8); strncpy(new_table_name, new_name, MAX_TABLE_NAME_LEN); innobase_convert_to_system_charset( @@ -3844,6 +3860,8 @@ row_rename_table_for_mysql( "new_db_name := SUBSTR(:new_table_name, 0,\n" " new_db_name_len);\n" "old_t_name_len := LENGTH(:old_table_name);\n" + "gen_constr_prefix := CONCAT(:old_table_name_utf8,\n" + " '_ibfk_');\n" "WHILE found = 1 LOOP\n" " SELECT ID INTO foreign_id\n" " FROM SYS_FOREIGN\n" @@ -3860,7 +3878,7 @@ row_rename_table_for_mysql( " id_len := LENGTH(foreign_id);\n" " IF (INSTR(foreign_id, '/') > 0) THEN\n" " IF (INSTR(foreign_id,\n" - " '_ibfk_') > 0)\n" + " gen_constr_prefix) > 0)\n" " THEN\n" " offset := INSTR(foreign_id, '_ibfk_') - 1;\n" " new_foreign_id :=\n" diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc index adf7e1fb82c..971c55a623c 100644 --- a/storage/innodb_plugin/handler/ha_innodb.cc +++ b/storage/innodb_plugin/handler/ha_innodb.cc @@ -1052,7 +1052,8 @@ innobase_convert_from_id( } /********************************************************************** -Converts an identifier from my_charset_filename to UTF-8 charset. */ +Converts an identifier from my_charset_filename to UTF-8 charset. +@return result string length, as returned by strconvert() */ extern "C" uint innobase_convert_to_system_charset( @@ -11624,7 +11625,8 @@ test_innobase_convert_name() #endif /* UNIV_COMPILE_TEST_FUNCS */ /********************************************************************** -Converts an identifier from my_charset_filename to UTF-8 charset. */ +Converts an identifier from my_charset_filename to UTF-8 charset. +@return result string length, as returned by strconvert() */ extern "C" uint innobase_convert_to_filename_charset( diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c index 05f5d7ab68c..57121448d11 100644 --- a/storage/innodb_plugin/row/row0mysql.c +++ b/storage/innodb_plugin/row/row0mysql.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -3904,12 +3904,28 @@ row_rename_table_for_mysql( } else if (!new_is_tmp) { /* Rename all constraints. */ char new_table_name[MAX_TABLE_NAME_LEN] = ""; + char old_table_utf8[MAX_TABLE_NAME_LEN] = ""; uint errors = 0; + strncpy(old_table_utf8, old_name, MAX_TABLE_NAME_LEN); + innobase_convert_to_system_charset( + strchr(old_table_utf8, '/') + 1, + strchr(old_name, '/') +1, + MAX_TABLE_NAME_LEN, &errors); + + if (errors) { + /* Table name could not be converted from charset + my_charset_filename to UTF-8. This means that the + table name is already in UTF-8 (#mysql#50). */ + strncpy(old_table_utf8, old_name, MAX_TABLE_NAME_LEN); + } + info = pars_info_create(); pars_info_add_str_literal(info, "new_table_name", new_name); pars_info_add_str_literal(info, "old_table_name", old_name); + pars_info_add_str_literal(info, "old_table_name_utf8", + old_table_utf8); strncpy(new_table_name, new_name, MAX_TABLE_NAME_LEN); innobase_convert_to_system_charset( @@ -3946,6 +3962,8 @@ row_rename_table_for_mysql( "new_db_name := SUBSTR(:new_table_name, 0,\n" " new_db_name_len);\n" "old_t_name_len := LENGTH(:old_table_name);\n" + "gen_constr_prefix := CONCAT(:old_table_name_utf8,\n" + " '_ibfk_');\n" "WHILE found = 1 LOOP\n" " SELECT ID INTO foreign_id\n" " FROM SYS_FOREIGN\n" @@ -3962,7 +3980,7 @@ row_rename_table_for_mysql( " id_len := LENGTH(foreign_id);\n" " IF (INSTR(foreign_id, '/') > 0) THEN\n" " IF (INSTR(foreign_id,\n" - " '_ibfk_') > 0)\n" + " gen_constr_prefix) > 0)\n" " THEN\n" " offset := INSTR(foreign_id, '_ibfk_') - 1;\n" " new_foreign_id :=\n" From eb152f86af39303a11a58f1912ff4c0484e1a5ac Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Sat, 27 Jul 2013 17:35:02 +0530 Subject: [PATCH 15/51] BUG#16290902 DROP TEMP TABLE IF EXISTS CAN CAUSE POINT IN TIME RECOVERY FAILURE ON SLAVES Problem: DROP TEMP TABLE IF EXISTS commands can cause point in time recovery (re-applying binlog) failures. Analyses: In RBR, 'DROP TEMPORARY TABLE' commands are always binlogged by adding 'IF EXISTS' clauses. Also, the slave SQL thread will not check replicate.* filter rules for "DROP TEMPORARY TABLE IF EXISTS" queries. If log-slave-updates is enabled on slave, these queries will be binlogged in the format of "USE `db`; DROP TEMPORARY TABLE IF EXISTS `t1`;" irrespective of filtering rules and irrespective of the `db` existence. When users try to recover slave from it's own binlog, use `db` command might fail if `db` is not present on slave. Fix: At the time of writing the 'DROP TEMPORARY TABLE IF EXISTS' query into the binlog, 'use `db`' will not be present and the table name in the query will be a fully qualified table name. Eg: 'USE `db`; DROP TEMPORARY TABLE IF EXISTS `t1`;' will be logged as 'DROP TEMPORARY TABLE IF EXISTS `db`.`t1`;'. --- .../suite/binlog/r/binlog_database.result | 2 +- .../suite/binlog/r/binlog_innodb_row.result | 2 +- .../suite/binlog/r/binlog_row_binlog.result | 4 +- .../binlog/r/binlog_row_drop_tmp_tbl.result | 12 +- .../r/binlog_row_mix_innodb_myisam.result | 2 +- .../binlog/r/binlog_stm_drop_tmp_tbl.result | 10 +- .../r/rpl_mixed_drop_create_temp_table.result | 56 ++--- .../r/rpl_mixed_implicit_commit_binlog.result | 2 +- .../rpl/r/rpl_mixed_mixing_engines.result | 24 +- ...rpl_non_direct_mixed_mixing_engines.result | 24 +- .../rpl_non_direct_row_mixing_engines.result | 24 +- .../rpl_non_direct_stm_mixing_engines.result | 24 +- mysql-test/suite/rpl/r/rpl_row_drop.result | 4 +- .../r/rpl_row_drop_create_temp_table.result | 212 +++++++++--------- .../r/rpl_row_implicit_commit_binlog.result | 2 +- .../suite/rpl/r/rpl_row_mixing_engines.result | 24 +- .../r/rpl_stm_drop_create_temp_table.result | 56 ++--- .../r/rpl_stm_implicit_commit_binlog.result | 2 +- .../suite/rpl/r/rpl_stm_mixing_engines.result | 24 +- .../suite/rpl/r/rpl_temp_table_mix_row.result | 6 +- sql/sql_table.cc | 27 ++- 21 files changed, 280 insertions(+), 263 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index 99066d632ac..556a23cd7b9 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -163,7 +163,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; # diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result index 61f961f16da..ad4cc9e7362 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb_row.result +++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result @@ -57,7 +57,7 @@ DROP TEMPORARY TABLE t1; ############################################### show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1` /* generated by server */ ############################################### # # Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 323d50d8f32..75105689246 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1130,7 +1130,7 @@ COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2, COERCIBILITY(s1) d3; DROP TEMPORARY TABLE tmp1; END -master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `bug39182`.`tmp1` /* generated by server */ DROP PROCEDURE p1; DROP TABLE t1; DROP DATABASE bug39182; @@ -1251,7 +1251,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result index d5986809a7c..ca5181f0106 100644 --- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result @@ -27,12 +27,12 @@ show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test` master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int) -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp3` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp3` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp2` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 406b519aee8..ac36412c360 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -425,7 +425,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ reset master; create table t1 (a int) engine=innodb; diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result index 9c5575840d0..027bf1eaada 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result @@ -34,12 +34,12 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp2(c1 int) master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp3(c1 int) master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int) -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE `tmp3` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp2` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` diff --git a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result index 541234fb5af..761ff2f8e98 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result @@ -76,7 +76,7 @@ Warnings: Note 1051 Unknown table 'tt_xx_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-TXe-Temp'; @@ -93,7 +93,7 @@ Warnings: Note 1051 Unknown table 'tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-NXe-Temp'; @@ -110,8 +110,8 @@ Warnings: Note 1051 Unknown table 'tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-TN-Temp'; @@ -253,7 +253,7 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -275,8 +275,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -326,7 +326,7 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -348,8 +348,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -404,11 +404,11 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -426,18 +426,18 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -669,7 +669,7 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -693,8 +693,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -746,7 +746,7 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -770,8 +770,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -828,11 +828,11 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -852,18 +852,18 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result index baeefe7c6ea..ca3c26d3a2c 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result @@ -427,7 +427,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result index 5982d439a3e..ca60b52c5f7 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -11304,11 +11304,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_11; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11362,11 +11362,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_12; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11406,11 +11406,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_13; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11456,11 +11456,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_14; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11494,11 +11494,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_15; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11544,11 +11544,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_16; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result index 9a72eba851f..0c5ac766ed4 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result @@ -11676,11 +11676,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_11; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11734,11 +11734,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_12; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11778,11 +11778,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_13; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11828,11 +11828,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_14; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11866,11 +11866,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_15; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11916,11 +11916,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_16; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result index 4106dc93198..4ec106cdc66 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result @@ -13536,11 +13536,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_11; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13596,11 +13596,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_12; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13642,11 +13642,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_13; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13694,11 +13694,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_14; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13732,11 +13732,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_15; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13784,11 +13784,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_16; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result index 21031190660..9637b46b9fd 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result @@ -10866,11 +10866,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_11; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -10924,11 +10924,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_12; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -10968,11 +10968,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_13; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11018,11 +11018,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_14; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11056,11 +11056,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_15; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11106,11 +11106,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_16; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result index be7b2d16a0b..cce5f732c50 100644 --- a/mysql-test/suite/rpl/r/rpl_row_drop.result +++ b/mysql-test/suite/rpl/r/rpl_row_drop.result @@ -41,8 +41,8 @@ show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result index db38c2d8005..88754e2cf8c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result @@ -53,14 +53,14 @@ SET @commands= 'Drop-Temp-T-Temp'; DROP TEMPORARY TABLE tt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-N-Temp'; DROP TEMPORARY TABLE nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-Xe-Temp'; @@ -76,7 +76,7 @@ Warnings: Note 1051 Unknown table 'tt_xx_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-TXe-Temp'; @@ -84,7 +84,7 @@ DROP TEMPORARY TABLE tt_tmp_2, tt_1; ERROR 42S02: Unknown table 'tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-If-TXe-Temp'; @@ -93,7 +93,7 @@ Warnings: Note 1051 Unknown table 'tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-NXe-Temp'; @@ -101,7 +101,7 @@ DROP TEMPORARY TABLE nt_tmp_2, tt_1; ERROR 42S02: Unknown table 'tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-If-NXe-Temp'; @@ -110,30 +110,30 @@ Warnings: Note 1051 Unknown table 'tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-TN-Temp'; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-TT-Temp'; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TT-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TT-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-NN-Temp'; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NN-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NN-Temp << -e-e-e-e-e-e-e-e-e-e-e- @@ -150,7 +150,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -170,8 +170,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -183,7 +183,7 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -201,14 +201,14 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -263,7 +263,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -287,8 +287,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -303,7 +303,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -325,8 +325,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -342,7 +342,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -366,8 +366,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -380,7 +380,7 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -400,14 +400,14 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -425,12 +425,12 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -448,20 +448,20 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -473,12 +473,12 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -492,20 +492,20 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -519,7 +519,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -538,7 +538,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -550,7 +550,7 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -567,7 +567,7 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) @@ -593,7 +593,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -615,8 +615,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -628,7 +628,7 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -648,14 +648,14 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -712,7 +712,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -738,8 +738,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -754,7 +754,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -778,8 +778,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -795,7 +795,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -821,8 +821,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -835,7 +835,7 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -857,14 +857,14 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -882,12 +882,12 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -907,20 +907,20 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -932,12 +932,12 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -953,20 +953,20 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -980,7 +980,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1001,7 +1001,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1013,7 +1013,7 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -1032,7 +1032,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) @@ -1140,8 +1140,8 @@ SET @commands= 'Drop-N-TN-Temp'; DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-N-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- @@ -1149,8 +1149,8 @@ SET @commands= 'Drop-TN-Temp'; DROP TABLE tt_tmp_2, nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- @@ -1318,8 +1318,8 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- @@ -1333,8 +1333,8 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- ######################################################################### @@ -1351,9 +1351,9 @@ DROP TEMPORARY TABLE nt_tmp_1; DROP TEMPORARY TABLE nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp'; @@ -1363,9 +1363,9 @@ DROP TEMPORARY TABLE tt_tmp_1; DROP TEMPORARY TABLE tt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -e-e-e-e-e-e-e-e-e-e-e- @@ -1383,13 +1383,13 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -1407,9 +1407,9 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1428,13 +1428,13 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) @@ -1452,9 +1452,9 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result index f81e5db986e..2551f337625 100644 --- a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result @@ -458,7 +458,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result index 4106dc93198..4ec106cdc66 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result @@ -13536,11 +13536,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_11; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13596,11 +13596,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_12; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13642,11 +13642,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_13; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13694,11 +13694,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_14; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13732,11 +13732,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_15; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -13784,11 +13784,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_16; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result index 3f72e281b0b..42f16a4c175 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result @@ -76,7 +76,7 @@ Warnings: Note 1051 Unknown table 'tt_xx_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-TXe-Temp'; @@ -93,7 +93,7 @@ Warnings: Note 1051 Unknown table 'tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-NXe-Temp'; @@ -110,8 +110,8 @@ Warnings: Note 1051 Unknown table 'tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-TN-Temp'; @@ -253,7 +253,7 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -275,8 +275,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -326,7 +326,7 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -348,8 +348,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -404,11 +404,11 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -426,18 +426,18 @@ COMMIT; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -669,7 +669,7 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -693,8 +693,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -746,7 +746,7 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -770,8 +770,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -828,11 +828,11 @@ ROLLBACK; -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -852,18 +852,18 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result index e33a00ea0a2..529fe90b2f0 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result @@ -426,7 +426,7 @@ DROP TEMPORARY TABLE IF EXISTS new_tt_xx; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (8) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result index 6e0ee695b41..04c53413377 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result @@ -11009,11 +11009,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_11; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11067,11 +11067,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_12; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11111,11 +11111,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_13; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11161,11 +11161,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_14; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11199,11 +11199,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_15; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -11249,11 +11249,11 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- DROP TEMPORARY TABLE IF EXISTS tt_xx_16; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result index 8fb910666dc..126f1c4af64 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result +++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result @@ -53,13 +53,13 @@ slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_ slave-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES () slave-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t1_tmp (i1 int) slave-bin.000001 # Query # # use `test`; ALTER TABLE t1_tmp ADD COLUMN b INT -slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1_tmp` /* generated by server */ +slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1_tmp` /* generated by server */ slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F slave-bin.000001 # Xid # # COMMIT /* XID */ -slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */ +slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2_tmp` /* generated by server */ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) slave-bin.000001 # Xid # # COMMIT /* XID */ @@ -102,7 +102,7 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1` /* generated by server */ master-bin.000001 # Query # # COMMIT # Compare the base table. include/diff_tables.inc [master:t1, slave:t1] diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c31ba5bb259..ac121572ab2 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2001,6 +2001,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, bool non_tmp_error= 0; bool trans_tmp_table_deleted= 0, non_trans_tmp_table_deleted= 0; bool non_tmp_table_deleted= 0; + bool is_drop_tmp_if_exists_added= 0; String built_query; String built_trans_tmp_query, built_non_trans_tmp_query; DBUG_ENTER("mysql_rm_table_no_locks"); @@ -2029,6 +2030,15 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, table stems from the fact that such drop does not commit an ongoing transaction and changes to non-transactional tables must be written ahead of the transaction in some circumstances. + + 6- Slave SQL thread ignores all replicate-* filter rules + for temporary tables with 'IF EXISTS' clause. (See sql/sql_parse.cc: + mysql_execute_command() for details). These commands will be binlogged + as they are, even if the default database (from USE `db`) is not present + on the Slave. This can cause point in time recovery failures later + when user uses the slave's binlog to re-apply. Hence at the time of binary + logging, these commands will be written with fully qualified table names + and use `db` will be suppressed. */ if (!dont_log_query) { @@ -2043,6 +2053,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, if (thd->is_current_stmt_binlog_format_row() || if_exists) { + is_drop_tmp_if_exists_added= true; built_trans_tmp_query.set_charset(system_charset_info); built_trans_tmp_query.append("DROP TEMPORARY TABLE IF EXISTS "); built_non_trans_tmp_query.set_charset(system_charset_info); @@ -2120,10 +2131,12 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, String *built_ptr_query= (is_trans ? &built_trans_tmp_query : &built_non_trans_tmp_query); /* - Don't write the database name if it is the current one (or if - thd->db is NULL). + Write the database name if it is not the current one or if + thd->db is NULL or 'IF EXISTS' clause is present in 'DROP TEMPORARY' + query. */ - if (thd->db == NULL || strcmp(db,thd->db) != 0) + if (thd->db == NULL || strcmp(db,thd->db) != 0 + || is_drop_tmp_if_exists_added ) { append_identifier(thd, built_ptr_query, db, db_len); built_ptr_query->append("."); @@ -2317,7 +2330,9 @@ err: error |= thd->binlog_query(THD::STMT_QUERY_TYPE, built_non_trans_tmp_query.ptr(), built_non_trans_tmp_query.length(), - FALSE, FALSE, FALSE, 0); + FALSE, FALSE, + is_drop_tmp_if_exists_added, + 0); } if (trans_tmp_table_deleted) { @@ -2327,7 +2342,9 @@ err: error |= thd->binlog_query(THD::STMT_QUERY_TYPE, built_trans_tmp_query.ptr(), built_trans_tmp_query.length(), - TRUE, FALSE, FALSE, 0); + TRUE, FALSE, + is_drop_tmp_if_exists_added, + 0); } if (non_tmp_table_deleted) { From 21b42b819fca9a42dd24cbce6fd314f5f5bad956 Mon Sep 17 00:00:00 2001 From: Aditya A Date: Mon, 29 Jul 2013 11:41:13 +0530 Subject: [PATCH 16/51] Bug #11766851 QUERYING I_S.PARTITIONS CHANGES THE CARDINALITY OF THE PARTITIONS. ANALYSIS -------- Whenever we query I_S.partitions, ha_partition::get_dynamic_partition_info() is called which resets the cardinality according to the number of rows in last partition. Fix --- When we call get_dynamic_partition_info() avoid passing the flag HA_STATUS_CONST to info() since HA_STATUS_CONST should ideally not be called for per partition. [Approved by mattiasj rb#2830 ] --- sql/ha_partition.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 17f02c24422..c3f2af27282 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -5887,7 +5887,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info, uint part_id) { handler *file= m_file[part_id]; - file->info(HA_STATUS_CONST | HA_STATUS_TIME | HA_STATUS_VARIABLE | + file->info(HA_STATUS_TIME | HA_STATUS_VARIABLE | HA_STATUS_VARIABLE_EXTRA | HA_STATUS_NO_LOCK); stat_info->records= file->stats.records; From 1c4a3c52fdacd583d73c3df6c0fb1f975ea098c2 Mon Sep 17 00:00:00 2001 From: Aditya A Date: Mon, 29 Jul 2013 14:45:06 +0530 Subject: [PATCH 17/51] Bug#13417564 SKIP SLEEP IN SRV_MASTER_THREAD WHEN SHUTDOWN IS IN PROGRESS PROBLEM ------- In the background thread srv_master_thread() we have a a one second delay loop which will continuously monitor server activity .If the server is inactive (with out any user activity) or in a shutdown state we do some background activity like flushing the changes.In the current code we are not checking if server is in shutdown state before sleeping for one second. FIX --- If server is in shutdown state ,then dont go to one second sleep. --- storage/innobase/srv/srv0srv.c | 4 ++-- storage/innodb_plugin/srv/srv0srv.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index e5619abbe45..f615384777c 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -2432,7 +2432,7 @@ loop: by x100 (1purge/100msec), to speed up debug scripts which should wait for purged. */ - if (!skip_sleep) { + if (!skip_sleep && !srv_shutdown_state) { os_thread_sleep(100000); } @@ -2448,7 +2448,7 @@ loop: } while (n_pages_purged); } else #endif /* UNIV_DEBUG */ - if (!skip_sleep) { + if (!skip_sleep && !srv_shutdown_state) { os_thread_sleep(1000000); } diff --git a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c index f27f9e37c31..a54a8088a9b 100644 --- a/storage/innodb_plugin/srv/srv0srv.c +++ b/storage/innodb_plugin/srv/srv0srv.c @@ -2518,7 +2518,7 @@ loop: by x100 (1purge/100msec), to speed up debug scripts which should wait for purged. */ - if (!skip_sleep) { + if (!skip_sleep && !srv_shutdown_state) { os_thread_sleep(100000); srv_main_sleeps++; } @@ -2535,7 +2535,7 @@ loop: } while (n_pages_purged); } else #endif /* UNIV_DEBUG */ - if (!skip_sleep) { + if (!skip_sleep && !srv_shutdown_state) { os_thread_sleep(1000000); srv_main_sleeps++; From 592a2b2a94c85fbf1199276789efd32c73ab41f1 Mon Sep 17 00:00:00 2001 From: prabakaran thirumalai Date: Tue, 30 Jul 2013 09:44:11 +0530 Subject: [PATCH 18/51] Bug#17083851 BACKPORT BUG#11765744 TO 5.1, 5.5 AND 5.6 Description: Original fix Bug#11765744 changed mutex to read write lock to avoid multiple recursive lock acquire operation on LOCK_status mutex. On Windows, locking read-write lock recursively is not safe. Slim read-write locks, which MySQL uses if they are supported by Windows version, do not support recursion according to their documentation. For our own implementation of read-write lock, which is used in cases when Windows version doesn't support SRW, recursive locking of read-write lock can easily lead to deadlock if there are concurrent lock requests. Fix: This patch reverts the previous fix for bug#11765744 that used read-write locks. Instead problem of recursive locking for LOCK_status mutex is solved by tracking recursion level using counter in THD object and acquiring lock only once when we enter fill_status() function first time. --- sql/sql_class.cc | 1 + sql/sql_class.h | 11 +++++++++++ sql/sql_show.cc | 10 ++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 80bd4eff457..d71da6403ae 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -605,6 +605,7 @@ THD::THD() Open_tables_state(refresh_version), rli_fake(NULL), rli_slave(NULL), lock_id(&main_lock_id), user_time(0), in_sub_stmt(0), + fill_status_recursion_level(0), sql_log_bin_toplevel(false), binlog_table_maps(0), binlog_flags(0UL), table_map_for_update(0), diff --git a/sql/sql_class.h b/sql/sql_class.h index 4543f9ef7a2..0942e9274b1 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1443,6 +1443,17 @@ public: /* <> 0 if we are inside of trigger or stored function. */ uint in_sub_stmt; + + /** + Used by fill_status() to avoid acquiring LOCK_status mutex twice + when this function is called recursively (e.g. queries + that contains SELECT on I_S.GLOBAL_STATUS with subquery on the + same I_S table). + Incremented each time fill_status() function is entered and + decremented each time before it returns from the function. + */ + uint fill_status_recursion_level; + /* TRUE when the current top has SQL_LOG_BIN ON */ bool sql_log_bin_toplevel; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 7859d7f61e3..a72ca4d1bfc 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5569,14 +5569,20 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond) tmp1= &thd->status_var; } - pthread_mutex_lock(&LOCK_status); + /* + Avoid recursive acquisition of LOCK_status in cases when WHERE clause + represented by "cond" contains subquery on I_S.SESSION/GLOBAL_STATUS. + */ + if (thd->fill_status_recursion_level++ == 0) + pthread_mutex_lock(&LOCK_status); if (option_type == OPT_GLOBAL) calc_sum_of_all_status(&tmp); res= show_status_array(thd, wild, (SHOW_VAR *)all_status_vars.buffer, option_type, tmp1, "", tables->table, upper_case_names, cond); - pthread_mutex_unlock(&LOCK_status); + if (thd->fill_status_recursion_level-- == 1) + pthread_mutex_unlock(&LOCK_status); DBUG_RETURN(res); } From e5a1966bca33a58fb86c557375b93fc04b9c7202 Mon Sep 17 00:00:00 2001 From: Joao Gramacho Date: Wed, 31 Jul 2013 17:54:40 +0100 Subject: [PATCH 19/51] Bug#16997513 MY_STRTOLL10 ACCEPTING OVERFLOWED UNSIGNED LONG LONG VALUES AS NORMAL ONES Problem: ======= It was detected an incorrect behavior of my_strtoll10 function when converting strings with numbers in the following format: "184467440XXXXXXXXXYY" Where XXXXXXXXX > 737095516 and YY <= 15 Samples of problematic numbers: "18446744073709551915" "18446744073709552001" Instead of returning the larger unsigned long long value and setting overflow in the returned error code, my_strtoll10 function returns the lower 64-bits of the evaluated number and did not set overflow in the returned error code. Analysis: ======== Once trying to fix bug 16820156, I've found this bug in the overflow check of my_strtoll10 function. This function, once receiving a string with an integer number larger than 18446744073709551615 (the larger unsigned long long number) should return the larger unsigned long long number and set overflow in the returned error code. Because of a wrong overflow evaluation, the function didn't catch the overflow cases where (i == cutoff) && (j > cutoff2) && (k <= cutoff3). When the overflow evaluation fails, the function return the lower 64-bits of the evaluated number and do not set overflow in the returned error code. Fix: === Corrected the overflow evaluation in my_strtoll10. --- strings/my_strtoll10.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 0f94302fdeb..2b9dc6f44bf 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -206,8 +206,8 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error) goto overflow; /* Check that we didn't get an overflow with the last digit */ - if (i > cutoff || (i == cutoff && ((j > cutoff2 || j == cutoff2) && - k > cutoff3))) + if (i > cutoff || (i == cutoff && (j > cutoff2 || (j == cutoff2 && + k > cutoff3)))) goto overflow; li=i*LFACTOR2+ (ulonglong) j*100 + k; return (longlong) li; From e55d4a88a80bc4a64625d95bce8bffc974cac795 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Wed, 7 Aug 2013 07:56:07 +0530 Subject: [PATCH 20/51] Bug#16416302 - CRASH WITH LOSSY RBR REPLICATION OF OLD STYLE DECIMALS Problem: In RBR, Slave is unable to read row buffer properly when the row event contains MYSQL_TYPE_DECIMAL (old style decimals) data type column. Analysis: In RBR, Slave assumes that Master sends meta data information for all column types like text,blob,varchar,old decimal,new decimal,float, and few other types along with row buffer event. But Master is not sending this meta data information for old style decimal columns. Hence Slave is crashing due to unknown precision value for these column types. Master cannot send this precision value to Slave which will break replication cross-version compatibility. Fix: To fix the crash, Slave will now throw error if it receives old-style decimal datatype. User should consider changing the old-style decimal to new style decimal data type by executing "ALTER table modify column" query as mentioned in http://dev.mysql.com/ doc/refman/5.0/en/upgrading-from-previous-series.html. --- sql/rpl_utility.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 2643f2d6059..1527676ee58 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -878,6 +878,7 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * DBUG_ENTER("table_def::create_conversion_table"); List field_list; + TABLE *conv_table= NULL; /* At slave, columns may differ. So we should create min(columns@master, columns@slave) columns in the @@ -919,10 +920,15 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * break; case MYSQL_TYPE_DECIMAL: - precision= field_metadata(col); - decimals= static_cast(target_table->field[col])->dec; - max_length= field_metadata(col); - break; + sql_print_error("In RBR mode, Slave received incompatible DECIMAL field " + "(old-style decimal field) from Master while creating " + "conversion table. Please consider changing datatype on " + "Master to new style decimal by executing ALTER command for" + " column Name: %s.%s.%s.", + target_table->s->db.str, + target_table->s->table_name.str, + target_table->field[col]->field_name); + goto err; case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: @@ -950,7 +956,9 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * field_def->interval= interval; } - TABLE *conv_table= create_virtual_tmp_table(thd, field_list); + conv_table= create_virtual_tmp_table(thd, field_list); + +err: if (conv_table == NULL) rli->report(ERROR_LEVEL, ER_SLAVE_CANT_CREATE_CONVERSION, ER(ER_SLAVE_CANT_CREATE_CONVERSION), From 77cb5952b7bb6d0afc397628e8389f0402882468 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Aug 2013 15:08:55 +0530 Subject: [PATCH 21/51] From b1742d6025920e056d976bc66a47ee9b17989c1e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Aug 2013 14:28:20 +0530 Subject: [PATCH 22/51] From 8808c6b3504734eaef07c3f1cdd02972678a1b25 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 12 Aug 2013 10:52:08 +0200 Subject: [PATCH 23/51] Bug#17228383: VALGRIND WARNING IN IBUF_DELETE_REC Since the mtr_t struct is marked as invalid in DEBUG_VALGRIND build during mtr_commit, checking mtr->inside_ibuf will cause this warning. Also since mtr->inside_ibuf cannot be set in mtr_commit (assert check) and mtr->state is set to MTR_COMMITTED, the 'ut_ad(!ibuf_inside(&mtr))' check is not needed if 'ut_ad(mtr.state == MTR_COMMITTED)' is also checked. --- storage/innobase/ibuf/ibuf0ibuf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index 0351951f3d2..306cdefc304 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -4373,7 +4373,6 @@ ibuf_delete_rec( BTR_MODIFY_TREE, pcur, mtr)) { mutex_exit(&ibuf_mutex); - ut_ad(!ibuf_inside(mtr)); ut_ad(mtr->state == MTR_COMMITTED); goto func_exit; } @@ -4394,7 +4393,6 @@ ibuf_delete_rec( ibuf_btr_pcur_commit_specify_mtr(pcur, mtr); func_exit: - ut_ad(!ibuf_inside(mtr)); ut_ad(mtr->state == MTR_COMMITTED); btr_pcur_close(pcur); @@ -4731,7 +4729,6 @@ loop: BTR_MODIFY_LEAF, &pcur, &mtr)) { - ut_ad(!ibuf_inside(&mtr)); ut_ad(mtr.state == MTR_COMMITTED); mops[op]++; ibuf_dummy_index_free(dummy_index); From c08f20d5ea21771c3ce5a9068833201d98ce7299 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 12 Aug 2013 11:09:33 +0200 Subject: [PATCH 24/51] Bug#16860588:CRASH WITH CREATE TABLE ... LIKE .. AND PARTITION VALUES IN (NULL) The code assumed there was at least one list element in LIST partitioned table. Fixed by checking the number of list elements. --- sql/partition_info.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 7272978df1d..958f77f5bd0 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -2214,11 +2214,10 @@ int partition_info::fix_parser_data(THD *thd) { part_elem= it++; List_iterator list_val_it(part_elem->list_val_list); - j= 0; num_elements= part_elem->list_val_list.elements; DBUG_ASSERT(part_type == RANGE_PARTITION ? num_elements == 1U : TRUE); - do + for (j= 0; j < num_elements; j++) { part_elem_value *val= list_val_it++; if (column_list) @@ -2253,7 +2252,7 @@ int partition_info::fix_parser_data(THD *thd) list_val_it.remove(); } } - } while (++j < num_elements); + } } while (++i < num_parts); DBUG_RETURN(FALSE); } From 8757f3954314f3edd4b096c2f7fdae85de10345c Mon Sep 17 00:00:00 2001 From: Anirudh Mangipudi Date: Mon, 12 Aug 2013 21:54:50 +0530 Subject: [PATCH 25/51] Bug #16776528 RACE CONDITION CAN CAUSE MYSQLD TO REMOVE SOCKET FILE ERRANTLY Problem Description: A mysqld_safe instance is started. An InnoDB crash recovery begins which takes few seconds to complete. During this crash recovery process happening, another mysqld_safe instance is started with the same server startup parameters. Since the mysqld's pid file is absent during the crash recovery process the second instance assumes there is no other process and tries to acquire a lock on the ibdata files in the datadir. But this step fails and the 2nd instance keeps retrying 100 times each with a delay of 1 second. Now after the 100 attempts, the server goes down, but while going down it hits the mysqld_safe script's cleanup section and without any check it blindly deletes the socket and pid files. Since no lock is placed on the socket file, it gets deleted. Solution: We create a mysqld_safe.pid file in the datadir, which protects the presence server instance resources by storing the mysqld_safe's process id in it. We place a check if the mysqld_safe.pid file is existing in the datadir. If yes then we check if the pid it contains is an active pid or not. If yes again, then the scripts logs an error saying "A mysqld_safe instance is already running". Otherwise it will log the present mysqld_safe's pid into the mysqld_safe.pid file. --- scripts/mysqld_safe.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 48c98f2fde3..f3759cbbf6b 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -343,6 +343,32 @@ fi parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" +# A pid file is created for the mysqld_safe process. This file protects the +# server instance resources during race conditions. +safe_pid="$DATADIR/mysqld_safe.pid" +if test -f $safe_pid +then + PID=`cat "$safe_pid"` + if @CHECK_PID@ + then + if @FIND_PROC@ + then + log_error "A mysqld_safe process already exists" + exit 1 + fi + fi + rm -f "$safe_pid" + if test -f "$safe_pid" + then + log_error "Fatal error: Can't remove the mysqld_safe pid file" + exit 1 + fi +fi + +# Insert pid proerply into the pid file. +ps -e | grep [m]ysqld_safe | awk '{print $1}' | sed -n 1p > $safe_pid +# End of mysqld_safe pid(safe_pid) check. + # Determine what logging facility to use # Ensure that 'logger' exists, if it's requested @@ -352,6 +378,7 @@ then if [ $? -ne 0 ] then log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe." + rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -456,6 +483,7 @@ does not exist or is not executable. Please cd to the mysql installation directory and restart this script from there as follows: ./bin/mysqld_safe& See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information" + rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi @@ -549,6 +577,7 @@ then if @FIND_PROC@ then # The pid contains a mysqld process log_error "A mysqld process already exists" + rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -559,6 +588,7 @@ then $pid_file Please remove it manually and start $0 again; mysqld daemon not started" + rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -644,3 +674,5 @@ done log_notice "mysqld from pid file $pid_file ended" +rm -f "$safe_pid" # Some Extra Safety. File is deleted + # once the mysqld process ends. From 300ac936be090e12b118dc2f8d334d39cace30ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 14 Aug 2013 09:43:21 +0300 Subject: [PATCH 26/51] Bug#16971045 ASSERTION FAILURES ON ROLLBACK OF AN INSERT AFTER A FAILED BLOB WRITE btr_store_big_rec_extern_fields(): Relax a debug assertion so that some BLOB pointers may remain zero if an error occurs. btr_free_externally_stored_field(), row_undo_ins(): Allow the BLOB pointer to be zero on any rollback. rb#3059 approved by Jimmy Yang, Kevin Lewis --- storage/innodb_plugin/ChangeLog | 6 ++++++ storage/innodb_plugin/btr/btr0cur.c | 18 ++++++++++++------ storage/innodb_plugin/row/row0uins.c | 15 ++++++++------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 22d1067455e..3c63e25f6e1 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2013-08-14 The InnoDB Team + + * btr/btr0cur.c, row/row0uins.c: + Fix Bug#16971045 ASSERTION FAILURES ON ROLLBACK OF AN INSERT AFTER + A FAILED BLOB WRITE + 2013-05-15 The InnoDB Team * page/page0zip.c: diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c index 4392fc16a5b..2b98b416793 100644 --- a/storage/innodb_plugin/btr/btr0cur.c +++ b/storage/innodb_plugin/btr/btr0cur.c @@ -4320,6 +4320,10 @@ next_zip_page: } } } + + DBUG_EXECUTE_IF("btr_store_big_rec_extern", + error = DB_OUT_OF_FILE_SPACE; + goto func_exit;); } func_exit: @@ -4352,9 +4356,11 @@ func_exit: field_ref = btr_rec_get_field_ref(rec, offsets, i); - /* The pointer must not be zero. */ + /* The pointer must not be zero if the operation + succeeded. */ ut_a(0 != memcmp(field_ref, field_ref_zero, - BTR_EXTERN_FIELD_REF_SIZE)); + BTR_EXTERN_FIELD_REF_SIZE) + || error != DB_SUCCESS); /* The column must not be disowned by this record. */ ut_a(!(field_ref[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG)); } @@ -4450,10 +4456,10 @@ btr_free_externally_stored_field( if (UNIV_UNLIKELY(!memcmp(field_ref, field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE))) { - /* In the rollback of uncommitted transactions, we may - encounter a clustered index record whose BLOBs have - not been written. There is nothing to free then. */ - ut_a(rb_ctx == RB_RECOVERY || rb_ctx == RB_RECOVERY_PURGE_REC); + /* In the rollback, we may encounter a clustered index + record with some unwritten off-page columns. There is + nothing to free then. */ + ut_a(rb_ctx != RB_NONE); return; } diff --git a/storage/innodb_plugin/row/row0uins.c b/storage/innodb_plugin/row/row0uins.c index 2bf91542bb7..aa12802d081 100644 --- a/storage/innodb_plugin/row/row0uins.c +++ b/storage/innodb_plugin/row/row0uins.c @@ -336,13 +336,14 @@ row_undo_ins( /* The database must have crashed after inserting a clustered index record but before writing all the externally stored columns of - that record. Because secondary index entries - are inserted after the clustered index record, - we may assume that the secondary index record - does not exist. However, this situation may - only occur during the rollback of incomplete - transactions. */ - ut_a(trx_is_recv(node->trx)); + that record, or a statement is being rolled + back because an error occurred while storing + off-page columns. + + Because secondary index entries are inserted + after the clustered index record, we may + assume that the secondary index record does + not exist. */ } else { log_free_check(); err = row_undo_ins_remove_sec(node->index, entry); From 318096074e2e195d7c97d6e08360c3966b49daea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 15 Aug 2013 15:23:23 +0300 Subject: [PATCH 27/51] Bug#17302896 DOUBLE PURGE ON ROLLBACK OF UPDATING A DELETE-MARKED RECORD There was a race condition in the rollback of TRX_UNDO_UPD_DEL_REC. Once row_undo_mod_clust() has rolled back the changes by the rolling-back transaction, it attempts to purge the delete-marked record, if possible, in a separate mini-transaction. However, row_undo_mod_remove_clust_low() fails to check if the DB_TRX_ID of the record that it found after repositioning the cursor, is still the same. If it is not, it means that the record was purged and another record was inserted in its place. So, the rollback would have performed an incorrect purge, breaking the locking rules and causing corruption. The problem was found by creating a table that contains a unique secondary index and a primary key, and two threads running REPLACE with only one value for the unique column, so that the uniqueness constraint would be violated all the time, leading to statement rollback. This bug exists in all InnoDB versions (I checked MySQL 3.23.53). It has become easier to repeat in 5.5 and 5.6 thanks to scalability improvements and a dedicated purge thread. rb#3085 approved by Jimmy Yang --- storage/innobase/row/row0umod.c | 44 ++++++++++++++++++++++---- storage/innodb_plugin/ChangeLog | 6 ++++ storage/innodb_plugin/row/row0umod.c | 47 +++++++++++++++++++++++++--- 3 files changed, 86 insertions(+), 11 deletions(-) diff --git a/storage/innobase/row/row0umod.c b/storage/innobase/row/row0umod.c index 83288c570cb..37e857a4708 100644 --- a/storage/innobase/row/row0umod.c +++ b/storage/innobase/row/row0umod.c @@ -1,7 +1,7 @@ /****************************************************** Undo modify of a row -(c) 1997 Innobase Oy +Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. Created 2/27/1997 Heikki Tuuri *******************************************************/ @@ -94,7 +94,10 @@ row_undo_mod_clust_low( } /*************************************************************** -Removes a clustered index record after undo if possible. */ +Purges a clustered index record after undo if possible. +This is attempted when the record was inserted by updating a +delete-marked record and there no longer exist transactions +that would see the delete-marked record. */ static ulint row_undo_mod_remove_clust_low( @@ -103,13 +106,16 @@ row_undo_mod_remove_clust_low( we may run out of file space */ undo_node_t* node, /* in: row undo node */ que_thr_t* thr __attribute__((unused)), /* in: query thread */ - mtr_t* mtr, /* in: mtr */ + mtr_t* mtr, /* in/out: mini-transaction */ ulint mode) /* in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */ { btr_pcur_t* pcur; btr_cur_t* btr_cur; ulint err; ibool success; + byte* db_trx_id; + + ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC); pcur = &(node->pcur); btr_cur = btr_pcur_get_btr_cur(pcur); @@ -123,11 +129,37 @@ row_undo_mod_remove_clust_low( /* Find out if we can remove the whole clustered index record */ - if (node->rec_type == TRX_UNDO_UPD_DEL_REC - && !row_vers_must_preserve_del_marked(node->new_trx_id, mtr)) { + if (row_vers_must_preserve_del_marked(node->new_trx_id, mtr)) { + return(DB_SUCCESS); + } - /* Ok, we can remove */ + if (!btr_cur_get_index(btr_cur)->trx_id_offset) { + mem_heap_t* heap = NULL; + ulint trx_id_col; + ulint* offsets; + ulint len; + + trx_id_col = dict_index_get_sys_col_pos( + btr_cur_get_index(btr_cur), DATA_TRX_ID); + ut_ad(trx_id_col > 0); + ut_ad(trx_id_col != ULINT_UNDEFINED); + + offsets = rec_get_offsets( + btr_cur_get_rec(btr_cur), btr_cur_get_index(btr_cur), + NULL, trx_id_col + 1, &heap); + + db_trx_id = rec_get_nth_field(btr_cur_get_rec(btr_cur), + offsets, trx_id_col, &len); + ut_ad(len == DATA_TRX_ID_LEN); + mem_heap_free(heap); } else { + db_trx_id = btr_cur_get_rec(btr_cur) + + btr_cur_get_index(btr_cur)->trx_id_offset; + } + + if (ut_dulint_cmp(trx_read_trx_id(db_trx_id), node->new_trx_id)) { + /* The record must have been purged and then replaced + with a different one. */ return(DB_SUCCESS); } diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 3c63e25f6e1..b37697397ac 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2013-08-15 The InnoDB Team + + * row/row0umod.c: + Fix Bug#17302896 DOUBLE PURGE ON ROLLBACK OF UPDATING + A DELETE-MARKED RECORD + 2013-08-14 The InnoDB Team * btr/btr0cur.c, row/row0uins.c: diff --git a/storage/innodb_plugin/row/row0umod.c b/storage/innodb_plugin/row/row0umod.c index f0c1630c7eb..4a9268c243a 100644 --- a/storage/innodb_plugin/row/row0umod.c +++ b/storage/innodb_plugin/row/row0umod.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2010, Innobase Oy. All Rights Reserved. +Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -128,11 +128,10 @@ row_undo_mod_clust_low( } /***********************************************************//** -Removes a clustered index record after undo if possible. +Purges a clustered index record after undo if possible. This is attempted when the record was inserted by updating a delete-marked record and there no longer exist transactions -that would see the delete-marked record. In other words, we -roll back the insert by purging the record. +that would see the delete-marked record. @return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */ static ulint @@ -140,11 +139,12 @@ row_undo_mod_remove_clust_low( /*==========================*/ undo_node_t* node, /*!< in: row undo node */ que_thr_t* thr, /*!< in: query thread */ - mtr_t* mtr, /*!< in: mtr */ + mtr_t* mtr, /*!< in/out: mini-transaction */ ulint mode) /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */ { btr_cur_t* btr_cur; ulint err; + ulint trx_id_offset; ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC); @@ -159,6 +159,43 @@ row_undo_mod_remove_clust_low( btr_cur = btr_pcur_get_btr_cur(&node->pcur); + trx_id_offset = btr_cur_get_index(btr_cur)->trx_id_offset; + + if (!trx_id_offset) { + mem_heap_t* heap = NULL; + ulint trx_id_col; + ulint* offsets; + ulint len; + + trx_id_col = dict_index_get_sys_col_pos( + btr_cur_get_index(btr_cur), DATA_TRX_ID); + ut_ad(trx_id_col > 0); + ut_ad(trx_id_col != ULINT_UNDEFINED); + + offsets = rec_get_offsets( + btr_cur_get_rec(btr_cur), btr_cur_get_index(btr_cur), + NULL, trx_id_col + 1, &heap); + + trx_id_offset = rec_get_nth_field_offs( + offsets, trx_id_col, &len); + ut_ad(len == DATA_TRX_ID_LEN); + mem_heap_free(heap); + } + + if (ut_dulint_cmp(trx_read_trx_id(btr_cur_get_rec(btr_cur) + + trx_id_offset), + node->new_trx_id)) { + /* The record must have been purged and then replaced + with a different one. */ + return(DB_SUCCESS); + } + + /* We are about to remove an old, delete-marked version of the + record that may have been delete-marked by a different transaction + than the rolling-back one. */ + ut_ad(rec_get_deleted_flag(btr_cur_get_rec(btr_cur), + dict_table_is_comp(node->table))); + if (mode == BTR_MODIFY_LEAF) { err = btr_cur_optimistic_delete(btr_cur, mtr) ? DB_SUCCESS From fb2a2d25625f54eab60ff902ab667efbd7891ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 16 Aug 2013 15:45:41 +0300 Subject: [PATCH 28/51] Bug#17312846 CHECK TABLE ASSERTION FAILURE DICT_TABLE_GET_FORMAT(CLUST_INDEX->TABLE) >= 1 The function row_sel_sec_rec_is_for_clust_rec() was incorrectly preparing to compare a NULL column prefix in a secondary index with a non-NULL column in a clustered index. This can trigger an assertion failure in 5.1 plugin and later. In the built-in InnoDB of MySQL 5.1 and earlier, we would apparently only do some extra work, by trimming the clustered index field for the comparison. The code might actually have worked properly apart from this debug assertion failure. It is merely doing some extra work in fetching a BLOB column, and then comparing it to NULL (which would return the same result, no matter what the BLOB contents is). While the test case involves CHECK TABLE, this could theoretically occur during any read that uses a secondary index on a column prefix of a column that can be NULL. rb#3101 approved by Mattias Jonsson --- storage/innobase/row/row0sel.c | 3 ++- storage/innodb_plugin/ChangeLog | 6 ++++++ storage/innodb_plugin/row/row0sel.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index 2137facf638..1a3f4d4a189 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -107,7 +107,8 @@ row_sel_sec_rec_is_for_clust_rec( dict_col_get_clust_pos(col, clust_index), &clust_len); sec_field = rec_get_nth_field(sec_rec, sec_offs, i, &sec_len); - if (ifield->prefix_len > 0 && clust_len != UNIV_SQL_NULL) { + if (ifield->prefix_len > 0 && clust_len != UNIV_SQL_NULL + && sec_len != UNIV_SQL_NULL) { clust_len = dtype_get_at_most_n_mbchars( col->prtype, col->mbminlen, col->mbmaxlen, diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index b37697397ac..719bb89c865 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2013-08-16 The InnoDB Team + + * row/row0sel.c: + Fix Bug#17312846 CHECK TABLE ASSERTION FAILURE + DICT_TABLE_GET_FORMAT(CLUST_INDEX->TABLE) >= 1 + 2013-08-15 The InnoDB Team * row/row0umod.c: diff --git a/storage/innodb_plugin/row/row0sel.c b/storage/innodb_plugin/row/row0sel.c index 4945d107112..76370a38a52 100644 --- a/storage/innodb_plugin/row/row0sel.c +++ b/storage/innodb_plugin/row/row0sel.c @@ -219,7 +219,8 @@ row_sel_sec_rec_is_for_clust_rec( len = clust_len; - if (ifield->prefix_len > 0 && len != UNIV_SQL_NULL) { + if (ifield->prefix_len > 0 && len != UNIV_SQL_NULL + && sec_len != UNIV_SQL_NULL) { if (rec_offs_nth_extern(clust_offs, clust_pos)) { len -= BTR_EXTERN_FIELD_REF_SIZE; From f1e23d73d53814c2c47950c329e1b29a6c9be92d Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Fri, 16 Aug 2013 16:41:20 +0200 Subject: [PATCH 29/51] Added fix Provides for Bug#17211588 --- support-files/mysql.spec.sh | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 9364fb6b8d3..027d440bdf7 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -30,7 +30,7 @@ %global mysqld_group mysql %global mysqldatadir /var/lib/mysql -%define release 1 +%global release 2 # # Macros we use which are not available in all supported versions of RPM @@ -226,7 +226,7 @@ # Configuration based upon above user input, not to be set directly ############################################################################## -%if %{commercial} +%if 0%{?commercial} %define license_files_server %{src_dir}/LICENSE.mysql %define license_type Commercial %else @@ -249,7 +249,6 @@ Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_ URL: http://www.mysql.com/ Packager: MySQL Release Engineering Vendor: %{mysql_vendor} -Provides: msqlormysql MySQL-server BuildRequires: %{distro_buildreq} # Regression tests may take a long time, override the default to skip them @@ -291,9 +290,12 @@ Obsoletes: MySQL-server %else Obsoletes: MySQL-server-advanced %endif -Obsoletes: mysql-server mysql-advanced mysql-server-advanced +Obsoletes: mysql-server < %{version}-%{release} +Obsoletes: mysql-server-advanced Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise Obsoletes: MySQL-server-advanced-gpl MySQL-server-enterprise-gpl +Provides: mysql-server = %{version}-%{release} +Provides: mysql-server%{?_isa} = %{version}-%{release} %description -n MySQL-server%{product_suffix} The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, @@ -333,7 +335,7 @@ Obsoletes: mysql-advanced < %{version}-%{release} Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise Obsoletes: MySQL-client-advanced-gpl MySQL-client-enterprise-gpl Provides: mysql = %{version}-%{release} - +Provides: mysql%{?_isa} = %{version}-%{release} %description -n MySQL-client%{product_suffix} This package contains the standard MySQL clients and administration tools. @@ -351,10 +353,13 @@ Obsoletes: MySQL-test Requires: MySQL-client perl Obsoletes: MySQL-test-advanced %endif -Obsoletes: mysql-test mysql-test-advanced +Obsoletes: mysql-test < %{version}-%{release} +Obsoletes: mysql-test-advanced Obsoletes: mysql-bench MySQL-bench Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise Obsoletes: MySQL-test-advanced-gpl MySQL-test-enterprise-gpl +Provides: mysql-test = %{version}-%{release} +Provides: mysql-test%{?_isa} = %{version}-%{release} AutoReqProv: no %description -n MySQL-test%{product_suffix} @@ -371,10 +376,12 @@ Obsoletes: MySQL-devel %else Obsoletes: MySQL-devel-advanced %endif -Obsoletes: mysql-devel mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced +Obsoletes: mysql-devel < %{version}-%{release} +Obsoletes: mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise Obsoletes: MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl - +Provides: mysql-devel = %{version}-%{release} +Provides: mysql-devel%{?_isa} = %{version}-%{release} %description -n MySQL-devel%{product_suffix} This package contains the development header files and libraries necessary @@ -412,10 +419,13 @@ Obsoletes: MySQL-embedded Requires: MySQL-devel Obsoletes: MySQL-embedded-advanced %endif -Obsoletes: mysql-embedded mysql-embedded-advanced +Obsoletes: mysql-embedded < %{version}-%{release} +Obsoletes: mysql-embedded-advanced Obsoletes: MySQL-embedded-pro Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise Obsoletes: MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl +Provides: mysql-embedded = %{version}-%{release} +Provides: mysql-emdedded%{?_isa} = %{version}-%{release} %description -n MySQL-embedded%{product_suffix} This package contains the MySQL server as an embedded library. @@ -1204,6 +1214,9 @@ echo "=====" >> $STATUS_HISTORY # merging BK trees) ############################################################################## %changelog +* Fri Aug 16 2013 Balasubramanian Kandasamy +- Added fix for Bug17211588 + * Wed Jun 26 2013 Balasubramanian Kandasamy - Cleaned up spec file to resolve rpm dependencies. From 1e904e36e56aedd6ee5723e7e3851b4943834bd2 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Fri, 16 Aug 2013 17:48:54 +0200 Subject: [PATCH 30/51] dummy commit --- support-files/mysql.spec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 027d440bdf7..0c50490753d 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -32,6 +32,7 @@ %global release 2 + # # Macros we use which are not available in all supported versions of RPM # From c250dbf38501bfa8be51e7c2b3e0a6d8397b8403 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Aug 2013 21:51:59 +0530 Subject: [PATCH 31/51] From fc2c66929737594f5d6b31a25c65e1ec4a524664 Mon Sep 17 00:00:00 2001 From: Dmitry Lenev Date: Tue, 20 Aug 2013 13:12:34 +0400 Subject: [PATCH 32/51] Fix for bug#14188793 - "DEADLOCK CAUSED BY ALTER TABLE DOEN'T CLEAR STATUS OF ROLLBACKED TRANSACTION" and bug #17054007 - "TRANSACTION IS NOT FULLY ROLLED BACK IN CASE OF INNODB DEADLOCK". The problem in the first bug report was that although deadlock involving metadata locks was reported using the same error code and message as InnoDB deadlock it didn't rollback transaction like the latter. This caused confusion to users as in some cases after ER_LOCK_DEADLOCK transaction could have been restarted immediately and in some cases rollback was required. The problem in the second bug report was that although InnoDB deadlock caused transaction rollback in all storage engines it didn't cause release of metadata locks. So concurrent DDL on the tables used in transaction was blocked until implicit or explicit COMMIT or ROLLBACK was issued in the connection which got InnoDB deadlock. The former issue has stemmed from the fact that when support for detection and reporting metadata locks deadlocks was added we erroneously assumed that InnoDB doesn't rollback transaction on deadlock but only last statement (while this is what happens on InnoDB lock timeout actually) and so didn't implement rollback of transactions on MDL deadlocks. The latter issue was caused by the fact that rollback of transaction due to deadlock is carried out by setting THD::transaction_rollback_request flag at the point where deadlock is detected and performing rollback inside of trans_rollback_stmt() call when this flag is set. And trans_rollback_stmt() is not aware of MDL locks, so no MDL locks are released. This patch solves these two problems in the following way: - In case when MDL deadlock is detect transaction rollback is requested by setting THD::transaction_rollback_request flag. - Code performing rollback of transaction if THD::transaction_rollback_request is moved out from trans_rollback_stmt(). Now we handle rollback request on the same level as we call trans_rollback_stmt() and release statement/ transaction MDL locks. --- mysql-test/include/handler.inc | 5 ++- mysql-test/r/handler_innodb.result | 11 ++++-- mysql-test/r/handler_myisam.result | 11 ++++-- mysql-test/r/mdl_sync.result | 30 +++------------- mysql-test/t/mdl_sync.test | 56 +++--------------------------- sql/ha_ndbcluster_binlog.cc | 8 ++++- sql/handler.cc | 12 +++++-- sql/log_event.cc | 12 ++++++- sql/log_event_old.cc | 5 ++- sql/rpl_rli.cc | 11 ++++-- sql/sp_head.cc | 34 +++++++++++++----- sql/sql_admin.cc | 16 +++++++-- sql/sql_base.cc | 38 ++++++++++---------- sql/sql_base.h | 6 ++-- sql/sql_cache.cc | 9 +++-- sql/sql_handler.cc | 3 ++ sql/sql_parse.cc | 39 ++++++++++++++++++--- sql/sql_prepare.cc | 19 +++++++++- sql/sql_table.cc | 28 +++++++++++---- sql/transaction.cc | 45 ++++++++++++++++++++++-- sql/transaction.h | 1 + 21 files changed, 257 insertions(+), 142 deletions(-) diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc index 57d368960bf..2a015ca9c80 100644 --- a/mysql-test/include/handler.inc +++ b/mysql-test/include/handler.inc @@ -1087,8 +1087,7 @@ connection con1; connection default; --echo # --echo # Demonstrate that HANDLER locks and transaction locks ---echo # reside in the same context, and we don't back-off ---echo # when have transaction or handler locks. +--echo # reside in the same context. --echo # create table t1 (a int, key a (a)); insert into t1 (a) values (1), (2), (3), (4), (5); @@ -1109,9 +1108,9 @@ let $wait_condition=select count(*)=1 from information_schema.processlist --source include/wait_condition.inc --echo # --> connection default connection default; +--echo # We back-off on hitting deadlock condition. --error ER_LOCK_DEADLOCK handler t0 open; ---error ER_LOCK_DEADLOCK select * from t0; handler t1 open; commit; diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result index dd4cac669c8..8f75ba7ff03 100644 --- a/mysql-test/r/handler_innodb.result +++ b/mysql-test/r/handler_innodb.result @@ -1104,8 +1104,7 @@ handler t1 close; # --> connection default # # Demonstrate that HANDLER locks and transaction locks -# reside in the same context, and we don't back-off -# when have transaction or handler locks. +# reside in the same context. # create table t1 (a int, key a (a)); insert into t1 (a) values (1), (2), (3), (4), (5); @@ -1125,10 +1124,16 @@ rename table t0 to t3, t1 to t0, t3 to t1; # --> connection con1 # Waiting for 'rename table ...' to get blocked... # --> connection default +# We back-off on hitting deadlock condition. handler t0 open; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction select * from t0; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +a +1 +2 +3 +4 +5 handler t1 open; commit; handler t1 close; diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result index 69d791b8263..2b328a9f02c 100644 --- a/mysql-test/r/handler_myisam.result +++ b/mysql-test/r/handler_myisam.result @@ -1100,8 +1100,7 @@ handler t1 close; # --> connection default # # Demonstrate that HANDLER locks and transaction locks -# reside in the same context, and we don't back-off -# when have transaction or handler locks. +# reside in the same context. # create table t1 (a int, key a (a)); insert into t1 (a) values (1), (2), (3), (4), (5); @@ -1121,10 +1120,16 @@ rename table t0 to t3, t1 to t0, t3 to t1; # --> connection con1 # Waiting for 'rename table ...' to get blocked... # --> connection default +# We back-off on hitting deadlock condition. handler t0 open; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction select * from t0; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +a +1 +2 +3 +4 +5 handler t1 open; commit; handler t1 close; diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index b2e71faf741..4f929a5760f 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -1843,15 +1843,11 @@ rename table t2 to t0, t1 to t2, t0 to t1;; # for 'deadlock_con1' which holds shared metadata lock on 't2'. # # The below statement should not wait as doing so will cause deadlock. -# Instead it should fail and emit ER_LOCK_DEADLOCK statement. +# Instead it should fail and emit ER_LOCK_DEADLOCK statement and +# transaction should be rolled back. select * from t1; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction # -# Let us check that failure of the above statement has not released -# metadata lock on table 't1', i.e. that RENAME TABLE is still blocked. -# Commit transaction to unblock RENAME TABLE. -commit; -# # Switching to connection 'default'. # Reap RENAME TABLE. # @@ -1888,16 +1884,10 @@ unlock tables; # Switching to connection 'deadlock_con1'. # Since the latest RENAME TABLE entered in deadlock with SELECT # statement the latter should be aborted and emit ER_LOCK_DEADLOCK -# error. +# error and transaction should be rolled back. # Reap SELECT * FROM t1. ERROR 40001: Deadlock found when trying to get lock; try restarting transaction # -# Again let us check that failure of the SELECT statement has not -# released metadata lock on table 't2', i.e. that the latest RENAME -# is blocked. -# Commit transaction to unblock this RENAME TABLE. -commit; -# # Switching to connection 'deadlock_con2'. # Reap RENAME TABLE ... . # @@ -1931,14 +1921,10 @@ alter table t1 add column j int, rename to t2;; # metadata lock on 't2' and starts waiting for connection # 'deadlock_con1' which holds shared lock on 't1'. # The below statement should not wait as it will cause deadlock. -# An appropriate error should be reported instead. +# An appropriate error should be reported instead and transaction +# should be rolled back. select * from t2; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -# Again let us check that failure of the above statement has not -# released all metadata locks in connection 'deadlock_con1' and -# so ALTER TABLE ... RENAME is still blocked. -# Commit transaction to unblock ALTER TABLE ... RENAME. -commit; # # Switching to connection 'default'. # Reap ALTER TABLE ... RENAME. @@ -2426,12 +2412,6 @@ set debug_sync='mdl_acquire_lock_wait SIGNAL alter_go'; update t1 set c3=c3+1 where c2 = 3; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction # -# Let us check that failure of the above statement has not released -# metadata lock on table 't1', i.e. that ALTER TABLE is still blocked. -# Unblock ALTER TABLE by commiting transaction and thus releasing -# metadata lock on 't1'. -commit; -# # Switching to connection 'con46273'. # Reap ALTER TABLE. # diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test index 197cad536e4..f6caa299fd4 100644 --- a/mysql-test/t/mdl_sync.test +++ b/mysql-test/t/mdl_sync.test @@ -2619,21 +2619,11 @@ let $wait_condition= --source include/wait_condition.inc --echo # --echo # The below statement should not wait as doing so will cause deadlock. ---echo # Instead it should fail and emit ER_LOCK_DEADLOCK statement. +--echo # Instead it should fail and emit ER_LOCK_DEADLOCK statement and +--echo # transaction should be rolled back. --error ER_LOCK_DEADLOCK select * from t1; ---echo # ---echo # Let us check that failure of the above statement has not released ---echo # metadata lock on table 't1', i.e. that RENAME TABLE is still blocked. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "rename table t2 to t0, t1 to t2, t0 to t1"; ---source include/wait_condition.inc ---echo # Commit transaction to unblock RENAME TABLE. -commit; - --echo # --echo # Switching to connection 'default'. connection default; @@ -2696,23 +2686,11 @@ unlock tables; connection deadlock_con1; --echo # Since the latest RENAME TABLE entered in deadlock with SELECT --echo # statement the latter should be aborted and emit ER_LOCK_DEADLOCK ---echo # error. +--echo # error and transaction should be rolled back. --echo # Reap SELECT * FROM t1. --error ER_LOCK_DEADLOCK --reap ---echo # ---echo # Again let us check that failure of the SELECT statement has not ---echo # released metadata lock on table 't2', i.e. that the latest RENAME ---echo # is blocked. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "rename table t1 to t0, t2 to t1, t0 to t2"; ---source include/wait_condition.inc ---echo # Commit transaction to unblock this RENAME TABLE. -commit; - --echo # --echo # Switching to connection 'deadlock_con2'. connection deadlock_con2; @@ -2761,22 +2739,11 @@ let $wait_condition= --source include/wait_condition.inc --echo # The below statement should not wait as it will cause deadlock. ---echo # An appropriate error should be reported instead. +--echo # An appropriate error should be reported instead and transaction +--echo # should be rolled back. --error ER_LOCK_DEADLOCK select * from t2; ---echo # Again let us check that failure of the above statement has not ---echo # released all metadata locks in connection 'deadlock_con1' and ---echo # so ALTER TABLE ... RENAME is still blocked. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "alter table t1 add column j int, rename to t2"; ---source include/wait_condition.inc - ---echo # Commit transaction to unblock ALTER TABLE ... RENAME. -commit; - --echo # --echo # Switching to connection 'default'. connection default; @@ -3577,19 +3544,6 @@ set debug_sync='mdl_acquire_lock_wait SIGNAL alter_go'; --error ER_LOCK_DEADLOCK update t1 set c3=c3+1 where c2 = 3; ---echo # ---echo # Let us check that failure of the above statement has not released ---echo # metadata lock on table 't1', i.e. that ALTER TABLE is still blocked. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "alter table t1 add column e int, rename to t2"; ---source include/wait_condition.inc - ---echo # Unblock ALTER TABLE by commiting transaction and thus releasing ---echo # metadata lock on 't1'. -commit; - --echo # --echo # Switching to connection 'con46273'. connection con46273; diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 48edca0a705..15e0b068826 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2422,6 +2422,12 @@ add_ndb_binlog_index_err: thd->is_error() ? trans_rollback_stmt(thd) : trans_commit_stmt(thd); thd->stmt_da->can_overwrite_status= FALSE; close_thread_tables(thd); + /* + There should be no need for rolling back transaction due to deadlock + (since ndb_binlog_index is non transactional). + */ + DBUG_ASSERT(! thd->transaction_rollback_request); + thd->mdl_context.release_transactional_locks(); ndb_binlog_index= 0; thd->variables.option_bits= saved_options; diff --git a/sql/handler.cc b/sql/handler.cc index 98d6e8fb103..c3ad1cade99 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1480,10 +1480,16 @@ int ha_rollback_trans(THD *thd, bool all) } trans->ha_list= 0; trans->no_2pc=0; - if (is_real_trans && thd->transaction_rollback_request && - thd->transaction.xid_state.xa_state != XA_NOTR) - thd->transaction.xid_state.rm_error= thd->stmt_da->sql_errno(); } + + /* + Thanks to possibility of MDL deadlock rollback request can come even if + transaction hasn't been started in any transactional storage engine. + */ + if (is_real_trans && thd->transaction_rollback_request && + thd->transaction.xid_state.xa_state != XA_NOTR) + thd->transaction.xid_state.rm_error= thd->stmt_da->sql_errno(); + /* Always cleanup. Even if nht==0. There may be savepoints. */ if (is_real_trans) thd->transaction.cleanup(); diff --git a/sql/log_event.cc b/sql/log_event.cc index d2682a3eb9e..31ee950dbe4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5104,6 +5104,8 @@ error: thd->stmt_da->can_overwrite_status= FALSE; close_thread_tables(thd); /* + - If transaction rollback was requested due to deadlock + perform it and release metadata locks. - If inside a multi-statement transaction, defer the release of metadata locks until the current transaction is either committed or rolled back. This prevents @@ -5113,7 +5115,12 @@ error: - If in autocommit mode, or outside a transactional context, automatically release metadata locks of the current statement. */ - if (! thd->in_multi_stmt_transaction_mode()) + if (thd->transaction_rollback_request) + { + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + else if (! thd->in_multi_stmt_transaction_mode()) thd->mdl_context.release_transactional_locks(); else thd->mdl_context.release_statement_locks(); @@ -8197,7 +8204,10 @@ static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD * thd) Xid_log_event will come next which will, if some transactional engines are involved, commit the transaction and flush the pending event to the binlog. + If there was a deadlock the transaction should have been rolled back + already. So there should be no need to rollback the transaction. */ + DBUG_ASSERT(! thd->transaction_rollback_request); error|= (error ? trans_rollback_stmt(thd) : trans_commit_stmt(thd)); /* diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 55d8d72ec5d..1462b08e993 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1808,7 +1808,10 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli) Xid_log_event will come next which will, if some transactional engines are involved, commit the transaction and flush the pending event to the binlog. + If there was a deadlock the transaction should have been rolled back + already. So there should be no need to rollback the transaction. */ + DBUG_ASSERT(! thd->transaction_rollback_request); if ((error= (binlog_error ? trans_rollback_stmt(thd) : trans_commit_stmt(thd)))) rli->report(ERROR_LEVEL, error, "Error in %s event: commit of row events failed, " diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 2d302011b44..e4f2e4fd382 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1317,6 +1317,8 @@ void Relay_log_info::slave_close_thread_tables(THD *thd) close_thread_tables(thd); /* + - If transaction rollback was requested due to deadlock + perform it and release metadata locks. - If inside a multi-statement transaction, defer the release of metadata locks until the current transaction is either committed or rolled back. This prevents @@ -1326,7 +1328,12 @@ void Relay_log_info::slave_close_thread_tables(THD *thd) - If in autocommit mode, or outside a transactional context, automatically release metadata locks of the current statement. */ - if (! thd->in_multi_stmt_transaction_mode()) + if (thd->transaction_rollback_request) + { + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + else if (! thd->in_multi_stmt_transaction_mode()) thd->mdl_context.release_transactional_locks(); else thd->mdl_context.release_statement_locks(); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 552a44c7a96..13d1b310599 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2155,10 +2155,18 @@ sp_head::execute_procedure(THD *thd, List *args) close_thread_tables(thd); thd_proc_info(thd, 0); - if (! thd->in_sub_stmt && ! thd->in_multi_stmt_transaction_mode()) - thd->mdl_context.release_transactional_locks(); - else if (! thd->in_sub_stmt) - thd->mdl_context.release_statement_locks(); + if (! thd->in_sub_stmt) + { + if (thd->transaction_rollback_request) + { + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + else if (! thd->in_multi_stmt_transaction_mode()) + thd->mdl_context.release_transactional_locks(); + else + thd->mdl_context.release_statement_locks(); + } thd->rollback_item_tree_changes(); @@ -3008,10 +3016,18 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, close_thread_tables(thd); thd_proc_info(thd, 0); - if (! thd->in_sub_stmt && ! thd->in_multi_stmt_transaction_mode()) - thd->mdl_context.release_transactional_locks(); - else if (! thd->in_sub_stmt) - thd->mdl_context.release_statement_locks(); + if (! thd->in_sub_stmt) + { + if (thd->transaction_rollback_request) + { + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + else if (! thd->in_multi_stmt_transaction_mode()) + thd->mdl_context.release_transactional_locks(); + else + thd->mdl_context.release_statement_locks(); + } } if (m_lex->query_tables_own_last) diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 16fcf120128..f07a8089853 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -859,8 +859,20 @@ send_result_message: } } /* Error path, a admin command failed. */ - trans_commit_stmt(thd); - trans_commit_implicit(thd); + if (thd->transaction_rollback_request) + { + /* + Unlikely, but transaction rollback was requested by one of storage + engines (e.g. due to deadlock). Perform it. + */ + if (trans_rollback_stmt(thd) || trans_rollback_implicit(thd)) + goto err; + } + else + { + if (trans_commit_stmt(thd) || trans_commit_implicit(thd)) + goto err; + } close_thread_tables(thd); thd->mdl_context.release_transactional_locks(); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a8279ec0347..040c0425577 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3941,7 +3941,8 @@ end_unlock: /** Open_table_context */ Open_table_context::Open_table_context(THD *thd, uint flags) - :m_failed_table(NULL), + :m_thd(thd), + m_failed_table(NULL), m_start_of_statement_svp(thd->mdl_context.mdl_savepoint()), m_timeout(flags & MYSQL_LOCK_IGNORE_TIMEOUT ? LONG_TIMEOUT : thd->variables.lock_wait_timeout), @@ -4018,6 +4019,7 @@ request_backoff_action(enum_open_table_action action_arg, if (action_arg != OT_REOPEN_TABLES && m_has_locks) { my_error(ER_LOCK_DEADLOCK, MYF(0)); + mark_transaction_to_rollback(m_thd, true); return TRUE; } /* @@ -4027,7 +4029,7 @@ request_backoff_action(enum_open_table_action action_arg, if (table) { DBUG_ASSERT(action_arg == OT_DISCOVER || action_arg == OT_REPAIR); - m_failed_table= (TABLE_LIST*) current_thd->alloc(sizeof(TABLE_LIST)); + m_failed_table= (TABLE_LIST*) m_thd->alloc(sizeof(TABLE_LIST)); if (m_failed_table == NULL) return TRUE; m_failed_table->init_one_table(table->db, table->db_length, @@ -4044,8 +4046,6 @@ request_backoff_action(enum_open_table_action action_arg, /** Recover from failed attempt of open table by performing requested action. - @param thd Thread context - @pre This function should be called only with "action" != OT_NO_ACTION and after having called @sa close_tables_for_reopen(). @@ -4055,7 +4055,7 @@ request_backoff_action(enum_open_table_action action_arg, bool Open_table_context:: -recover_from_failed_open(THD *thd) +recover_from_failed_open() { bool result= FALSE; /* Execute the action. */ @@ -4067,33 +4067,33 @@ recover_from_failed_open(THD *thd) break; case OT_DISCOVER: { - if ((result= lock_table_names(thd, m_failed_table, NULL, + if ((result= lock_table_names(m_thd, m_failed_table, NULL, get_timeout(), MYSQL_OPEN_SKIP_TEMPORARY))) break; - tdc_remove_table(thd, TDC_RT_REMOVE_ALL, m_failed_table->db, + tdc_remove_table(m_thd, TDC_RT_REMOVE_ALL, m_failed_table->db, m_failed_table->table_name, FALSE); - ha_create_table_from_engine(thd, m_failed_table->db, + ha_create_table_from_engine(m_thd, m_failed_table->db, m_failed_table->table_name); - thd->warning_info->clear_warning_info(thd->query_id); - thd->clear_error(); // Clear error message - thd->mdl_context.release_transactional_locks(); + m_thd->warning_info->clear_warning_info(m_thd->query_id); + m_thd->clear_error(); // Clear error message + m_thd->mdl_context.release_transactional_locks(); break; } case OT_REPAIR: { - if ((result= lock_table_names(thd, m_failed_table, NULL, + if ((result= lock_table_names(m_thd, m_failed_table, NULL, get_timeout(), MYSQL_OPEN_SKIP_TEMPORARY))) break; - tdc_remove_table(thd, TDC_RT_REMOVE_ALL, m_failed_table->db, + tdc_remove_table(m_thd, TDC_RT_REMOVE_ALL, m_failed_table->db, m_failed_table->table_name, FALSE); - result= auto_repair_table(thd, m_failed_table); - thd->mdl_context.release_transactional_locks(); + result= auto_repair_table(m_thd, m_failed_table); + m_thd->mdl_context.release_transactional_locks(); break; } default: @@ -4926,7 +4926,7 @@ restart: TABLE_LIST element. Altough currently this assumption is valid it may change in future. */ - if (ot_ctx.recover_from_failed_open(thd)) + if (ot_ctx.recover_from_failed_open()) goto err; error= FALSE; @@ -4979,7 +4979,7 @@ restart: { close_tables_for_reopen(thd, start, ot_ctx.start_of_statement_svp()); - if (ot_ctx.recover_from_failed_open(thd)) + if (ot_ctx.recover_from_failed_open()) goto err; error= FALSE; @@ -5417,7 +5417,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type, */ thd->mdl_context.rollback_to_savepoint(ot_ctx.start_of_statement_svp()); table_list->mdl_request.ticket= 0; - if (ot_ctx.recover_from_failed_open(thd)) + if (ot_ctx.recover_from_failed_open()) break; } diff --git a/sql/sql_base.h b/sql/sql_base.h index 96ca569dd1f..b118c93ac28 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -519,7 +519,7 @@ public: }; Open_table_context(THD *thd, uint flags); - bool recover_from_failed_open(THD *thd); + bool recover_from_failed_open(); bool request_backoff_action(enum_open_table_action action_arg, TABLE_LIST *table); @@ -559,6 +559,8 @@ public: } private: + /* THD for which tables are opened. */ + THD *m_thd; /** For OT_DISCOVER and OT_REPAIR actions, the table list element for the table which definition should be re-discovered or which diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 34a61e99007..ca3db3b48c0 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1730,7 +1730,12 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d", } else thd->lex->safe_to_cache_query= 0; // Don't try to cache this - /* End the statement transaction potentially started by engine. */ + /* + End the statement transaction potentially started by engine. + Currently our engines do not request rollback from callbacks. + If this is going to change code needs to be reworked. + */ + DBUG_ASSERT(! thd->transaction_rollback_request); trans_rollback_stmt(thd); goto err_unlock; // Parse query } diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index e20ee243b79..b179d54eadf 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -589,7 +589,10 @@ retry: /* Always close statement transaction explicitly, so that the engine doesn't have to count locks. + There should be no need to perform transaction + rollback due to deadlock. */ + DBUG_ASSERT(! thd->transaction_rollback_request); trans_rollback_stmt(thd); mysql_ha_close_table(thd, hash_tables); goto retry; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ef3454ec9c9..dac42457a87 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1183,6 +1183,18 @@ bool dispatch_command(enum enum_server_command command, THD *thd, close_thread_tables(thd); thd->mdl_context.rollback_to_savepoint(mdl_savepoint); + if (thd->transaction_rollback_request) + { + /* + Transaction rollback was requested since MDL deadlock was + discovered while trying to open tables. Rollback transaction + in all storage engines including binary log and release all + locks. + */ + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + thd->cleanup_after_query(); break; } @@ -1833,7 +1845,7 @@ err: can free its locks if LOCK TABLES locked some tables before finding that it can't lock a table in its list */ - trans_commit_implicit(thd); + trans_rollback(thd); /* Close tables and release metadata locks. */ close_thread_tables(thd); DBUG_ASSERT(!thd->locked_tables_mode); @@ -1884,6 +1896,13 @@ mysql_execute_command(THD *thd) #endif DBUG_ASSERT(thd->transaction.stmt.is_empty() || thd->in_sub_stmt); + /* + Each statement or replication event which might produce deadlock + should handle transaction rollback on its own. So by the start of + the next statement transaction rollback request should be fulfilled + already. + */ + DBUG_ASSERT(! thd->transaction_rollback_request || thd->in_sub_stmt); /* In many cases first table of main SELECT_LEX have special meaning => check that it is first table in global list and relink it first in @@ -2070,8 +2089,8 @@ mysql_execute_command(THD *thd) or triggers as all such statements prohibited there. */ DBUG_ASSERT(! thd->in_sub_stmt); - /* Commit or rollback the statement transaction. */ - thd->is_error() ? trans_rollback_stmt(thd) : trans_commit_stmt(thd); + /* Statement transaction still should not be started. */ + DBUG_ASSERT(thd->transaction.stmt.is_empty()); /* Commit the normal transaction if one is active. */ if (trans_commit_implicit(thd)) goto error; @@ -4503,7 +4522,17 @@ finish: DEBUG_SYNC(thd, "execute_command_after_close_tables"); #endif - if (stmt_causes_implicit_commit(thd, CF_IMPLICIT_COMMIT_END)) + if (! thd->in_sub_stmt && thd->transaction_rollback_request) + { + /* + We are not in sub-statement and transaction rollback was requested by + one of storage engines (e.g. due to deadlock). Rollback transaction in + all storage engines including binary log. + */ + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + else if (stmt_causes_implicit_commit(thd, CF_IMPLICIT_COMMIT_END)) { /* No transaction control allowed in sub-statements. */ DBUG_ASSERT(! thd->in_sub_stmt); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index f3deafc6035..74279c5539d 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -113,6 +113,7 @@ When one supplies long data for a placeholder: #include #endif #include "lock.h" // MYSQL_OPEN_FORCE_SHARED_MDL +#include "transaction.h" // trans_rollback_implicit /** A result class used to send cursor rows using the binary protocol. @@ -3297,6 +3298,22 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) close_thread_tables(thd); thd->mdl_context.rollback_to_savepoint(mdl_savepoint); + + /* + Transaction rollback was requested since MDL deadlock was discovered + while trying to open tables. Rollback transaction in all storage + engines including binary log and release all locks. + + Once dynamic SQL is allowed as substatements the below if-statement + has to be adjusted to not do rollback in substatement. + */ + DBUG_ASSERT(! thd->in_sub_stmt); + if (thd->transaction_rollback_request) + { + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + lex_end(lex); cleanup_stmt(); thd->restore_backup_statement(this, &stmt_backup); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ac121572ab2..bfed754a90c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4797,7 +4797,6 @@ mysql_discard_or_import_tablespace(THD *thd, error= write_bin_log(thd, FALSE, thd->query(), thd->query_length()); err: - trans_rollback_stmt(thd); thd->tablespace_op=FALSE; if (error == 0) @@ -7331,6 +7330,12 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, Protocol *protocol= thd->protocol; DBUG_ENTER("mysql_checksum_table"); + /* + CHECKSUM TABLE returns results and rollbacks statement transaction, + so it should not be used in stored function or trigger. + */ + DBUG_ASSERT(! thd->in_sub_stmt); + field_list.push_back(item = new Item_empty_string("Table", NAME_LEN*2)); item->maybe_null= 1; field_list.push_back(item= new Item_int("Checksum", (longlong) 1, @@ -7349,7 +7354,6 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, strxmov(table_name, table->db ,".", table->table_name, NullS); t= table->table= open_n_lock_single_table(thd, table, TL_READ, 0); - thd->clear_error(); // these errors shouldn't get client protocol->prepare_for_resend(); protocol->store(table_name, system_charset_info); @@ -7358,7 +7362,6 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, { /* Table didn't exist */ protocol->store_null(); - thd->clear_error(); } else { @@ -7443,9 +7446,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, t->file->ha_rnd_end(); } } - thd->clear_error(); - if (! thd->in_sub_stmt) - trans_rollback_stmt(thd); + trans_rollback_stmt(thd); close_thread_tables(thd); /* Don't release metadata locks, this will be done at @@ -7453,6 +7454,21 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, */ table->table=0; // For query cache } + + if (thd->transaction_rollback_request) + { + /* + If transaction rollback was requested we honor it. To do this we + abort statement and return error as not only CHECKSUM TABLE is + rolled back but the whole transaction in which it was used. + */ + thd->protocol->remove_last_row(); + goto err; + } + + /* Hide errors from client. Return NULL for problematic tables instead. */ + thd->clear_error(); + if (protocol->write()) goto err; } diff --git a/sql/transaction.cc b/sql/transaction.cc index 3b0af4db710..4fd6af39135 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -267,6 +267,47 @@ bool trans_rollback(THD *thd) } +/** + Implicitly rollback the current transaction, typically + after deadlock was discovered. + + @param thd Current thread + + @retval False Success + @retval True Failure + + @note ha_rollback_low() which is indirectly called by this + function will mark XA transaction for rollback by + setting appropriate RM error status if there was + transaction rollback request. +*/ + +bool trans_rollback_implicit(THD *thd) +{ + int res; + DBUG_ENTER("trans_rollback_implict"); + + /* + Always commit/rollback statement transaction before manipulating + with the normal one. + Don't perform rollback in the middle of sub-statement, wait till + its end. + */ + DBUG_ASSERT(thd->transaction.stmt.is_empty() && !thd->in_sub_stmt); + + thd->server_status&= ~SERVER_STATUS_IN_TRANS; + DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); + res= ha_rollback_trans(thd, true); + thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); + thd->transaction.all.modified_non_trans_table= false; + + /* Rollback should clear transaction_rollback_request flag. */ + DBUG_ASSERT(! thd->transaction_rollback_request); + + DBUG_RETURN(test(res)); +} + + /** Commit the single statement transaction. @@ -339,8 +380,6 @@ bool trans_rollback_stmt(THD *thd) if (thd->transaction.stmt.ha_list) { ha_rollback_trans(thd, FALSE); - if (thd->transaction_rollback_request && !thd->in_sub_stmt) - ha_rollback_trans(thd, TRUE); if (! thd->in_active_multi_stmt_transaction()) thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation; } diff --git a/sql/transaction.h b/sql/transaction.h index e002cd4a9dc..abe7823cf9b 100644 --- a/sql/transaction.h +++ b/sql/transaction.h @@ -30,6 +30,7 @@ bool trans_begin(THD *thd, uint flags= 0); bool trans_commit(THD *thd); bool trans_commit_implicit(THD *thd); bool trans_rollback(THD *thd); +bool trans_rollback_implicit(THD *thd); bool trans_commit_stmt(THD *thd); bool trans_rollback_stmt(THD *thd); From fcc0011438caaf94f7716ffe4e99bab2e7d17be1 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 20 Aug 2013 12:21:35 +0200 Subject: [PATCH 33/51] Reverted Release version --- support-files/mysql.spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 0c50490753d..9b1caf8d1e8 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -30,7 +30,7 @@ %global mysqld_group mysql %global mysqldatadir /var/lib/mysql -%global release 2 +%global release 1 # From 3b1e98d21844b0f32f6e5fe9df447046eb471453 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Wed, 21 Aug 2013 10:39:40 +0530 Subject: [PATCH 34/51] Bug#11765252 - READ OF FREED MEMORY WHEN "USE DB" AND "SHOW PROCESSLIST" Analysis: ---------- The problem here is, if one connection changes its default db and at the same time another connection executes "SHOW PROCESSLIST", when it wants to read db of the another connection then there is a chance of accessing the invalid memory. The db name stored in THD is not guarded while changing user DB and while reading the user DB in "SHOW PROCESSLIST". So, if THD.db is freed by thd "owner" thread and if another thread executing "SHOW PROCESSLIST" statement tries to read and copy THD.db at the same time then we may endup in the issue reported here. Fix: ---------- Used mutex "LOCK_thd_data" to guard THD.db while freeing it and while copying it to processlist. --- mysql-test/include/have_valgrind.inc | 11 +++++++++++ sql/sql_class.h | 9 ++++++++- sql/sql_db.cc | 10 ++++++---- sql/sql_parse.cc | 2 ++ sql/sql_show.cc | 25 ++++++++++++++----------- 5 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 mysql-test/include/have_valgrind.inc diff --git a/mysql-test/include/have_valgrind.inc b/mysql-test/include/have_valgrind.inc new file mode 100644 index 00000000000..8374c2ed4f0 --- /dev/null +++ b/mysql-test/include/have_valgrind.inc @@ -0,0 +1,11 @@ +# include/have_valgrind.inc +# +# If some test should be run with only valgrind then skip it while running test +# without it. +# + +if (!$VALGRIND_TEST) { + --skip Need "--valgrind" +} + + diff --git a/sql/sql_class.h b/sql/sql_class.h index 0942e9274b1..9a9b2058e2b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2284,6 +2284,12 @@ public: */ bool set_db(const char *new_db, size_t new_db_len) { + /* + Acquiring mutex LOCK_thd_data as we either free the memory allocated + for the database and reallocate the memory for the new db or memcpy + the new_db to the db. + */ + pthread_mutex_lock(&LOCK_thd_data); /* Do not reallocate memory if current chunk is big enough. */ if (db && new_db && db_length >= new_db_len) memcpy(db, new_db, new_db_len+1); @@ -2293,6 +2299,7 @@ public: db= new_db ? my_strndup(new_db, new_db_len, MYF(MY_WME)) : NULL; } db_length= db ? new_db_len : 0; + pthread_mutex_unlock(&LOCK_thd_data); return new_db && !db; } diff --git a/sql/sql_db.cc b/sql/sql_db.cc index d3178fa0b99..4ddfad7206e 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1469,10 +1469,12 @@ static void mysql_change_db_impl(THD *thd, we just call THD::reset_db(). Since THD::reset_db() does not releases the previous database name, we should do it explicitly. */ - - x_free(thd->db); - + pthread_mutex_lock(&thd->LOCK_thd_data); + if (thd->db) + x_free(thd->db); + DEBUG_SYNC(thd, "after_freeing_thd_db"); thd->reset_db(new_db_name->str, new_db_name->length); + pthread_mutex_unlock(&thd->LOCK_thd_data); } /* 2. Update security context. */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 457be355f81..d9d9a603869 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1231,7 +1231,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (save_user_connect) decrease_user_connections(save_user_connect); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ + pthread_mutex_lock(&thd->LOCK_thd_data); x_free(save_db); + pthread_mutex_unlock(&thd->LOCK_thd_data); x_free(save_security_ctx.user); } break; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index a72ca4d1bfc..2ee074db884 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1847,8 +1847,6 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) thd_info->host= thd->strdup(tmp_sctx->host_or_ip[0] ? tmp_sctx->host_or_ip : tmp_sctx->host ? tmp_sctx->host : ""); - if ((thd_info->db=tmp->db)) // Safe test - thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; if ((mysys_var= tmp->mysys_var)) pthread_mutex_lock(&mysys_var->mutex); @@ -1871,6 +1869,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) pthread_mutex_unlock(&mysys_var->mutex); thd_info->start_time= tmp->start_time; + thd_info->query=0; /* Lock THD mutex that protects its data when looking at it. */ pthread_mutex_lock(&tmp->LOCK_thd_data); @@ -1879,7 +1878,11 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) uint length= min(max_query_length, tmp->query_length()); thd_info->query= (char*) thd->strmake(tmp->query(),length); } + + if ((thd_info->db= tmp->db)) // Safe test + thd_info->db= thd->strdup(thd_info->db); pthread_mutex_unlock(&tmp->LOCK_thd_data); + thread_infos.append(thd_info); } } @@ -1934,7 +1937,7 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) { Security_context *tmp_sctx= tmp->security_ctx; struct st_my_thread_var *mysys_var; - const char *val; + const char *val, *db; if ((!tmp->vio_ok() && !tmp->system_thread) || (user && (!tmp_sctx->user || strcmp(tmp_sctx->user, user)))) @@ -1959,13 +1962,6 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) else table->field[2]->store(tmp_sctx->host_or_ip, strlen(tmp_sctx->host_or_ip), cs); - /* DB */ - if (tmp->db) - { - table->field[3]->store(tmp->db, strlen(tmp->db), cs); - table->field[3]->set_notnull(); - } - if ((mysys_var= tmp->mysys_var)) pthread_mutex_lock(&mysys_var->mutex); /* COMMAND */ @@ -2011,6 +2007,13 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) tmp->query_length()), cs); table->field[7]->set_notnull(); } + + /* DB */ + if ((db= tmp->db)) + { + table->field[3]->store(db, strlen(db), cs); + table->field[3]->set_notnull(); + } pthread_mutex_unlock(&tmp->LOCK_thd_data); if (schema_table_store_record(thd, table)) From ec2389dce613a3cf9b9d91247421a2d798b38eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 21 Aug 2013 08:22:05 +0300 Subject: [PATCH 35/51] Bug#12560151 61132: infinite loop in buf_page_get_gen() when handling compressed pages After loading a compressed-only page in buf_page_get_gen() we allocate a new block for decompression. The problem is that the compressed page is neither buffer-fixed nor I/O-fixed by the time we call buf_LRU_get_free_block(), so it may end up being evicted and returned back as a new block. buf_page_get_gen(): Temporarily buffer-fix the compressed-only block while allocating memory for an uncompressed page frame. This should prevent this form of the infinite loop, which is more likely with a small innodb_buffer_pool_size. rb#2511 approved by Jimmy Yang, Sunny Bains --- storage/innodb_plugin/ChangeLog | 6 ++++ storage/innodb_plugin/buf/buf0buf.c | 43 +++++++++++------------------ 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 719bb89c865..4c3aa9460f9 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2013-08-21 The InnoDB Team + + * buf/buf0buf.c: + Fix Bug#12560151 61132: infinite loop in buf_page_get_gen() + when handling compressed pages + 2013-08-16 The InnoDB Team * row/row0sel.c: diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c index 2d85f389b21..d709a7c89ad 100644 --- a/storage/innodb_plugin/buf/buf0buf.c +++ b/storage/innodb_plugin/buf/buf0buf.c @@ -1615,7 +1615,6 @@ loop: block = (buf_block_t*) buf_page_hash_get(space, offset); } -loop2: if (block == NULL) { /* Page not in buf_pool: needs to be read from file */ @@ -1706,6 +1705,11 @@ wait_until_unfixed: goto loop; } + /* Buffer-fix the block so that it cannot be evicted + or relocated while we are attempting to allocate an + uncompressed page. */ + bpage->buf_fix_count++; + /* Allocate an uncompressed page. */ buf_pool_mutex_exit(); mutex_exit(&buf_pool_zip_mutex); @@ -1715,32 +1719,19 @@ wait_until_unfixed: buf_pool_mutex_enter(); mutex_enter(&block->mutex); + mutex_enter(&buf_pool_zip_mutex); + /* Buffer-fixing prevents the page_hash from changing. */ + ut_ad(bpage == buf_page_hash_get(space, offset)); - { - buf_page_t* hash_bpage - = buf_page_hash_get(space, offset); + if (--bpage->buf_fix_count + || buf_page_get_io_fix(bpage) != BUF_IO_NONE) { - if (UNIV_UNLIKELY(bpage != hash_bpage)) { - /* The buf_pool->page_hash was modified - while buf_pool_mutex was released. - Free the block that was allocated. */ - - buf_LRU_block_free_non_file_page(block); - mutex_exit(&block->mutex); - - block = (buf_block_t*) hash_bpage; - goto loop2; - } - } - - if (UNIV_UNLIKELY - (bpage->buf_fix_count - || buf_page_get_io_fix(bpage) != BUF_IO_NONE)) { - - /* The block was buffer-fixed or I/O-fixed - while buf_pool_mutex was not held by this thread. - Free the block that was allocated and try again. - This should be extremely unlikely. */ + mutex_exit(&buf_pool_zip_mutex); + /* The block was buffer-fixed or I/O-fixed while + buf_pool_mutex was not held by this thread. + Free the block that was allocated and retry. + This should be extremely unlikely, for example, + if buf_page_get_zip() was invoked. */ buf_LRU_block_free_non_file_page(block); mutex_exit(&block->mutex); @@ -1751,8 +1742,6 @@ wait_until_unfixed: /* Move the compressed page from bpage to block, and uncompress it. */ - mutex_enter(&buf_pool_zip_mutex); - buf_relocate(bpage, &block->page); buf_block_init_low(block); block->lock_hash_val = lock_rec_hash(space, offset); From 38ca6953375d2f87958d180195d5b6d866ab265f Mon Sep 17 00:00:00 2001 From: Sneha Modi Date: Wed, 21 Aug 2013 15:24:38 +0530 Subject: [PATCH 36/51] Bug#16995954 : PLUGIN_AUTH TESTS FAIL ON SYSTEMS WITH NO HOSTNAME OTHER THAN LOCALHOST This is a test bug and the explanation for the behaviour can be found on the bug page.Modifying the select to select user where user!=root for the line where failure is encountered on machines with no hostname other than the localhost. --- mysql-test/r/plugin_auth.result | 4 +--- mysql-test/r/plugin_auth_qa_2.result | 26 ++++---------------------- mysql-test/t/plugin_auth.test | 2 +- mysql-test/t/plugin_auth_qa_2.test | 8 ++++---- 4 files changed, 10 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 94e600123ae..07e074b0405 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -12,10 +12,8 @@ test_plugin_server plug_dest ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES) GRANT PROXY ON plug_dest TO plug; test proxies_priv columns -SELECT * FROM mysql.proxies_priv; +SELECT * FROM mysql.proxies_priv WHERE user !='root'; Host User Proxied_host Proxied_user With_grant Grantor Timestamp -xx root 1 xx -xx root 1 xx xx plug % plug_dest 0 root@localhost xx test mysql.proxies_priv; SHOW CREATE TABLE mysql.proxies_priv; diff --git a/mysql-test/r/plugin_auth_qa_2.result b/mysql-test/r/plugin_auth_qa_2.result index f4706e5aa0b..341757f8621 100644 --- a/mysql-test/r/plugin_auth_qa_2.result +++ b/mysql-test/r/plugin_auth_qa_2.result @@ -96,49 +96,31 @@ CREATE USER qa_test_6_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest' CREATE USER qa_test_6_dest IDENTIFIED BY 'dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; -SELECT user,plugin,authentication_string,password FROM mysql.user; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest -root -root -root -root exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using password: YES) GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; -SELECT user,plugin,authentication_string,password FROM mysql.user; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest -root -root -root -root -root qa_auth_interface qa_test_6_dest exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) REVOKE PROXY ON qa_test_6_dest FROM root; -SELECT user,plugin,authentication_string FROM mysql.user; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string qa_test_6_dest NULL qa_test_6_user qa_auth_interface qa_test_6_dest -root -root -root -root -root qa_auth_interface qa_test_6_dest exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) DROP USER qa_test_6_user; DROP USER qa_test_6_dest; DELETE FROM mysql.user WHERE user='root' AND plugin='qa_auth_interface'; -SELECT user,plugin,authentication_string,password FROM mysql.user; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password -root -root -root -root === Test of the --default_auth option for clients ==== CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_11_dest'; CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd'; diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test index 994b8f26308..dc9c39cf881 100644 --- a/mysql-test/t/plugin_auth.test +++ b/mysql-test/t/plugin_auth.test @@ -19,7 +19,7 @@ connect(plug_con,localhost,plug,plug_dest); GRANT PROXY ON plug_dest TO plug; --echo test proxies_priv columns --replace_column 1 xx 7 xx -SELECT * FROM mysql.proxies_priv; +SELECT * FROM mysql.proxies_priv WHERE user !='root'; --echo test mysql.proxies_priv; SHOW CREATE TABLE mysql.proxies_priv; diff --git a/mysql-test/t/plugin_auth_qa_2.test b/mysql-test/t/plugin_auth_qa_2.test index e265690dc7d..58c06688950 100644 --- a/mysql-test/t/plugin_auth_qa_2.test +++ b/mysql-test/t/plugin_auth_qa_2.test @@ -107,7 +107,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_pas GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; --sorted_result -SELECT user,plugin,authentication_string,password FROM mysql.user; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; --echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 @@ -115,7 +115,7 @@ SELECT user,plugin,authentication_string,password FROM mysql.user; GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; --sorted_result -SELECT user,plugin,authentication_string,password FROM mysql.user; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; --echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 @@ -123,7 +123,7 @@ SELECT user,plugin,authentication_string,password FROM mysql.user; REVOKE PROXY ON qa_test_6_dest FROM root; --sorted_result -SELECT user,plugin,authentication_string FROM mysql.user; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; --echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 @@ -133,7 +133,7 @@ DROP USER qa_test_6_user; DROP USER qa_test_6_dest; DELETE FROM mysql.user WHERE user='root' AND plugin='qa_auth_interface'; --sorted_result -SELECT user,plugin,authentication_string,password FROM mysql.user; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; --echo === Test of the --default_auth option for clients ==== From 9d9e54d3809ecac7dcd780aafc54a4bb5d01137c Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Thu, 22 Aug 2013 14:58:13 +0200 Subject: [PATCH 37/51] Removed bugnumber from the changelog and updated description --- support-files/mysql.spec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 9b1caf8d1e8..929f3368a42 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1215,8 +1215,8 @@ echo "=====" >> $STATUS_HISTORY # merging BK trees) ############################################################################## %changelog -* Fri Aug 16 2013 Balasubramanian Kandasamy -- Added fix for Bug17211588 +* Fri Aug 22 2013 Balasubramanian Kandasamy +- Added provides lowercase mysql tags * Wed Jun 26 2013 Balasubramanian Kandasamy - Cleaned up spec file to resolve rpm dependencies. From 6613734b1abd5b6572963c14034bb64c6d923894 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Thu, 22 Aug 2013 16:51:30 +0200 Subject: [PATCH 38/51] Corrected Date in the changelog --- support-files/mysql.spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 929f3368a42..a9cbfada089 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1215,7 +1215,7 @@ echo "=====" >> $STATUS_HISTORY # merging BK trees) ############################################################################## %changelog -* Fri Aug 22 2013 Balasubramanian Kandasamy +* Fri Aug 16 2013 Balasubramanian Kandasamy - Added provides lowercase mysql tags * Wed Jun 26 2013 Balasubramanian Kandasamy From d6825f49331415e7842c1a0364426ae1fd66a57d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Aug 2013 10:56:05 +0530 Subject: [PATCH 39/51] From 5d75a4e6d0c7aa80f16e13a0bef0f519bdf1bcda Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Aug 2013 14:13:30 +0530 Subject: [PATCH 40/51] From 356b641454b1a9d8cd5ba1638972cb030de89738 Mon Sep 17 00:00:00 2001 From: Neeraj Bisht Date: Fri, 23 Aug 2013 16:54:25 +0530 Subject: [PATCH 41/51] Bug#17029399 - CRASH IN ITEM_REF::FIX_FIELDS WITH TRIGGER ERRORS Problem:- In a Procedure, when we are comparing value of select query with IN clause and they both have different collation, cause error on first time execution and assert second time. procedure will have query like set @x = ((select a from t1) in (select d from t2));<---proc1 sel1 sel2 Analysis:- When we execute this proc1(first time) While resolving the fields of user variable, we will call Item_in_subselect::fix_fields while will resolve sel2. There in Item_in_subselect::select_transformer, we evaluate the left expression(sel1) and store it in Item_cache_* object (to avoid re-evaluating it many times during subquery execution) by making Item_in_optimizer class. While evaluating left expression we will prepare sel1. After that, we will put a new condition in sel2 in Item_in_subselect::select_transformer() which will compare t2.d and sel1(which is cached in Item_in_optimizer). Later while checking the collation in agg_item_collations() we get error and we cleanup the item. While cleaning up we cleaned the cached value in Item_in_optimizer object. When we execute the procedure second time, we have condition for sel2 and while setup_cond(), we can't able to find reference item as it is cleanup while item cleanup.So it assert. Solution:- We should not cleanup the cached value for Item_in_optimizer object, if we have put the condition to subselect. --- sql/item_subselect.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index d2c3f0db230..1cd4175f9df 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1083,6 +1083,9 @@ Item_in_subselect::single_value_transformer(JOIN *join, } thd->lex->current_select= current; + /* We will refer to upper level cache array => we have to save it for SP */ + optimizer->keep_top_level_cache(); + /* As far as Item_ref_in_optimizer do not substitute itself on fix_fields we can use same item for all selects. From 7ab5bcc1f9fe5f7f52db2dfcac402d51d824e37f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Aug 2013 17:13:44 +0530 Subject: [PATCH 42/51] From d44fc86977c8b9e5b5c907c13364f7b51621110b Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Fri, 23 Aug 2013 18:19:54 +0530 Subject: [PATCH 43/51] Correcting file ids of newly added files in bug#11765252 From 72ff5686a06077106e2c11d47eb18b9228ba9faf Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Fri, 23 Aug 2013 18:56:31 +0530 Subject: [PATCH 44/51] Bug#11765252 - READ OF FREED MEMORY WHEN "USE DB" AND "SHOW PROCESSLIST" Follow up path, addressing pb2 test failure. --- sql/sql_show.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 94fcbee8c9e..b8e8649e1eb 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1844,8 +1844,6 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) tmp_sctx->host_or_ip : tmp_sctx->get_host()->length() ? tmp_sctx->get_host()->ptr() : ""); - if ((thd_info->db=tmp->db)) // Safe test - thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; mysql_mutex_lock(&tmp->LOCK_thd_data); if ((thd_info->db= tmp->db)) // Safe test From fb5d9a82a783f8a5046daeb1b90884d133b803a5 Mon Sep 17 00:00:00 2001 From: Dmitry Lenev Date: Mon, 26 Aug 2013 14:43:12 +0400 Subject: [PATCH 45/51] Fix for bug #17356954 "CANNOT USE SAVEPOINTS AFTER ER_LOCK_DEADLOCK OR ER_LOCK_WAIT_TIMEOUT". The problem was that after changes caused by fix bug 14188793 "DEADLOCK CAUSED BY ALTER TABLE DOEN'T CLEAR STATUS OF ROLLBACKED TRANSACTION"/ bug 17054007 "TRANSACTION IS NOT FULLY ROLLED BACK IN CASE OF INNODB DEADLOCK implicit rollback of transaction which occurred on ER_LOCK_DEADLOCK (and ER_LOCK_WAIT_TIMEOUT if innodb_rollback_on_timeout option was set) didn't start new transaction in @@autocommit=1 mode. Such behavior although consistent with behavior of explicit ROLLBACK has broken expectations of users and backward compatibility assumptions. This patch fixes problem by reverting to starting new transaction in 5.5/5.6. The plan is to keep new behavior in trunk so the code change from this patch is to be null-merged there. --- sql/transaction.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/transaction.cc b/sql/transaction.cc index 4fd6af39135..ae38e920a1d 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -298,7 +298,12 @@ bool trans_rollback_implicit(THD *thd) thd->server_status&= ~SERVER_STATUS_IN_TRANS; DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); res= ha_rollback_trans(thd, true); - thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); + /* + We don't reset OPTION_BEGIN flag below to simulate implicit start + of new transacton in @@autocommit=1 mode. This is necessary to + preserve backward compatibility. + */ + thd->variables.option_bits&= ~(OPTION_KEEP_LOG); thd->transaction.all.modified_non_trans_table= false; /* Rollback should clear transaction_rollback_request flag. */ From b3f8de5b48a23dd583522ddeecbe22f5ee6676e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Aug 2013 00:02:22 +0200 Subject: [PATCH 46/51] Raise version number after cloning 5.1.72 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 333307ccf4b..94a9d5b4e99 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.72], [], [mysql]) +AC_INIT([MySQL Server], [5.1.73], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM From e2c77ad949ec8741384058bce37770d7a73c96a3 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Thu, 29 Aug 2013 14:33:28 +0200 Subject: [PATCH 47/51] Fix for Bug#17377159, ignore mysqld_safe.pid file created by mysqld_safe script --- support-files/mysql.spec.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index a9cbfada089..216c5ede66b 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -30,7 +30,7 @@ %global mysqld_group mysql %global mysqldatadir /var/lib/mysql -%global release 1 +%global release 2 # @@ -636,7 +636,7 @@ then fi if [ -z "$PID_FILE_PATT" ] then - PID_FILE_PATT="$mysql_datadir/*.pid" + PID_FILE_PATT=`ls $mysql_datadir/*.pid 2>/dev/null | grep -v "mysqld_safe.pid"` fi # Check if we can safely upgrade. An upgrade is only safe if it's from one @@ -1215,6 +1215,9 @@ echo "=====" >> $STATUS_HISTORY # merging BK trees) ############################################################################## %changelog +* Thu Aug 29 2013 Balasubramanian Kandasamy +- Added logic to ignore mysqld_safe.pid file created by mysqld_safe script + * Fri Aug 16 2013 Balasubramanian Kandasamy - Added provides lowercase mysql tags From 1f6434ba3d578159baac2adb2fec9e6ada04ecee Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Fri, 30 Aug 2013 06:33:02 +0200 Subject: [PATCH 48/51] Corrected the PID_FILE_PATT manipulation --- support-files/mysql.spec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 216c5ede66b..372638c29c3 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -30,7 +30,7 @@ %global mysqld_group mysql %global mysqldatadir /var/lib/mysql -%global release 2 +%global release 1 # @@ -636,7 +636,7 @@ then fi if [ -z "$PID_FILE_PATT" ] then - PID_FILE_PATT=`ls $mysql_datadir/*.pid 2>/dev/null | grep -v "mysqld_safe.pid"` + PID_FILE_PATT=`ls "$mysql_datadir/*.pid" 2> /dev/null | grep -v "mysqld_safe.pid"` fi # Check if we can safely upgrade. An upgrade is only safe if it's from one From bb82aecef9ba33077ccc5eb6b86a33b7e5f77da6 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Fri, 30 Aug 2013 15:02:16 +0200 Subject: [PATCH 49/51] Fix to ignore mysqld_safe.pid --- support-files/mysql.spec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 372638c29c3..bd354056e60 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -636,7 +636,7 @@ then fi if [ -z "$PID_FILE_PATT" ] then - PID_FILE_PATT=`ls "$mysql_datadir/*.pid" 2> /dev/null | grep -v "mysqld_safe.pid"` + PID_FILE_PATT="$mysql_datadir/*.pid" fi # Check if we can safely upgrade. An upgrade is only safe if it's from one @@ -718,7 +718,7 @@ fi # We assume that if there is exactly one ".pid" file, # it contains the valid PID of a running MySQL server. -NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | wc -l` +NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | grep -v "mysqld_safe.pid" | wc -l` case $NR_PID_FILES in 0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server 1 ) SERVER_TO_START='true' ;; From 06bcc2a4106e96b064e226a2dba0bce2944571a2 Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Mon, 9 Sep 2013 20:21:02 +0530 Subject: [PATCH 50/51] Bug #16776528 RACE CONDITION CAN CAUSE MYSQLD TO REMOVE SOCKET FILE ERRANTLY Reverting the patch. Because this change is not to me made for GA versions. --- scripts/mysqld_safe.sh | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e230b10d3b6..31bb8f364e2 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -518,32 +518,6 @@ else fi plugin_dir="${plugin_dir}${PLUGIN_VARIANT}" -# A pid file is created for the mysqld_safe process. This file protects the -# server instance resources during race conditions. -safe_pid="$DATADIR/mysqld_safe.pid" -if test -f $safe_pid -then - PID=`cat "$safe_pid"` - if @CHECK_PID@ - then - if @FIND_PROC@ - then - log_error "A mysqld_safe process already exists" - exit 1 - fi - fi - rm -f "$safe_pid" - if test -f "$safe_pid" - then - log_error "Fatal error: Can't remove the mysqld_safe pid file" - exit 1 - fi -fi - -# Insert pid proerply into the pid file. -ps -e | grep [m]ysqld_safe | awk '{print $1}' | sed -n 1p > $safe_pid -# End of mysqld_safe pid(safe_pid) check. - # Determine what logging facility to use # Ensure that 'logger' exists, if it's requested @@ -553,7 +527,6 @@ then if [ $? -ne 0 ] then log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe." - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -659,7 +632,6 @@ does not exist or is not executable. Please cd to the mysql installation directory and restart this script from there as follows: ./bin/mysqld_safe& See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi @@ -753,7 +725,6 @@ then if @FIND_PROC@ then # The pid contains a mysqld process log_error "A mysqld process already exists" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -764,7 +735,6 @@ then $pid_file Please remove it manually and start $0 again; mysqld daemon not started" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -888,5 +858,3 @@ done log_notice "mysqld from pid file $pid_file ended" -rm -f "$safe_pid" # Some Extra Safety. File is deleted - # once the mysqld process ends. From 543b6e02246db25d8a61574fc709b28e7720d1a0 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 9 Sep 2013 19:49:44 +0200 Subject: [PATCH 51/51] Reverted the changes to spec file, updated the logic to get the correct count of PID files --- support-files/mysql.spec.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index bd354056e60..800b333a5cf 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -718,7 +718,7 @@ fi # We assume that if there is exactly one ".pid" file, # it contains the valid PID of a running MySQL server. -NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | grep -v "mysqld_safe.pid" | wc -l` +NR_PID_FILES=`ls -1 $PID_FILE_PATT 2>/dev/null | wc -l` case $NR_PID_FILES in 0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server 1 ) SERVER_TO_START='true' ;; @@ -1215,8 +1215,8 @@ echo "=====" >> $STATUS_HISTORY # merging BK trees) ############################################################################## %changelog -* Thu Aug 29 2013 Balasubramanian Kandasamy -- Added logic to ignore mysqld_safe.pid file created by mysqld_safe script +* Mon Sep 09 2013 Balasubramanian Kandasamy +- Updated logic to get the correct count of PID files * Fri Aug 16 2013 Balasubramanian Kandasamy - Added provides lowercase mysql tags