Commit b5932225 authored by unknown's avatar unknown

WL#3629 - Replication of Invocation and Invoked Features

This patch adds code to the binlog calls for replication of the
CREATE, DROP, and UPDATE event commands. An extra gate was added 
to ensure a query with length 0 is not binlogged. This corrects 
the problem of events_scheduling and rpl_events failing on some
build machines.


sql/events.cc:
  WL#3629 - Replication of Invocation and Invoked Features
  
  This patch adds code to the binlog calls for replication of the
  CREATE, DROP, and UPDATE event commands. An extra gate was added 
  to ensure a query with length 0 is not binlogged. This corrects 
  problems found when the patch for this worklog was pushed.
parent 39176e9f
...@@ -351,7 +351,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) ...@@ -351,7 +351,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists)
else /* Binlog the create event. */ else /* Binlog the create event. */
{ {
event_queue->create_event(thd, new_element); event_queue->create_event(thd, new_element);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open() && (thd->query_length > 0))
{ {
thd->clear_error(); thd->clear_error();
thd->binlog_query(THD::MYSQL_QUERY_TYPE, thd->binlog_query(THD::MYSQL_QUERY_TYPE,
...@@ -426,7 +426,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) ...@@ -426,7 +426,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to)
{ {
event_queue->update_event(thd, parse_data->dbname, parse_data->name, event_queue->update_event(thd, parse_data->dbname, parse_data->name,
new_element); new_element);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open() && (thd->query_length > 0))
{ {
thd->clear_error(); thd->clear_error();
thd->binlog_query(THD::MYSQL_QUERY_TYPE, thd->binlog_query(THD::MYSQL_QUERY_TYPE,
...@@ -480,7 +480,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) ...@@ -480,7 +480,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
{ {
event_queue->drop_event(thd, dbname, name); event_queue->drop_event(thd, dbname, name);
/* Binlog the drop event. */ /* Binlog the drop event. */
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open() && (thd->query_length > 0))
{ {
thd->clear_error(); thd->clear_error();
thd->binlog_query(THD::MYSQL_QUERY_TYPE, thd->binlog_query(THD::MYSQL_QUERY_TYPE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment