summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-08-01 15:27:03 +0500
committerunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-08-01 15:27:03 +0500
commitf87acb594a15b415b58a3053e76bfd1b27a6d594 (patch)
tree264548069695844abbd4f11eac596dbb84c9c0ce /sql/sql_class.h
parent32cc0694bf6d5c8673f4c270793dedb5a8a8ab1e (diff)
downloadmariadb-git-f87acb594a15b415b58a3053e76bfd1b27a6d594.tar.gz
Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect
restores from mysqlbinlog out Problem: using "mysqlbinlog | mysql" for recoveries the connection_id() result may differ from what was used when issuing the statement. Fix: if there is a connection_id() in a statement, write to binlog SET pseudo_thread_id= XXX; before it and use the value later on. mysql-test/r/mysqlbinlog.result: Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect restores from mysqlbinlog out - test result. mysql-test/t/mysqlbinlog.test: Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect restores from mysqlbinlog out - test case. sql/item_create.cc: Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect restores from mysqlbinlog out - set thread_specific_used flag for the connection_id() function. sql/item_func.cc: Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect restores from mysqlbinlog out - always return thd->variables.pseudo_thread_id as a connection_id() result, as it contains a proper value for both master and slave. sql/log_event.cc: Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect restores from mysqlbinlog out - set LOG_EVENT_THREAD_SPECIFIC_F event flag if thread_specific_used is set. sql/sql_class.cc: Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect restores from mysqlbinlog out - thd->thread_specific_used introduced, which is set if thread specific value(s) used in a statement. sql/sql_class.h: Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect restores from mysqlbinlog out - thd->thread_specific_used introduced, which is set if thread specific value(s) used in a statement.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 445a3ce437c..49f3e6354b9 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1457,6 +1457,9 @@ public:
bool in_lock_tables;
bool query_error, bootstrap, cleanup_done;
bool tmp_table_used;
+
+ /** is set if some thread specific value(s) used in a statement. */
+ bool thread_specific_used;
bool charset_is_system_charset, charset_is_collation_connection;
bool charset_is_character_set_filesystem;
bool enable_slow_log; /* enable slow log for current statement */