summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
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/item_create.cc
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/item_create.cc')
-rw-r--r--sql/item_create.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 50db1c37371..3713fc9e380 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -70,7 +70,9 @@ Item *create_func_ceiling(Item* a)
Item *create_func_connection_id(void)
{
- current_thd->lex->safe_to_cache_query= 0;
+ THD *thd= current_thd;
+ thd->lex->safe_to_cache_query= 0;
+ thd->thread_specific_used= TRUE;
return new Item_func_connection_id();
}