summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@oracle.com>2013-03-26 20:52:01 +0200
committerAndrei Elkin <andrei.elkin@oracle.com>2013-03-26 20:52:01 +0200
commite8feb8d56a12fb23a97de12125af09053b0273cd (patch)
treed7043ad1ef189f46e706f1912732d133bb6da128 /sql/log_event.cc
parent717c48258cf009b5b1633ba93d64e6249758bba1 (diff)
parent9eb64ec5c034c2935047a75773d754a4258c3832 (diff)
downloadmariadb-git-e8feb8d56a12fb23a97de12125af09053b0273cd.tar.gz
merge from 5.1
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index dfbcecd2db9..8b344a3c67d 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -5848,7 +5848,7 @@ User_var_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
#ifndef MYSQL_CLIENT
- , deferred(false)
+ , deferred(false), query_id(0)
#endif
{
bool error= false;
@@ -6121,11 +6121,16 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli)
{
Item *it= 0;
CHARSET_INFO *charset;
+ query_id_t sav_query_id; /* memorize orig id when deferred applying */
if (rli->deferred_events_collecting)
{
- set_deferred();
+ set_deferred(current_thd->query_id);
return rli->deferred_events->add(this);
+ } else if (is_deferred())
+ {
+ sav_query_id= current_thd->query_id;
+ current_thd->query_id= query_id; /* recreating original time context */
}
if (!(charset= get_charset(charset_number, MYF(MY_WME))))
@@ -6201,6 +6206,8 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli)
(flags & User_var_log_event::UNSIGNED_F));
if (!is_deferred())
free_root(thd->mem_root, 0);
+ else
+ current_thd->query_id= sav_query_id; /* restore current query's context */
return 0;
}