diff options
author | unknown <kostja@vajra.(none)> | 2007-04-13 23:53:05 -0400 |
---|---|---|
committer | unknown <kostja@vajra.(none)> | 2007-04-13 23:53:05 -0400 |
commit | ab59263b2496ffa37a37068996aa342b87ca422a (patch) | |
tree | 80a138b97ff91b9b6181aec552a578672c0ca8c8 /sql/events.cc | |
parent | c1b6e128ccae21cec31bf4f4a60594d0e13a13ea (diff) | |
download | mariadb-git-ab59263b2496ffa37a37068996aa342b87ca422a.tar.gz |
Fix rpl_events test failure in the runtime tree.
mysql-test/r/rpl_events.result:
Now ON COMPLETION NOT PRESERVE events are also dropped on the
slave, since DROP EVENT command that is invoked for all such commands
gets invoked on the slave.
sql/event_data_objects.cc:
Fix the failing rpl_events test after the patch for Bug#27733.
At the time Events::drop_event got invoked inside
Event_job_data::execute() thd->query pointed to CREATE PROCEDURE
statement. This statement was written to the binary log
from inside Events::drop_event (under assumption that this is a
DROP EVENT statement that needs to be replicated), and caused
creation of this procedure on the slave (and a subsequent failure
when a procedure with the same name already exist).
The patch ensures that thd->query points at the right query text
for DROP EVENT executed when dropping ON COMPLETION NOT PRESERVE
events.
sql/event_data_objects.h:
Update a declaration.
sql/events.cc:
Change if () to an assert: thd->query now always points at a valid
query.
Diffstat (limited to 'sql/events.cc')
-rw-r--r-- | sql/events.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/events.cc b/sql/events.cc index 200f46b7f7a..0148533a612 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -424,7 +424,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, if (event_queue) event_queue->create_event(thd, new_element, &created); /* Binlog the create event. */ - if (mysql_bin_log.is_open() && (thd->query_length > 0)) + DBUG_ASSERT(thd->query && thd->query_length); + if (mysql_bin_log.is_open()) { thd->clear_error(); thd->binlog_query(THD::MYSQL_QUERY_TYPE, @@ -549,7 +550,8 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, event_queue->update_event(thd, parse_data->dbname, parse_data->name, new_element); /* Binlog the alter event. */ - if (mysql_bin_log.is_open() && (thd->query_length > 0)) + DBUG_ASSERT(thd->query && thd->query_length); + if (mysql_bin_log.is_open()) { thd->clear_error(); thd->binlog_query(THD::MYSQL_QUERY_TYPE, @@ -628,7 +630,8 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) if (event_queue) event_queue->drop_event(thd, dbname, name); /* Binlog the drop event. */ - if (mysql_bin_log.is_open() && (thd->query_length > 0)) + DBUG_ASSERT(thd->query && thd->query_length); + if (mysql_bin_log.is_open()) { thd->clear_error(); thd->binlog_query(THD::MYSQL_QUERY_TYPE, |