BUG#46864 Incorrect update of InnoDB table on slave when using trigger with myisam table

Slave does not correctly handle "expected errors" leading to inconsistencies
between the mater and slave. Specifically, when a statement changes both
transactional and non-transactional tables, the transactional changes are
automatically rolled back on the master but the slave ignores the error and
does not roll them back thus leading to inconsistencies.
      
To fix the problem, we automatically roll back a statement that fails on
the slave but note that the transaction is not rolled back unless a "rollback"
command is in the relay log file.

mysql-test/extra/rpl_tests/rpl_mixing_engines.test:
  Enabled item 13.e which was disabled because of the bug fixed by the
  current and removed item 14 which was introduced by mistake.
This commit is contained in:
Alfranio Correia 2009-08-27 13:46:29 +01:00
commit 354f5f7bac
3 changed files with 46 additions and 55 deletions

View file

@ -562,21 +562,21 @@ let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
--echo # There is a bug in the slave that needs to be fixed before enabling
--echo # this part of the test. A bug report will be filed referencing this
--echo # test case.
#
#BEGIN;
#INSERT INTO nt_3 VALUES ("new text -28", -28, '');
#--error ER_DUP_ENTRY
#INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
#INSERT INTO tt_1 VALUES ("new text -27", -27, '');
#COMMIT;
#
#BEGIN;
#INSERT INTO tt_4 VALUES ("new text -28", -28, '');
#--error ER_DUP_ENTRY
#INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
#INSERT INTO tt_1 VALUES ("new text -28", -28, '');
#COMMIT;
#
BEGIN;
INSERT INTO nt_3 VALUES ("new text -28", -28, '');
--error ER_DUP_ENTRY
INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
INSERT INTO tt_1 VALUES ("new text -27", -27, '');
COMMIT;
BEGIN;
INSERT INTO tt_4 VALUES ("new text -28", -28, '');
--error ER_DUP_ENTRY
INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
INSERT INTO tt_1 VALUES ("new text -28", -28, '');
COMMIT;
--source include/show_binlog_events.inc
--echo
@ -683,23 +683,6 @@ ROLLBACK;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
--echo #
--echo #14) "B M T R" with error in M generates in the binlog the "B M T R" entries.
--echo #
BEGIN;
INSERT INTO tt_4 VALUES ("new text -32", -32, '');
TRUNCATE TABLE tt_4;
INSERT INTO tt_4 VALUES ("new text -33", -33, '');
ROLLBACK;
--source include/show_binlog_events.inc
connection master;
sync_slave_with_master;