summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/log_event.cc7
-rw-r--r--sql/log_event.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 3aea3eaf2f1..156f5bac7b7 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -11322,7 +11322,7 @@ Annotate_rows_log_event::Annotate_rows_log_event(THD *thd,
bool direct)
: Log_event(thd, 0, using_trans),
m_save_thd_query_txt(0),
- m_save_thd_query_len(0)
+ m_save_thd_query_len(0), m_saved_thd_query(false)
{
m_query_txt= thd->query();
m_query_len= thd->query_length();
@@ -11336,7 +11336,7 @@ Annotate_rows_log_event::Annotate_rows_log_event(const char *buf,
const Format_description_log_event *desc)
: Log_event(buf, desc),
m_save_thd_query_txt(0),
- m_save_thd_query_len(0)
+ m_save_thd_query_len(0), m_saved_thd_query(false)
{
m_query_len= event_len - desc->common_header_len;
m_query_txt= (char*) buf + desc->common_header_len;
@@ -11345,7 +11345,7 @@ Annotate_rows_log_event::Annotate_rows_log_event(const char *buf,
Annotate_rows_log_event::~Annotate_rows_log_event()
{
#ifndef MYSQL_CLIENT
- if (m_save_thd_query_txt)
+ if (m_saved_thd_query)
thd->set_query(m_save_thd_query_txt, m_save_thd_query_len);
#endif
}
@@ -11431,6 +11431,7 @@ int Annotate_rows_log_event::do_apply_event(rpl_group_info *rgi)
{
m_save_thd_query_txt= thd->query();
m_save_thd_query_len= thd->query_length();
+ m_saved_thd_query= true;
thd->set_query(m_query_txt, m_query_len);
return 0;
}
diff --git a/sql/log_event.h b/sql/log_event.h
index 5689d36aea8..6c6dce7e18e 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -3885,6 +3885,7 @@ private:
uint m_query_len;
char *m_save_thd_query_txt;
uint m_save_thd_query_len;
+ bool m_saved_thd_query;
};
/**