mirror of
https://github.com/MariaDB/server.git
synced 2026-04-22 08:15:31 +02:00
Post fix of BUG#37145
Binlog the CREATE EVENT unless the created event been successfully dropped Modified Query_log_event constructor to make sure that error_code is not set to ER_SERVER_SHUTDOWN or ER_QUERY_INTERRUPTED errors when NOT_KILLED sql/events.cc: binlog the create event unless it's been successfully dropped sql/log_event.cc: Modified Query_log_event constructor to make sure that error_code is not set to ER_SERVER_SHUTDOWN or ER_QUERY_INTERRUPTED errors when NOT_KILLED
This commit is contained in:
parent
4ab0005be6
commit
caaa8531bd
2 changed files with 20 additions and 3 deletions
|
|
@ -412,6 +412,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
|
|||
if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists)))
|
||||
{
|
||||
Event_queue_element *new_element;
|
||||
bool dropped= 0;
|
||||
|
||||
if (!(new_element= new Event_queue_element()))
|
||||
ret= TRUE; // OOM
|
||||
|
|
@ -419,8 +420,9 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
|
|||
parse_data->name,
|
||||
new_element)))
|
||||
{
|
||||
db_repository->drop_event(thd, parse_data->dbname, parse_data->name,
|
||||
TRUE);
|
||||
if (!db_repository->drop_event(thd, parse_data->dbname, parse_data->name,
|
||||
TRUE))
|
||||
dropped= 1;
|
||||
delete new_element;
|
||||
}
|
||||
else
|
||||
|
|
@ -429,6 +431,12 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
|
|||
bool created;
|
||||
if (event_queue)
|
||||
event_queue->create_event(thd, new_element, &created);
|
||||
}
|
||||
/*
|
||||
binlog the create event unless it's been successfully dropped
|
||||
*/
|
||||
if (!dropped)
|
||||
{
|
||||
/* Binlog the create event. */
|
||||
DBUG_ASSERT(thd->query && thd->query_length);
|
||||
write_bin_log(thd, TRUE, thd->query, thd->query_length);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue