From a53ac77c4265c2bf8ad4d07b924f6155e8b39458 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Wed, 10 Aug 2016 12:30:57 -0400 Subject: Cleanup: Remove dead code --- sql/sql_parse.cc | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'sql/sql_parse.cc') diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 581a8212668..34c4474a9e2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2641,31 +2641,10 @@ mysql_execute_command(THD *thd) lex->sql_command == SQLCOM_SELECT) && !wsrep_is_show_query(lex->sql_command)) { -#if DIRTY_HACK - /* Dirty hack for lp:1002714 - trying to recognize mysqldump connection - * and allow it to continue. Actuall mysqldump_magic_str may be longer - * and is obviously version dependent and may be issued by any client - * connection after which connection becomes non-replicating. */ - static char const mysqldump_magic_str[]= -"SELECT LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL"; - static const size_t mysqldump_magic_str_len= sizeof(mysqldump_magic_str) -1; - if (SQLCOM_SELECT != lex->sql_command || - thd->query_length() < mysqldump_magic_str_len || - strncmp(thd->query(), mysqldump_magic_str, mysqldump_magic_str_len)) - { -#endif /* DIRTY_HACK */ my_message(ER_UNKNOWN_COM_ERROR, "WSREP has not yet prepared node for application use", MYF(0)); goto error; -#if DIRTY_HACK - } - else - { - /* mysqldump connection, allow all further queries to pass */ - thd->variables.wsrep_on= FALSE; - } -#endif /* DIRTY_HACK */ } } #endif /* WITH_WSREP */ -- cgit v1.2.1 From df96eb5d049db22157ad0c01ac0e50c7beb79a88 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Thu, 18 Feb 2016 14:34:53 +0200 Subject: Refs: MW-248 - test cases from PXC for reproducing the issue - initial fix --- sql/sql_parse.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'sql/sql_parse.cc') diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 34c4474a9e2..c8f3c5ae4bf 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6805,18 +6805,17 @@ void THD::reset_for_next_command() transactions. Appliers and replayers are either processing ROW events or get autoinc variable values from Query_log_event. */ - if (WSREP(thd) && thd->wsrep_exec_mode == LOCAL_STATE) { - if (wsrep_auto_increment_control) - { - if (thd->variables.auto_increment_offset != - global_system_variables.auto_increment_offset) - thd->variables.auto_increment_offset= - global_system_variables.auto_increment_offset; - if (thd->variables.auto_increment_increment != - global_system_variables.auto_increment_increment) - thd->variables.auto_increment_increment= - global_system_variables.auto_increment_increment; - } + if (WSREP(thd) && thd->wsrep_exec_mode == LOCAL_STATE && + !thd->slave_thread && wsrep_auto_increment_control) + { + if (thd->variables.auto_increment_offset != + global_system_variables.auto_increment_offset) + thd->variables.auto_increment_offset= + global_system_variables.auto_increment_offset; + if (thd->variables.auto_increment_increment != + global_system_variables.auto_increment_increment) + thd->variables.auto_increment_increment= + global_system_variables.auto_increment_increment; } #endif /* WITH_WSREP */ thd->query_start_used= 0; -- cgit v1.2.1 From da9650a36a9e1d9b78a55d6f40a37b984d03bce4 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Fri, 19 Feb 2016 13:08:22 +0200 Subject: Refs: MW-248 - some more code cleanup --- sql/sql_parse.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'sql/sql_parse.cc') diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c8f3c5ae4bf..3c8254ac651 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6803,19 +6803,18 @@ void THD::reset_for_next_command() /* Autoinc variables should be adjusted only for locally executed transactions. Appliers and replayers are either processing ROW - events or get autoinc variable values from Query_log_event. + events or get autoinc variable values from Query_log_event and + mysql slave may be processing STATEMENT format events, but he should + use autoinc values passed in binlog events, not the values forced by + the cluster. */ if (WSREP(thd) && thd->wsrep_exec_mode == LOCAL_STATE && !thd->slave_thread && wsrep_auto_increment_control) { - if (thd->variables.auto_increment_offset != - global_system_variables.auto_increment_offset) - thd->variables.auto_increment_offset= - global_system_variables.auto_increment_offset; - if (thd->variables.auto_increment_increment != - global_system_variables.auto_increment_increment) - thd->variables.auto_increment_increment= - global_system_variables.auto_increment_increment; + thd->variables.auto_increment_offset= + global_system_variables.auto_increment_offset; + thd->variables.auto_increment_increment= + global_system_variables.auto_increment_increment; } #endif /* WITH_WSREP */ thd->query_start_used= 0; -- cgit v1.2.1