diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-12-18 21:56:36 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-12-18 21:56:36 -0700 |
commit | 267e85e5e3bf7288171018fa28070b12fa88863a (patch) | |
tree | 9af06852639f8e7affcc06db7a78eeeea194c42d /sql | |
parent | 634869071e4d61559eecfffdc3ab46d8928fa725 (diff) | |
download | mariadb-git-267e85e5e3bf7288171018fa28070b12fa88863a.tar.gz |
make replication work correctly if the master logs SELECT RELEASE_LOCK()
instead of DO RELEASE_LOCK()
mysql-test/t/rpl_get_lock.test:
test for SELECT RELEASE() replication bug
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_parse.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index dd627017ead..48b48dc77a7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1071,10 +1071,23 @@ mysql_execute_command(void) TABLE_LIST *tables=(TABLE_LIST*) lex->table_list.first; DBUG_ENTER("mysql_execute_command"); - if(table_rules_on && thd->slave_thread && tables && !tables_ok(thd,tables)) - DBUG_VOID_RETURN; // skip if we are in the slave thread, some table - // rules have been given and the table list says the query should not be - // replicated + if (thd->slave_thread) + { + // skip if we are in the slave thread, some table + // rules have been given and the table list says the query should not be + // replicated + if(table_rules_on && tables && !tables_ok(thd,tables)) + DBUG_VOID_RETURN; + // this is a workaround to deal with the shortcoming + // in 3.23.44-3.23.46 masters + // in RELEASE_LOCK() logging. We re-write SELECT RELEASE_LOCK() as + // DO RELEASE_LOCK() + if (lex->sql_command == SQLCOM_SELECT) + { + lex->sql_command = SQLCOM_DO; + lex->insert_list = &lex->item_list; + } + } thread_safe_increment(com_stat[lex->sql_command],&LOCK_thread_count); switch (lex->sql_command) { |