summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-12-20 13:52:04 +0200
committermonty@hundin.mysql.fi <>2001-12-20 13:52:04 +0200
commitf5a1abd8612906d73760cccd19fa1b7d47a08150 (patch)
treebef9920d117354adcd5ebe165e716348cf5d5e6a
parent505aeabdfc0a66081d10ef0915ea1f0e6a0f7366 (diff)
parent7b672bc92c8fbd6e13923f10daa07eac1cdd319a (diff)
downloadmariadb-git-f5a1abd8612906d73760cccd19fa1b7d47a08150.tar.gz
merge
-rw-r--r--mysql-test/t/rpl_get_lock.test7
-rw-r--r--sql/sql_parse.cc23
2 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/t/rpl_get_lock.test
index 93f911e01d5..3c33103e4c7 100644
--- a/mysql-test/t/rpl_get_lock.test
+++ b/mysql-test/t/rpl_get_lock.test
@@ -6,6 +6,13 @@ dirty_close master;
connection master1;
select get_lock("lock",2);
select release_lock("lock");
+let $1=2000;
+while ($1)
+{
+ do get_lock("lock",2);
+ do release_lock("lock");
+ dec $1;
+}
save_master_pos;
connection slave;
sync_with_master;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 851c07265b0..f7c522ba782 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1100,6 +1100,29 @@ mysql_execute_command(void)
SELECT_LEX *select_lex = lex->select;
DBUG_ENTER("mysql_execute_command");
+ 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;
+#ifndef TO_BE_DELETED
+ /*
+ 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;
+ }
+#endif
+ }
+
+ thread_safe_increment(com_stat[lex->sql_command],&LOCK_thread_count);
/*
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