summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2009-08-27 13:46:29 +0100
committerAlfranio Correia <alfranio.correia@sun.com>2009-08-27 13:46:29 +0100
commit354f5f7bac16a688f8c851cbf866120871713105 (patch)
tree0bcd3b80a9091733b3f663645e7b9b13e0242b2a /sql/log_event.cc
parent51f4ccfa43b8233227ca0257a293f41b2153e42b (diff)
downloadmariadb-git-354f5f7bac16a688f8c851cbf866120871713105.tar.gz
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.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 375f9cf1859..0cda724b698 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -3202,6 +3202,15 @@ Default database: '%s'. Query: '%s'",
DBUG_PRINT("info",("error ignored"));
clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
thd->killed= THD::NOT_KILLED;
+ /*
+ When an error is expected and matches the actual error the
+ slave does not report any error and by consequence changes
+ on transactional tables are not rolled back in the function
+ close_thread_tables(). For that reason, we explicitly roll
+ them back here.
+ */
+ if (expected_error && expected_error == actual_error)
+ ha_autocommit_or_rollback(thd, TRUE);
}
/*
If we expected a non-zero error code and get nothing and, it is a concurrency