diff options
author | ramil/ram@mysql.com/ramil.myoffice.izhnet.ru <> | 2007-08-01 15:27:03 +0500 |
---|---|---|
committer | ramil/ram@mysql.com/ramil.myoffice.izhnet.ru <> | 2007-08-01 15:27:03 +0500 |
commit | 7fb417d0ba1c416db1d5a12774cb3f4a6624ba9c (patch) | |
tree | 264548069695844abbd4f11eac596dbb84c9c0ce /sql/log_event.cc | |
parent | 667f2a35de446a92db3baa73e302b71c5db6759c (diff) | |
download | mariadb-git-7fb417d0ba1c416db1d5a12774cb3f4a6624ba9c.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.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index c37df31ae00..1ef765f607f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1303,8 +1303,9 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length, bool using_trans, bool suppress_use, THD::killed_state killed_status_arg) :Log_event(thd_arg, - ((thd_arg->tmp_table_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0) - | (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0)), + ((thd_arg->tmp_table_used || thd_arg->thread_specific_used) ? + LOG_EVENT_THREAD_SPECIFIC_F : 0) | + (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0), using_trans), data_buf(0), query(query_arg), catalog(thd_arg->catalog), db(thd_arg->db), q_len((uint32) query_length), @@ -2689,8 +2690,10 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, List<Item> &fields_arg, enum enum_duplicates handle_dup, bool ignore, bool using_trans) - :Log_event(thd_arg, !thd_arg->tmp_table_used ? - 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), + :Log_event(thd_arg, + (thd_arg->tmp_table_used || thd_arg->thread_specific_used) ? + LOG_EVENT_THREAD_SPECIFIC_F : 0, + using_trans), thread_id(thd_arg->thread_id), slave_proxy_id(thd_arg->variables.pseudo_thread_id), num_fields(0),fields(0), |