diff options
author | Andrei Elkin <andrei.elkin@oracle.com> | 2013-03-26 20:52:01 +0200 |
---|---|---|
committer | Andrei Elkin <andrei.elkin@oracle.com> | 2013-03-26 20:52:01 +0200 |
commit | fd434bca5f280c44dfc5daa9c351fe2e358d74e6 (patch) | |
tree | d7043ad1ef189f46e706f1912732d133bb6da128 /sql/log_event.cc | |
parent | 5bfb832ccd40b214ca0bdedc5e47a321f2a5dff1 (diff) | |
parent | 0a31d4f4116a55df18a6bb52c93a499360f03ac2 (diff) | |
download | mariadb-git-fd434bca5f280c44dfc5daa9c351fe2e358d74e6.tar.gz |
merge from 5.1
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 11 |
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; } |