Commit 0ba16802 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-6769 DROP TRIGGER IF NOT EXIST binlogged on master but not on slave

don't return from DROP TRIGGER IF NOT EXISTS on the slave side
early when the trigger couldn't be read
parent b739103f
...@@ -986,4 +986,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back ...@@ -986,4 +986,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:log, slave:log] include/diff_tables.inc [master:log, slave:log]
drop table t1, log; drop table t1, log;
drop trigger if exists notexistent;
Warnings:
Note 1360 Trigger does not exist
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; drop trigger if exists notexistent
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; drop trigger if exists notexistent
include/rpl_end.inc include/rpl_end.inc
...@@ -532,6 +532,19 @@ connection master; ...@@ -532,6 +532,19 @@ connection master;
drop table t1, log; drop table t1, log;
sync_slave_with_master; sync_slave_with_master;
#
# MDEV-6769 DROP TRIGGER IF NOT EXIST binlogged on master but not on slave
#
let $slave_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
connection master;
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
drop trigger if exists notexistent;
source include/show_binlog_events.inc;
sync_slave_with_master;
let $binlog_start= $slave_pos;
source include/show_binlog_events.inc;
connection master;
# #
# End of tests # End of tests
# #
......
...@@ -2283,10 +2283,14 @@ mysql_execute_command(THD *thd) ...@@ -2283,10 +2283,14 @@ mysql_execute_command(THD *thd)
according to slave filtering rules. according to slave filtering rules.
Returning success without producing any errors in this case. Returning success without producing any errors in this case.
*/ */
if (!thd->lex->check_exists)
DBUG_RETURN(0); DBUG_RETURN(0);
/*
DROP TRIGGER IF NOT EXISTS will return without an error later
after possibly writing the query to a binlog
*/
} }
else // force searching in slave.cc:tables_ok()
// force searching in slave.cc:tables_ok()
all_tables->updating= 1; all_tables->updating= 1;
} }
......
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