summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl_innodb.test
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-06-19 14:27:53 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-06-19 14:27:53 +0300
commitfe593bf1ab939bf11827d0ab14ebb69387d9358c (patch)
treefc28fda969044b7b483e45355fc385e45f8554d3 /mysql-test/t/rpl_innodb.test
parentdb17ac9f072fd3d0a5dfa929fda1ad5429200370 (diff)
downloadmariadb-git-fe593bf1ab939bf11827d0ab14ebb69387d9358c.tar.gz
Bug #26418: Slave out of sync after
CREATE/DROP TEMPORARY TABLE + ROLLBACK on master The transaction ability of the storage engines of the tables on the replication master and the replication slave must generally be the same. When the storage engine type of the slave is non-transactional then transactions on the master that mix update of transactional and non-transactional tables should be avoided because they will cause inconsistency of the data between the master's transactional table and the slave's non-transactional table. The effect described by this bug is actually expected. A detailed test case is added (to be merged later to the updated rpl_ddl.test), as there was no coverage by the existing tests. Some code cleanup is also added by this change. mysql-test/r/rpl_innodb.result: Bug #26418: test case mysql-test/t/rpl_innodb.test: Bug #26418: test case sql/events.cc: Bug #26418: replace repeating code with a function call sql/sp.cc: Bug #26418: replace repeating code with a function call sql/sql_acl.cc: Bug #26418: replace repeating code with a function call sql/sql_class.cc: Bug #26418: remove dead code sql/sql_class.h: Bug #26418: remove dead code sql/sql_delete.cc: Bug #26418: replace repeating code with a function call sql/sql_parse.cc: Bug #26418: replace repeating code with a function call sql/sql_rename.cc: Bug #26418: replace repeating code with a function call sql/sql_tablespace.cc: Bug #26418: replace repeating code with a function call sql/sql_trigger.cc: Bug #26418: replace repeating code with a function call sql/sql_udf.cc: Bug #26418: replace repeating code with a function call sql/sql_view.cc: Bug #26418: replace repeating code with a function call
Diffstat (limited to 'mysql-test/t/rpl_innodb.test')
-rw-r--r--mysql-test/t/rpl_innodb.test71
1 files changed, 71 insertions, 0 deletions
diff --git a/mysql-test/t/rpl_innodb.test b/mysql-test/t/rpl_innodb.test
index b88276e2107..f13889349f7 100644
--- a/mysql-test/t/rpl_innodb.test
+++ b/mysql-test/t/rpl_innodb.test
@@ -44,5 +44,76 @@ connection master;
DROP TABLE t4;
--enable_query_log
sync_slave_with_master;
+connection master;
# End of 4.1 tests
+
+#
+# Bug #26418: Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK
+# on master
+#
+#Note Matthias: to be merged to rpl_ddl.test
+
+--source include/not_ndb_default.inc
+
+FLUSH LOGS;
+sync_slave_with_master;
+FLUSH LOGS;
+connection master;
+let $engine_type= "InnoDB";
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+--enable_warnings
+
+CREATE DATABASE mysqltest1;
+CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
+eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
+SET AUTOCOMMIT = 0;
+
+sync_slave_with_master;
+--echo -------- switch to slave --------
+connection slave;
+SHOW CREATE TABLE mysqltest1.t1;
+
+--echo -------- switch to master --------
+connection master;
+INSERT INTO mysqltest1.t1 SET f1= 1;
+DROP TEMPORARY TABLE mysqltest1.tmp;
+ROLLBACK;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp;
+# Must return no rows here
+SELECT COUNT(*) FROM mysqltest1.t1;
+
+INSERT INTO mysqltest1.t1 SET f1= 2;
+CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT);
+ROLLBACK;
+SHOW CREATE TABLE mysqltest1.tmp2;
+# Must return no rows here
+SELECT COUNT(*) FROM mysqltest1.t1;
+
+sync_slave_with_master;
+--echo -------- switch to slave --------
+connection slave;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp2;
+# has two rows here : as the default is MyISAM and
+# it can't be rolled back by the master's ROLLBACK.
+SELECT COUNT(*) FROM mysqltest1.t1;
+FLUSH LOGS;
+--replace_column 1 x 2 x 3 x 4 x 5 x
+SHOW BINLOG EVENTS IN 'slave-bin.000002' LIMIT 1,8;
+
+--echo -------- switch to master --------
+connection master;
+FLUSH LOGS;
+--replace_column 1 x 2 x 3 x 4 x 5 x
+SHOW BINLOG EVENTS IN 'master-bin.000002' LIMIT 1,12;
+
+DROP DATABASE mysqltest1;
+-- source include/master-slave-end.inc
+
+--echo End of 5.1 tests