Commit 2511bedd authored by mleich@four.local.lan's avatar mleich@four.local.lan

Bug#18946 Test case rpl_ndb_ddl disabled

1. Fixes within the testscripts   (affects rpl_ddl.test and rpl_ndb_ddl.test)
   - slave connection is only an observer (-> AUTOCOMMIT = 0)
     This removes the problem with the hanging test around DROP DATABASE (NDB). The hanging test around DROP DATABASE is a difference to InnoDB/MyISAm behaviour but fare
     away of a clear bug. IMHO this behaviour does not violate the SQL standard and should be therefore simply accepted.   
   - removal of wrong comments
   - CREATE/DROP TEMPORARY TABLE must not cause implicit commit of the current transaction.
     NDB behaves here correct and InnoDB/Falcon wrong.
   - Add a missing connection slave
   - Reenable the test rpl_ndb_ddl.
2. Disable rpl_ddl.test because of Bug#26418.
3. Reenable rpl_ndb_ddl.test
4. Improvements (affect rpl_ddl.test and rpl_ndb_ddl.test)
   - Better + extended comments which should prevent that somebody accidently destroys the logics of the test
   - Replace SELECT's printing comments by "--echo"  (decreases the number of auxiliary SQL commands)
   - Remove the need for include/rpl_stmt_seq2.inc   (was mostly redundant to rpl_stmt_seq.inc)
   - Remove extra/rpl_tests/rpl_ndb_ddl.test         (corrected extra/rpl_tests/rpl_ddl.test is sufficient)  
   - Shift assignment of values to $show_binlog, $manipulate (variables useful for debugging) into the toplevel scripts
   - The temporary tables get now their storage engine from the variable $temp_engine_type. (more deterministic testing conditions)
   - Add additional protocol line if the connection is switched (was partially missing)
   - Add two DML commands for comparison purposes 
parent d445d5e4
######################## rpl_ddl.test ######################## ################# extra/rpl_tests/rpl_ddl.test ########################
# # # #
# DDL statements (sometimes with implicit COMMIT) executed # # DDL statements (sometimes with implicit COMMIT) and other stuff #
# by the master and it's propagation into the slave # # executed on the master and it's propagation into the slave. #
# # # #
############################################################## # The variables #
# $engine_type -- storage engine to be tested/used for the #
# permanent tables within the master #
# $temp_engine_type -- storage engine which supports TEMPORARY #
# tables <> $engine_type #
# $temp_engine_type must point to an all #
# time available storage engine #
# 2007-02 MySQL 5.1 MyISAM and MEMORY only #
# $show_binlog -- print binlog entries #
# 0 - no (default) + fits to the file with #
# results #
# 1 - yes (important for debugging) #
# This variable is used within #
# include/rpl_stmt_seq.inc. #
# $manipulate -- Manipulation of the binary logs #
# 0 - do nothing #
# 1 - so that the output of SHOW BINLOG #
# EVENTS IN <current log> contains only #
# commands of the current test sequence #
# This is especially useful, if the #
# $show_binlog is set to 1 and many #
# subtest are executed. #
# This variable is used within #
# include/rpl_stmt_seq.inc. #
# have to be set before sourcing this script. #
# #
# General assumption about the ideal replication behaviour: #
# Whatever on the master is executed the content of the slave must #
# be in sync with it. #
# #
# Tests of special interest: #
# a) Which DDL commands cause an implicit COMMIT ? #
# This is also of interest outside of replication. #
# b) Transactions modifying table content ending with #
# - explicit COMMIT or ROLLBACK #
# - implicit COMMIT because the connection to the master #
# executed a corresponding DDL statement or runs in #
# AUTOCOMMIT mode #
# - something similar to "implicit COMMIT" if the storage #
# engine (master) is not transactional #
# c) Command which change no data like SELECT or SHOW #
# They do not change anything within the master but #
# this must be also valid for the slave. #
# #
#######################################################################
# Last update:
# 2007-02-12 ML: - slave needs AUTOCOMMIT = 1, because we want to check only
# the propagation of actions of the master connection.
# - replace comments via SQL by "--echo ..."
# - remove some bugs within the testscripts
# - remove the use of include/rpl_stmt_seq2.inc
# #
# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
# #
# 1. !All! objects to be dropped, renamed, altered ... must be created # NOTES:
# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test # 2006-11-15 Lars: Matthias (ML) is the "owner" of this test case.
# sequences start. # So, please get him to review it whenever you want to
# do changes to it.
# #
# 2. Never use a test object, which was direct or indirect affected by a # PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
# preceeding test sequence again. #
# Except table d1.t1 where ONLY DML is allowed. # Typical test architecture (--> include/rpl_stmt_seq.inc)
# --------------------------------------------------------
# 1. Master (no AUTOCOMMIT!): INSERT INTO mysqltest1.t1 without commit
# 2. Master and slave: Check the content of mysqltest1.t1
# 3. Master (no AUTOCOMMIT!): EXECUTE the statement to be tested
# 4. Master and slave: Check the content of mysqltest1.t1
# 5. Master (no AUTOCOMMIT!): ROLLBACK
# 6. Master and slave: Check the content of mysqltest1.t1
# If the previous into mysqltest1.t1 inserted row is visible,
# than the statement to be tested caused an explicit COMMIT
# (statement = COMMIT) or an implicit COMMIT (example CREATE TABLE).
# If the previous into mysqltest1.t1 inserted row is not visible,
# than the statement to be tested caused either an explicit ROLLBACK
# (statement = ROLLBACK), an implicit ROLLBACK (deadlock etc. but
# not tested here) or it does not cause any transaction end.
# 7. Flush the logs
# #
# If one preceeding test sequence hits a (sometimes not good visible, # Some rules:
# -----------
# 1. Any use of mysqltest1.t1 within the statement to be tested must be
# avoided if possible. The only known exception is around LOCK TABLE.
#
# 2. The test logics needs for
# master connection: AUTOCOMMIT = 0
# slave connection: AUTOCOMMIT = 1
# The master connection is the actor and the slave connection is
# only an observer. I.e. the slave connection must not influence
# the activities of master connection.
#
# 3. !All! objects to be dropped, renamed, altered ... must be created
# before the tests start.
# --> less switching of AUTOCOMMIT mode on master side.
#
# 4. Never use a test object, which was direct or indirect affected by a
# preceeding test sequence again.
# If one preceeding test sequence hits a (sometimes not visible,
# because the sql error code of the statement might be 0) bug # because the sql error code of the statement might be 0) bug
# and these rules are ignored, a following test sequence might earn ugly # and these rules are ignored, a following test sequence might earn ugly
# effects like failing 'sync_slave_with_master', crashes of the slave or # effects like failing 'sync_slave_with_master', crashes of the slave or
# abort of the test case etc.. # abort of the test case etc.. This means during analysis the first look
# points into a totally wrong area.
# Except table mysqltest1.t1 where ONLY DML is allowed.
#
# 5. This file is used in several tests (t/rpl_ddl_<whatever>.test).
# Please be aware that every change of the current file affects
# the results of these tests.
# #
# 3. The assignment of the DDL command to be tested to $my_stmt can # ML: Some maybe banal hints:
# be a bit difficult. "'" must be avoided, because the test # 1. The fact that we have here a master - slave replication does
# routine "include/rpl_stmt_seq.inc" performs a # not cause that many general MySQL properties do not apply.
# eval SELECT CONCAT('######## ','$my_stmt',' ########') as ""; # Example:
# The connection to the slave is just a simple session and not a however
# magic working "copy" of the master session or something similar.
# - TEMPORARY TABLES and @variables are session specific
# - the slave session cannot see these things of the master.
# 2. The slave connection must not call sync_slave_with_master.
# 3. SHOW STATUS SLAVE must be run within the slave connection.
# 4. Testcase analysis becomes much more comfortable if
# $show_binlog within include/rpl_stmt_seq.inc is set to 1.
# #
############################################################### ###############################################################
...@@ -33,8 +130,10 @@ ...@@ -33,8 +130,10 @@
############################################################### ###############################################################
# The sync_slave_with_master is needed to make the xids deterministic. # The sync_slave_with_master is needed to make the xids deterministic.
sync_slave_with_master; sync_slave_with_master;
connection master;
--echo
--echo -------- switch to master -------
connection master;
SET AUTOCOMMIT = 1; SET AUTOCOMMIT = 1;
# #
# 1. DROP all objects, which probably already exist, but must be created here # 1. DROP all objects, which probably already exist, but must be created here
...@@ -47,7 +146,7 @@ DROP DATABASE IF EXISTS mysqltest3; ...@@ -47,7 +146,7 @@ DROP DATABASE IF EXISTS mysqltest3;
# #
# 2. CREATE all objects needed # 2. CREATE all objects needed
# working database is mysqltest1 # working database is mysqltest1
# working (transactional!) is mysqltest1.t1 # working table (transactional!) is mysqltest1.t1
# #
CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2; CREATE DATABASE mysqltest2;
...@@ -73,25 +172,23 @@ eval CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=$engine_type; ...@@ -73,25 +172,23 @@ eval CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type; eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type; eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type; eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type;
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT); eval CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=$temp_engine_type;
# #
# 3. master sessions: never do AUTOCOMMIT # 3. master sessions: never do AUTOCOMMIT
# slave sessions: never do AUTOCOMMIT # slave sessions: do AUTOCOMMIT
# #
SET AUTOCOMMIT = 0; SET AUTOCOMMIT = 0;
use mysqltest1; use mysqltest1;
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log SET AUTOCOMMIT = 1;
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SET AUTOCOMMIT = 0;
use mysqltest1; use mysqltest1;
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# We don't want to abort the whole test if one statement sent # We don't want to abort the whole test if one statement sent
...@@ -99,6 +196,21 @@ SELECT '-------- switch to master -------' as ""; ...@@ -99,6 +196,21 @@ SELECT '-------- switch to master -------' as "";
# sequences are nearly independend of the previous statements. # sequences are nearly independend of the previous statements.
--disable_abort_on_error --disable_abort_on_error
###############################################################
# Banal case: commands which should never commit
# Just for checking if the test sequence is usable
###############################################################
let $my_stmt= SELECT 1;
let $my_master_commit= false;
let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc
let $my_stmt= SELECT COUNT(*) FROM t1;
let $my_master_commit= false;
let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc
############################################################### ###############################################################
# Banal case: (explicit) COMMIT and ROLLBACK # Banal case: (explicit) COMMIT and ROLLBACK
# Just for checking if the test sequence is usable # Just for checking if the test sequence is usable
...@@ -143,84 +255,64 @@ let $my_master_commit= true; ...@@ -143,84 +255,64 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't2'; SHOW TABLES LIKE 't2';
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW TABLES LIKE 't2'; SHOW TABLES LIKE 't2';
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# Note: Since this test is executed with a skip-innodb slave, the
# slave incorrectly commits the insert. One can *not* have InnoDB on
# master and MyISAM on slave and expect that a transactional rollback
# after a CREATE TEMPORARY TABLE should work correctly on the slave.
# For this to work properly the handler on the slave must be able to
# handle transactions (e.g. InnoDB or NDB).
let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23; let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23;
let $my_master_commit= false; let $my_master_commit= false;
let $my_slave_commit= true; let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't23'; SHOW TABLES LIKE 't23';
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW TABLES LIKE 't23'; SHOW TABLES LIKE 't23';
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20; let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
let $my_master_commit= true; let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't20'; SHOW TABLES LIKE 't20';
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW TABLES LIKE 't20'; SHOW TABLES LIKE 't20';
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT; let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
let $my_master_commit= true; let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
describe mysqltest1.t4; describe mysqltest1.t4;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
describe mysqltest1.t4; describe mysqltest1.t4;
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE=; let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= $engine_type;
let $my_master_commit= true; let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq2.inc --source include/rpl_stmt_seq.inc
# Note: Since this test is executed with a skip-innodb slave, the
# slave incorrectly commits the insert. One can *not* have InnoDB on
# master and MyISAM on slave and expect that a transactional rollback
# after a CREATE TEMPORARY TABLE should work correctly on the slave.
# For this to work properly the handler on the slave must be able to
# handle transactions (e.g. InnoDB or NDB).
let $engine=''; let $engine='';
let $eng_type=''; let $eng_type='';
let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=$temp_engine_type;
let $my_master_commit= false; let $my_master_commit= false;
let $my_slave_commit= true; let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
let $my_stmt= TRUNCATE TABLE mysqltest1.t7; let $my_stmt= TRUNCATE TABLE mysqltest1.t7;
...@@ -228,9 +320,12 @@ let $my_master_commit= true; ...@@ -228,9 +320,12 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SELECT * FROM mysqltest1.t7; SELECT * FROM mysqltest1.t7;
--echo -------- switch to slave --------
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave;
SELECT * FROM mysqltest1.t7; SELECT * FROM mysqltest1.t7;
--echo
--echo -------- switch to master ------- --echo -------- switch to master -------
connection master; connection master;
...@@ -238,8 +333,13 @@ connection master; ...@@ -238,8 +333,13 @@ connection master;
# Cases with LOCK/UNLOCK # Cases with LOCK/UNLOCK
############################################################### ###############################################################
# MySQL insists in locking mysqltest1.t1, because rpl_stmt_seq performs an # Attention:
# INSERT into this table. # We have to LOCK mysqltest1.t1 here, though it violates the testing
# philosophy.
# Mysql response in case without previous LOCK TABLES mysqltest1.t1
# is:
# SELECT MAX(...) FROM mysqltest1.t1 is
# ERROR HY000: Table 't1' was not locked with LOCK TABLES
let $my_stmt= LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; let $my_stmt= LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
let $my_master_commit= true; let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
...@@ -253,7 +353,8 @@ let $my_slave_commit= false; ...@@ -253,7 +353,8 @@ let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
# With prior read locking # With prior read locking
# Note that this test generate an error since the rpl_stmt_seq.inc # Attention:
# This subtest generates an error since the rpl_stmt_seq.inc
# tries to insert into t1. # tries to insert into t1.
LOCK TABLES mysqltest1.t1 READ; LOCK TABLES mysqltest1.t1 READ;
let $my_stmt= UNLOCK TABLES; let $my_stmt= UNLOCK TABLES;
...@@ -277,30 +378,26 @@ let $my_master_commit= true; ...@@ -277,30 +378,26 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW INDEX FROM mysqltest1.t6; SHOW INDEX FROM mysqltest1.t6;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW INDEX FROM mysqltest1.t6; SHOW INDEX FROM mysqltest1.t6;
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1); let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
let $my_master_commit= true; let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW INDEX FROM mysqltest1.t5; SHOW INDEX FROM mysqltest1.t5;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW INDEX FROM mysqltest1.t5; SHOW INDEX FROM mysqltest1.t5;
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
############################################################### ###############################################################
# Cases with DATABASE # Cases with DATABASE
...@@ -311,35 +408,31 @@ let $my_master_commit= true; ...@@ -311,35 +408,31 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW DATABASES LIKE "mysqltest2"; SHOW DATABASES LIKE "mysqltest2";
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW DATABASES LIKE "mysqltest2"; SHOW DATABASES LIKE "mysqltest2";
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= CREATE DATABASE mysqltest3; let $my_stmt= CREATE DATABASE mysqltest3;
let $my_master_commit= true; let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW DATABASES LIKE "mysqltest3"; SHOW DATABASES LIKE "mysqltest3";
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW DATABASES LIKE "mysqltest3"; SHOW DATABASES LIKE "mysqltest3";
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# End of 4.1 tests # End of 4.1 tests
############################################################### ###############################################################
# Cases with stored procedures # Cases with STORED PROCEDUREs
############################################################### ###############################################################
let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1"; let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
let $my_master_commit= true; let $my_master_commit= true;
...@@ -348,12 +441,13 @@ let $my_slave_commit= true; ...@@ -348,12 +441,13 @@ let $my_slave_commit= true;
--vertical_results --vertical_results
--replace_column 5 # 6 # --replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
--replace_column 5 # 6 # --replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
--echo
--echo -------- switch to master -------
connection master; connection master;
--horizontal_results --horizontal_results
...@@ -364,12 +458,13 @@ let $my_slave_commit= true; ...@@ -364,12 +458,13 @@ let $my_slave_commit= true;
--vertical_results --vertical_results
--replace_column 5 # 6 # --replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
--replace_column 5 # 6 # --replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
--echo
--echo -------- switch to master -------
connection master; connection master;
--horizontal_results --horizontal_results
...@@ -379,11 +474,12 @@ let $my_slave_commit= true; ...@@ -379,11 +474,12 @@ let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
--vertical_results --vertical_results
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
--echo
--echo -------- switch to master -------
connection master; connection master;
--horizontal_results --horizontal_results
...@@ -395,11 +491,12 @@ let $my_master_commit= true; ...@@ -395,11 +491,12 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
--echo
--echo -------- switch to master -------
connection master; connection master;
let $my_stmt= ALTER VIEW v1 AS select f1 from t1; let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
...@@ -407,11 +504,12 @@ let $my_master_commit= true; ...@@ -407,11 +504,12 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
--echo
--echo -------- switch to master -------
connection master; connection master;
let $my_stmt= DROP VIEW IF EXISTS v1; let $my_stmt= DROP VIEW IF EXISTS v1;
...@@ -420,12 +518,13 @@ let $my_slave_commit= true; ...@@ -420,12 +518,13 @@ let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
--error 1146 --error 1146
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
--error 1146 --error 1146
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
--echo
--echo -------- switch to master -------
connection master; connection master;
############################################################### ###############################################################
...@@ -436,11 +535,12 @@ let $my_master_commit= true; ...@@ -436,11 +535,12 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW TRIGGERS; SHOW TRIGGERS;
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
SHOW TRIGGERS; SHOW TRIGGERS;
--echo
--echo -------- switch to master -------
connection master; connection master;
let $my_stmt= DROP TRIGGER trg1; let $my_stmt= DROP TRIGGER trg1;
...@@ -448,11 +548,12 @@ let $my_master_commit= true; ...@@ -448,11 +548,12 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SHOW TRIGGERS; SHOW TRIGGERS;
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
SHOW TRIGGERS; SHOW TRIGGERS;
--echo
--echo -------- switch to master -------
connection master; connection master;
############################################################### ###############################################################
...@@ -463,11 +564,12 @@ let $my_master_commit= true; ...@@ -463,11 +564,12 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'user1'; SELECT user FROM mysql.user WHERE user = 'user1';
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
SELECT user FROM mysql.user WHERE user = 'user1'; SELECT user FROM mysql.user WHERE user = 'user1';
--echo
--echo -------- switch to master -------
connection master; connection master;
let $my_stmt= RENAME USER user1@localhost TO rename1@localhost; let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
...@@ -475,11 +577,12 @@ let $my_master_commit= true; ...@@ -475,11 +577,12 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
--echo
--echo -------- switch to master -------
connection master; connection master;
let $my_stmt= DROP USER rename1@localhost; let $my_stmt= DROP USER rename1@localhost;
...@@ -487,21 +590,21 @@ let $my_master_commit= true; ...@@ -487,21 +590,21 @@ let $my_master_commit= true;
let $my_slave_commit= true; let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc --source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
--disable_query_log --echo
SELECT '-------- switch to slave -------' as ""; --echo -------- switch to slave --------
--enable_query_log
connection slave; connection slave;
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
connection master;
############################################################### ###############################################################
# Cleanup # Cleanup
############################################################### ###############################################################
--disable_warnings use test;
DROP DATABASE IF EXISTS mysqltest1; --echo
DROP DATABASE IF EXISTS mysqltest2; --echo -------- switch to master -------
DROP DATABASE IF EXISTS mysqltest3; connection master;
DROP DATABASE mysqltest1;
# mysqltest2 was alreday DROPPED some tests before.
DROP DATABASE mysqltest3;
--enable_warnings --enable_warnings
-- source include/master-slave-end.inc -- source include/master-slave-end.inc
######################## rpl_ddl.test ########################
# #
# DDL statements (sometimes with implicit COMMIT) executed #
# by the master and it's propagation into the slave #
# #
##############################################################
#
# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
#
# 1. !All! objects to be dropped, renamed, altered ... must be created
# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test
# sequences start.
#
# 2. Never use a test object, which was direct or indirect affected by a
# preceeding test sequence again.
# Except table d1.t1 where ONLY DML is allowed.
#
# If one preceeding test sequence hits a (sometimes not good visible,
# because the sql error code of the statement might be 0) bug
# and these rules are ignored, a following test sequence might earn ugly
# effects like failing 'sync_slave_with_master', crashes of the slave or
# abort of the test case etc..
#
# 3. The assignment of the DDL command to be tested to $my_stmt can
# be a bit difficult. "'" must be avoided, because the test
# routine "include/rpl_stmt_seq.inc" performs a
# eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
#
###############################################################
# Some preparations
###############################################################
# The sync_slave_with_master is needed to make the xids deterministic.
sync_slave_with_master;
connection master;
SET AUTOCOMMIT = 1;
#
# 1. DROP all objects, which probably already exist, but must be created here
#
--disable_warnings
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
--enable_warnings
#
# 2. CREATE all objects needed
# working database is mysqltest1
# working (transactional!) is mysqltest1.t1
#
CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2;
eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
INSERT INTO mysqltest1.t1 SET f1= 0;
eval CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=$engine_type;
CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
eval CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=$engine_type;
INSERT INTO mysqltest1.t7 SET f1= 0;
eval CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type;
eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type;
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
#
# 3. master sessions: never do AUTOCOMMIT
# slave sessions: never do AUTOCOMMIT
#
SET AUTOCOMMIT = 0;
use mysqltest1;
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SET AUTOCOMMIT = 0;
use mysqltest1;
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# We don't want to abort the whole test if one statement sent
# to the server gets an error, because the following test
# sequences are nearly independend of the previous statements.
--disable_abort_on_error
###############################################################
# Banal case: (explicit) COMMIT and ROLLBACK
# Just for checking if the test sequence is usable
###############################################################
let $my_stmt= COMMIT;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
let $my_stmt= ROLLBACK;
let $my_master_commit= false;
let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc
###############################################################
# Cases with commands very similar to COMMIT
###############################################################
let $my_stmt= SET AUTOCOMMIT=1;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SET AUTOCOMMIT=0;
let $my_stmt= START TRANSACTION;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
let $my_stmt= BEGIN;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
###############################################################
# Cases with (BASE) TABLES and (UPDATABLE) VIEWs
###############################################################
let $my_stmt= DROP TABLE mysqltest1.t2;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't2';
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW TABLES LIKE 't2';
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# Note: Since this test is executed with a skip-innodb slave, the
# slave incorrectly commits the insert. One can *not* have InnoDB on
# master and MyISAM on slave and expect that a transactional rollback
# after a CREATE TEMPORARY TABLE should work correctly on the slave.
# For this to work properly the handler on the slave must be able to
# handle transactions (e.g. InnoDB or NDB).
let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23;
let $my_master_commit= false;
let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't23';
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW TABLES LIKE 't23';
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't20';
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW TABLES LIKE 't20';
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
describe mysqltest1.t4;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
describe mysqltest1.t4;
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE=;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq2.inc
# Note: Since this test is executed with a skip-innodb slave, the
# slave incorrectly commits the insert. One can *not* have InnoDB on
# master and MyISAM on slave and expect that a transactional rollback
# after a CREATE TEMPORARY TABLE should work correctly on the slave.
# For this to work properly the handler on the slave must be able to
# handle transactions (e.g. InnoDB or NDB).
let $engine='';
let $eng_type='';
let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT);
let $my_master_commit= false;
let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc
let $my_stmt= TRUNCATE TABLE mysqltest1.t7;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SELECT * FROM mysqltest1.t7;
--echo -------- switch to slave --------
sync_slave_with_master;
SELECT * FROM mysqltest1.t7;
--echo -------- switch to master -------
connection master;
###############################################################
# Cases with LOCK/UNLOCK
###############################################################
# MySQL insists in locking mysqltest1.t1, because rpl_stmt_seq performs an
# INSERT into this table.
let $my_stmt= LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
UNLOCK TABLES;
# No prior locking
let $my_stmt= UNLOCK TABLES;
let $my_master_commit= false;
let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc
# With prior read locking
# Note that this test generate an error since the rpl_stmt_seq.inc
# tries to insert into t1.
LOCK TABLES mysqltest1.t1 READ;
let $my_stmt= UNLOCK TABLES;
let $my_master_commit= false;
let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc
# With prior write locking
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
let $my_stmt= UNLOCK TABLES;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
###############################################################
# Cases with INDEXES
###############################################################
let $my_stmt= DROP INDEX my_idx6 ON mysqltest1.t6;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW INDEX FROM mysqltest1.t6;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW INDEX FROM mysqltest1.t6;
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW INDEX FROM mysqltest1.t5;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW INDEX FROM mysqltest1.t5;
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
###############################################################
# Cases with DATABASE
###############################################################
let $my_stmt= DROP DATABASE mysqltest2;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW DATABASES LIKE "mysqltest2";
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW DATABASES LIKE "mysqltest2";
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
let $my_stmt= CREATE DATABASE mysqltest3;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW DATABASES LIKE "mysqltest3";
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
SHOW DATABASES LIKE "mysqltest3";
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# End of 4.1 tests
###############################################################
# Cases with stored procedures
###############################################################
let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
--vertical_results
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1';
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1';
connection master;
--horizontal_results
let $my_stmt= ALTER PROCEDURE p1 COMMENT "I have been altered";
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
--vertical_results
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1';
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1';
connection master;
--horizontal_results
let $my_stmt= DROP PROCEDURE p1;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
--vertical_results
SHOW PROCEDURE STATUS LIKE 'p1';
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
SHOW PROCEDURE STATUS LIKE 'p1';
connection master;
--horizontal_results
###############################################################
# Cases with VIEWs
###############################################################
let $my_stmt= CREATE OR REPLACE VIEW v1 as select * from t1;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW CREATE VIEW v1;
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
SHOW CREATE VIEW v1;
connection master;
let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW CREATE VIEW v1;
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
SHOW CREATE VIEW v1;
connection master;
let $my_stmt= DROP VIEW IF EXISTS v1;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
--error 1146
SHOW CREATE VIEW v1;
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
--error 1146
SHOW CREATE VIEW v1;
connection master;
###############################################################
# Cases with TRIGGERs
###############################################################
let $my_stmt= CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW TRIGGERS;
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
SHOW TRIGGERS;
connection master;
let $my_stmt= DROP TRIGGER trg1;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW TRIGGERS;
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
SHOW TRIGGERS;
connection master;
###############################################################
# Cases with USERs
###############################################################
let $my_stmt= CREATE USER user1@localhost;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'user1';
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
SELECT user FROM mysql.user WHERE user = 'user1';
connection master;
let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'rename1';
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
SELECT user FROM mysql.user WHERE user = 'rename1';
connection master;
let $my_stmt= DROP USER rename1@localhost;
let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'rename1';
--disable_query_log
SELECT '-------- switch to slave -------' as "";
--enable_query_log
connection slave;
SELECT user FROM mysql.user WHERE user = 'rename1';
connection master;
###############################################################
# Cleanup
###############################################################
--disable_warnings
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
--enable_warnings
-- source include/master-slave-end.inc
# include/rpl_stmt_seq.inc ################### include/rpl_stmt_seq.inc ###########################
# # #
# Please be very careful when editing this routine, because the handling of # Check if a given SQL statement (->$my_stmt) / AUTOCOMMIT mode / #
# the $variables is extreme sensitive. # storage engine somehow involved causes COMMIT or ROLLBACK. #
# # #
# #
# The typical test sequence #
# ------------------------- #
# 1. master connection: INSERT without commit #
# check table content of master and slave #
# 2. master connection: EXECUTE the statement #
# check table content of master and slave #
# 3. master connection: ROLLBACK #
# check table content of master and slave #
# 4. flush the logs #
# #
# The variables #
# $show_binlog -- print binlog entries #
# 0 - default + fits to the file with #
# results #
# 1 - useful for debugging #
# This variable is used within #
# include/rpl_stmt_seq.inc. #
# $manipulate -- Manipulation of the binary logs #
# 0 - do nothing #
# 1 - so that the output of SHOW BINLOG #
# EVENTS IN <current log> contains only #
# commands of the current test sequence #
# This is especially useful, if the #
# $show_binlog is set to 1 and many #
# subtest are executed. #
# This variable is used within #
# include/rpl_stmt_seq.inc. #
# have to be set before sourcing this script. #
# #
# Please be very careful when editing this routine, because the #
# handling of the $variables is extreme sensitive. #
# #
########################################################################
############################################################### # Last update:
# Debug options : To debug this test script # 2007-02-12 ML Replace comments via SQL by "--echo ..."
############################################################### #
let $show_binlog= 0;
let $manipulate= 1;
######## The typical test sequence
# 1. INSERT without commit
# check table content of master and slave
# 2. EXECUTE the statement
# check table content of master and slave
# 3. ROLLBACK
# check table content of master and slave
# 4. flush the logs
let $VERSION=`select version()`; let $VERSION=`select version()`;
--disable_query_log --echo
# SELECT '######## new test sequence ########' as ""; --echo ######## $my_stmt ########
eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
--enable_query_log
############################################################### ###############################################################
...@@ -49,11 +70,10 @@ let $_log_num_s= `select @aux`; ...@@ -49,11 +70,10 @@ let $_log_num_s= `select @aux`;
############################################################### ###############################################################
# INSERT # INSERT
############################################################### ###############################################################
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log # Maybe it would be smarter to use a table with an autoincrement column.
SELECT '-------- switch to master -------' as "";
--enable_query_log
# Maybe it would be smarter to use a table with autoincrement column.
let $MAX= `SELECT MAX(f1) FROM t1` ; let $MAX= `SELECT MAX(f1) FROM t1` ;
eval INSERT INTO t1 SET f1= $MAX + 1; eval INSERT INTO t1 SET f1= $MAX + 1;
# results before DDL(to be tested) # results before DDL(to be tested)
...@@ -66,10 +86,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; ...@@ -66,10 +86,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results before DDL(to be tested) # results before DDL(to be tested)
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
if ($show_binlog) if ($show_binlog)
...@@ -82,10 +101,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; ...@@ -82,10 +101,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
############################################################### ###############################################################
# command to be tested # command to be tested
############################################################### ###############################################################
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
eval $my_stmt; eval $my_stmt;
# Devaluate $my_stmt, to detect script bugs # Devaluate $my_stmt, to detect script bugs
let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT; let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT;
...@@ -99,10 +117,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; ...@@ -99,10 +117,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after DDL(to be tested) # results after DDL(to be tested)
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
if ($show_binlog) if ($show_binlog)
...@@ -115,10 +132,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; ...@@ -115,10 +132,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
############################################################### ###############################################################
# ROLLBACK # ROLLBACK
############################################################### ###############################################################
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
ROLLBACK; ROLLBACK;
# results after final ROLLBACK # results after final ROLLBACK
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
...@@ -140,10 +156,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; ...@@ -140,10 +156,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after final ROLLBACK # results after final ROLLBACK
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
--disable_query_log --disable_query_log
...@@ -172,19 +187,17 @@ if ($manipulate) ...@@ -172,19 +187,17 @@ if ($manipulate)
# - flush the master and the slave log # - flush the master and the slave log
# ---> both start to write into new logs with incremented number # ---> both start to write into new logs with incremented number
# - increment $_log_num_n # - increment $_log_num_n
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
flush logs; flush logs;
# sleep 1; # sleep 1;
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; # eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# the final content of the binary log # the final content of the binary log
flush logs; flush logs;
# The next sleep is urgent needed. # The next sleep is urgent needed.
...@@ -195,7 +208,6 @@ flush logs; ...@@ -195,7 +208,6 @@ flush logs;
inc $_log_num_n; inc $_log_num_n;
} }
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# include/rpl_stmt_seq.inc
#
# Please be very careful when editing this routine, because the handling of
# the $variables is extreme sensitive.
#
###############################################################
# Debug options : To debug this test script
###############################################################
let $show_binlog= 0;
let $manipulate= 1;
######## The typical test sequence
# 1. INSERT without commit
# check table content of master and slave
# 2. EXECUTE the statement
# check table content of master and slave
# 3. ROLLBACK
# check table content of master and slave
# 4. flush the logs
let $VERSION=`select version()`;
--disable_query_log
# SELECT '######## new test sequence ########' as "";
eval SELECT CONCAT('######## ','$my_stmt',' $engine_type',' ########') as "";
--enable_query_log
###############################################################
# Predict the number of the current log
###############################################################
# Disable the logging of the log number computation.
--disable_query_log
# $_log_num_n should contain the number of the current binlog in numeric style.
# If this routine is called for the first time, $_log_num will not initialized
# and contain the value '' instead of '1'. So we will correct it here.
#
eval set @aux= IF('$_log_num_n' = '', '1', '$_log_num_n');
let $_log_num_n= `SELECT @aux`;
eval set @aux= LPAD('$_log_num_n',6,'0');
# SELECT @aux AS "@aux is";
#
# $_log_num_s should contain the number of the current binlog in string style.
let $_log_num_s= `select @aux`;
# eval SELECT '$log_num' ;
--enable_query_log
###############################################################
# INSERT
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# Maybe it would be smarter to use a table with autoincrement column.
let $MAX= `SELECT MAX(f1) FROM t1` ;
eval INSERT INTO t1 SET f1= $MAX + 1;
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# command to be tested
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
eval $my_stmt $engine_type;
# Devaluate $my_stmt, to detect script bugs
let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT;
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# ROLLBACK
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
ROLLBACK;
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
# Try to detect if the DDL command caused that the INSERT is committed
# $MAX holds the highest/last value just before the insert of MAX + 1
--disable_query_log
eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ',
IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')),
IF((MAX(f1) = $MAX + 1) XOR NOT $my_master_commit,
' (Succeeded)',
' (Failed)')) AS ""
FROM mysqltest1.t1;
--enable_query_log
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
--disable_query_log
eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE: The INSERT is ',
IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')),
IF((MAX(f1) = $MAX + 1) XOR NOT $my_slave_commit,
' (Succeeded)',
' (Failed)')) AS ""
FROM mysqltest1.t1;
--enable_query_log
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# Manipulate binlog
###############################################################
if ($manipulate)
{
#### Manipulate the binary logs,
# so that the output of SHOW BINLOG EVENTS IN <current log>
# contains only commands of the current test sequence.
# - flush the master and the slave log
# ---> both start to write into new logs with incremented number
# - increment $_log_num_n
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
flush logs;
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# the final content of the binary log
flush logs;
# The next sleep is urgent needed.
# Without this sleep the slaves crashes often, when the SHOW BINLOG
# is executed. :-(
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
inc $_log_num_n;
}
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
...@@ -4,44 +4,132 @@ reset master; ...@@ -4,44 +4,132 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
-------- switch to master -------
SET AUTOCOMMIT = 1; SET AUTOCOMMIT = 1;
DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2; DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3; DROP DATABASE IF EXISTS mysqltest3;
CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2; CREATE DATABASE mysqltest2;
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=InnoDB;
INSERT INTO mysqltest1.t1 SET f1= 0; INSERT INTO mysqltest1.t1 SET f1= 0;
CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=InnoDB;
CREATE INDEX my_idx6 ON mysqltest1.t6(f1); CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=InnoDB;
INSERT INTO mysqltest1.t7 SET f1= 0; INSERT INTO mysqltest1.t7 SET f1= 0;
CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE="InnoDB"; CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT); CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=MEMORY;
SET AUTOCOMMIT = 0; SET AUTOCOMMIT = 0;
use mysqltest1; use mysqltest1;
-------- switch to slave -------- -------- switch to slave --------
SET AUTOCOMMIT = 0; SET AUTOCOMMIT = 1;
use mysqltest1; use mysqltest1;
-------- switch to master ------- -------- switch to master -------
######## SELECT 1 ########
-------- switch to master -------
INSERT INTO t1 SET f1= 0 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-------- switch to master -------
SELECT 1;
1
1
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
######## SELECT COUNT(*) FROM t1 ########
-------- switch to master -------
INSERT INTO t1 SET f1= 0 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-------- switch to master -------
SELECT COUNT(*) FROM t1;
COUNT(*)
2
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
######## COMMIT ######## ######## COMMIT ########
-------- switch to master ------- -------- switch to master -------
...@@ -81,12 +169,6 @@ MAX(f1) ...@@ -81,12 +169,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## ROLLBACK ######## ######## ROLLBACK ########
...@@ -128,12 +210,6 @@ MAX(f1) ...@@ -128,12 +210,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## SET AUTOCOMMIT=1 ######## ######## SET AUTOCOMMIT=1 ########
...@@ -175,12 +251,6 @@ MAX(f1) ...@@ -175,12 +251,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
...@@ -223,12 +293,6 @@ MAX(f1) ...@@ -223,12 +293,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## BEGIN ######## ######## BEGIN ########
...@@ -270,12 +334,6 @@ MAX(f1) ...@@ -270,12 +334,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## DROP TABLE mysqltest1.t2 ######## ######## DROP TABLE mysqltest1.t2 ########
...@@ -317,12 +375,6 @@ MAX(f1) ...@@ -317,12 +375,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TABLES LIKE 't2'; SHOW TABLES LIKE 't2';
Tables_in_mysqltest1 (t2) Tables_in_mysqltest1 (t2)
...@@ -368,15 +420,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded) ...@@ -368,15 +420,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave -------- -------- switch to slave --------
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
6 5
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave -------- TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TABLES LIKE 't23'; SHOW TABLES LIKE 't23';
...@@ -399,7 +445,7 @@ MAX(f1) ...@@ -399,7 +445,7 @@ MAX(f1)
-------- switch to slave -------- -------- switch to slave --------
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
6 5
-------- switch to master ------- -------- switch to master -------
RENAME TABLE mysqltest1.t3 to mysqltest1.t20; RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
...@@ -427,12 +473,6 @@ MAX(f1) ...@@ -427,12 +473,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TABLES LIKE 't20'; SHOW TABLES LIKE 't20';
Tables_in_mysqltest1 (t20) Tables_in_mysqltest1 (t20)
...@@ -484,12 +524,6 @@ MAX(f1) ...@@ -484,12 +524,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
describe mysqltest1.t4; describe mysqltest1.t4;
Field Type Null Key Default Extra Field Type Null Key Default Extra
...@@ -504,7 +538,7 @@ f2 bigint(20) YES NULL ...@@ -504,7 +538,7 @@ f2 bigint(20) YES NULL
-------- switch to master ------- -------- switch to master -------
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ######## ######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= InnoDB ########
-------- switch to master ------- -------- switch to master -------
INSERT INTO t1 SET f1= 7 + 1; INSERT INTO t1 SET f1= 7 + 1;
...@@ -518,7 +552,7 @@ MAX(f1) ...@@ -518,7 +552,7 @@ MAX(f1)
7 7
-------- switch to master ------- -------- switch to master -------
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB"; CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= InnoDB;
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
8 8
...@@ -543,15 +577,9 @@ MAX(f1) ...@@ -543,15 +577,9 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ######## ######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY ########
-------- switch to master ------- -------- switch to master -------
INSERT INTO t1 SET f1= 8 + 1; INSERT INTO t1 SET f1= 8 + 1;
...@@ -565,7 +593,7 @@ MAX(f1) ...@@ -565,7 +593,7 @@ MAX(f1)
8 8
-------- switch to master ------- -------- switch to master -------
CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY;
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
9 9
...@@ -586,15 +614,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded) ...@@ -586,15 +614,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave -------- -------- switch to slave --------
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
9 8
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave -------- TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
flush logs;
-------- switch to master ------- -------- switch to master -------
...@@ -609,7 +631,7 @@ MAX(f1) ...@@ -609,7 +631,7 @@ MAX(f1)
-------- switch to slave -------- -------- switch to slave --------
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
9 8
-------- switch to master ------- -------- switch to master -------
TRUNCATE TABLE mysqltest1.t7; TRUNCATE TABLE mysqltest1.t7;
...@@ -637,18 +659,14 @@ MAX(f1) ...@@ -637,18 +659,14 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT * FROM mysqltest1.t7; SELECT * FROM mysqltest1.t7;
f1 f1
-------- switch to slave -------- -------- switch to slave --------
SELECT * FROM mysqltest1.t7; SELECT * FROM mysqltest1.t7;
f1 f1
-------- switch to master ------- -------- switch to master -------
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ######## ######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
...@@ -690,12 +708,6 @@ MAX(f1) ...@@ -690,12 +708,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
UNLOCK TABLES; UNLOCK TABLES;
...@@ -738,12 +750,6 @@ MAX(f1) ...@@ -738,12 +750,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
LOCK TABLES mysqltest1.t1 READ; LOCK TABLES mysqltest1.t1 READ;
...@@ -787,12 +793,6 @@ MAX(f1) ...@@ -787,12 +793,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
...@@ -835,12 +835,6 @@ MAX(f1) ...@@ -835,12 +835,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## DROP INDEX my_idx6 ON mysqltest1.t6 ######## ######## DROP INDEX my_idx6 ON mysqltest1.t6 ########
...@@ -882,12 +876,6 @@ MAX(f1) ...@@ -882,12 +876,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW INDEX FROM mysqltest1.t6; SHOW INDEX FROM mysqltest1.t6;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
...@@ -937,12 +925,6 @@ MAX(f1) ...@@ -937,12 +925,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW INDEX FROM mysqltest1.t5; SHOW INDEX FROM mysqltest1.t5;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
...@@ -994,12 +976,6 @@ MAX(f1) ...@@ -994,12 +976,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW DATABASES LIKE "mysqltest2"; SHOW DATABASES LIKE "mysqltest2";
Database (mysqltest2) Database (mysqltest2)
...@@ -1049,12 +1025,6 @@ MAX(f1) ...@@ -1049,12 +1025,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW DATABASES LIKE "mysqltest3"; SHOW DATABASES LIKE "mysqltest3";
Database (mysqltest3) Database (mysqltest3)
...@@ -1106,12 +1076,6 @@ MAX(f1) ...@@ -1106,12 +1076,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1 Db mysqltest1
...@@ -1122,7 +1086,8 @@ Modified # ...@@ -1122,7 +1086,8 @@ Modified #
Created # Created #
Security_type DEFINER Security_type DEFINER
Comment Comment
-------- switch to slave -------
-------- switch to slave --------
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1 Db mysqltest1
Name p1 Name p1
...@@ -1133,6 +1098,8 @@ Created # ...@@ -1133,6 +1098,8 @@ Created #
Security_type DEFINER Security_type DEFINER
Comment Comment
-------- switch to master -------
######## ALTER PROCEDURE p1 COMMENT "I have been altered" ######## ######## ALTER PROCEDURE p1 COMMENT "I have been altered" ########
-------- switch to master ------- -------- switch to master -------
...@@ -1172,12 +1139,6 @@ MAX(f1) ...@@ -1172,12 +1139,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1 Db mysqltest1
...@@ -1188,7 +1149,8 @@ Modified # ...@@ -1188,7 +1149,8 @@ Modified #
Created # Created #
Security_type DEFINER Security_type DEFINER
Comment I have been altered Comment I have been altered
-------- switch to slave -------
-------- switch to slave --------
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1 Db mysqltest1
Name p1 Name p1
...@@ -1199,6 +1161,8 @@ Created # ...@@ -1199,6 +1161,8 @@ Created #
Security_type DEFINER Security_type DEFINER
Comment I have been altered Comment I have been altered
-------- switch to master -------
######## DROP PROCEDURE p1 ######## ######## DROP PROCEDURE p1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1239,15 +1203,12 @@ MAX(f1) ...@@ -1239,15 +1203,12 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master ------- -------- switch to master -------
flush logs; SHOW PROCEDURE STATUS LIKE 'p1';
-------- switch to slave -------- -------- switch to slave --------
flush logs; SHOW PROCEDURE STATUS LIKE 'p1';
-------- switch to master ------- -------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1';
-------- switch to slave -------
SHOW PROCEDURE STATUS LIKE 'p1';
######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## ######## CREATE OR REPLACE VIEW v1 as select * from t1 ########
...@@ -1288,22 +1249,18 @@ MAX(f1) ...@@ -1288,22 +1249,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
-------- switch to slave ------- -------- switch to slave --------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
-------- switch to master -------
######## ALTER VIEW v1 AS select f1 from t1 ######## ######## ALTER VIEW v1 AS select f1 from t1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1343,22 +1300,18 @@ MAX(f1) ...@@ -1343,22 +1300,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
-------- switch to slave ------- -------- switch to slave --------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
-------- switch to master -------
######## DROP VIEW IF EXISTS v1 ######## ######## DROP VIEW IF EXISTS v1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1398,20 +1351,16 @@ MAX(f1) ...@@ -1398,20 +1351,16 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
-------- switch to slave ------- -------- switch to slave --------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
-------- switch to master -------
######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## ######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1451,22 +1400,18 @@ MAX(f1) ...@@ -1451,22 +1400,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
-------- switch to slave ------- -------- switch to slave --------
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
-------- switch to master -------
######## DROP TRIGGER trg1 ######## ######## DROP TRIGGER trg1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1506,20 +1451,16 @@ MAX(f1) ...@@ -1506,20 +1451,16 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
-------- switch to slave ------- -------- switch to slave --------
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
-------- switch to master -------
######## CREATE USER user1@localhost ######## ######## CREATE USER user1@localhost ########
-------- switch to master ------- -------- switch to master -------
...@@ -1559,22 +1500,18 @@ MAX(f1) ...@@ -1559,22 +1500,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT user FROM mysql.user WHERE user = 'user1'; SELECT user FROM mysql.user WHERE user = 'user1';
user user
user1 user1
-------- switch to slave ------- -------- switch to slave --------
SELECT user FROM mysql.user WHERE user = 'user1'; SELECT user FROM mysql.user WHERE user = 'user1';
user user
user1 user1
-------- switch to master -------
######## RENAME USER user1@localhost TO rename1@localhost ######## ######## RENAME USER user1@localhost TO rename1@localhost ########
-------- switch to master ------- -------- switch to master -------
...@@ -1614,22 +1551,18 @@ MAX(f1) ...@@ -1614,22 +1551,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
user user
rename1 rename1
-------- switch to slave ------- -------- switch to slave --------
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
user user
rename1 rename1
-------- switch to master -------
######## DROP USER rename1@localhost ######## ######## DROP USER rename1@localhost ########
-------- switch to master ------- -------- switch to master -------
...@@ -1669,19 +1602,15 @@ MAX(f1) ...@@ -1669,19 +1602,15 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
user user
-------- switch to slave ------- -------- switch to slave --------
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
user user
DROP DATABASE IF EXISTS mysqltest1; use test;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3; -------- switch to master -------
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest3;
...@@ -4,44 +4,132 @@ reset master; ...@@ -4,44 +4,132 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
-------- switch to master -------
SET AUTOCOMMIT = 1; SET AUTOCOMMIT = 1;
DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2; DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3; DROP DATABASE IF EXISTS mysqltest3;
CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2; CREATE DATABASE mysqltest2;
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=NDB;
INSERT INTO mysqltest1.t1 SET f1= 0; INSERT INTO mysqltest1.t1 SET f1= 0;
CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=NDB;
CREATE INDEX my_idx6 ON mysqltest1.t6(f1); CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=NDB;
INSERT INTO mysqltest1.t7 SET f1= 0; INSERT INTO mysqltest1.t7 SET f1= 0;
CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=NDB;
CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE="NDB"; CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=NDB;
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT); CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=MEMORY;
SET AUTOCOMMIT = 0; SET AUTOCOMMIT = 0;
use mysqltest1; use mysqltest1;
-------- switch to slave -------- -------- switch to slave --------
SET AUTOCOMMIT = 0; SET AUTOCOMMIT = 1;
use mysqltest1; use mysqltest1;
-------- switch to master ------- -------- switch to master -------
######## SELECT 1 ########
-------- switch to master -------
INSERT INTO t1 SET f1= 0 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-------- switch to master -------
SELECT 1;
1
1
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
######## SELECT COUNT(*) FROM t1 ########
-------- switch to master -------
INSERT INTO t1 SET f1= 0 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-------- switch to master -------
SELECT COUNT(*) FROM t1;
COUNT(*)
2
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
######## COMMIT ######## ######## COMMIT ########
-------- switch to master ------- -------- switch to master -------
...@@ -81,12 +169,6 @@ MAX(f1) ...@@ -81,12 +169,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## ROLLBACK ######## ######## ROLLBACK ########
...@@ -128,12 +210,6 @@ MAX(f1) ...@@ -128,12 +210,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## SET AUTOCOMMIT=1 ######## ######## SET AUTOCOMMIT=1 ########
...@@ -175,12 +251,6 @@ MAX(f1) ...@@ -175,12 +251,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
...@@ -223,12 +293,6 @@ MAX(f1) ...@@ -223,12 +293,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## BEGIN ######## ######## BEGIN ########
...@@ -270,12 +334,6 @@ MAX(f1) ...@@ -270,12 +334,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## DROP TABLE mysqltest1.t2 ######## ######## DROP TABLE mysqltest1.t2 ########
...@@ -317,12 +375,6 @@ MAX(f1) ...@@ -317,12 +375,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TABLES LIKE 't2'; SHOW TABLES LIKE 't2';
Tables_in_mysqltest1 (t2) Tables_in_mysqltest1 (t2)
...@@ -372,12 +424,6 @@ MAX(f1) ...@@ -372,12 +424,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TABLES LIKE 't23'; SHOW TABLES LIKE 't23';
Tables_in_mysqltest1 (t23) Tables_in_mysqltest1 (t23)
...@@ -427,12 +473,6 @@ MAX(f1) ...@@ -427,12 +473,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TABLES LIKE 't20'; SHOW TABLES LIKE 't20';
Tables_in_mysqltest1 (t20) Tables_in_mysqltest1 (t20)
...@@ -484,12 +524,6 @@ MAX(f1) ...@@ -484,12 +524,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
describe mysqltest1.t4; describe mysqltest1.t4;
Field Type Null Key Default Extra Field Type Null Key Default Extra
...@@ -504,7 +538,7 @@ f2 bigint(20) YES NULL ...@@ -504,7 +538,7 @@ f2 bigint(20) YES NULL
-------- switch to master ------- -------- switch to master -------
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB" ######## ######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= NDB ########
-------- switch to master ------- -------- switch to master -------
INSERT INTO t1 SET f1= 7 + 1; INSERT INTO t1 SET f1= 7 + 1;
...@@ -518,7 +552,7 @@ MAX(f1) ...@@ -518,7 +552,7 @@ MAX(f1)
7 7
-------- switch to master ------- -------- switch to master -------
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB"; CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= NDB;
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
8 8
...@@ -543,15 +577,9 @@ MAX(f1) ...@@ -543,15 +577,9 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ######## ######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY ########
-------- switch to master ------- -------- switch to master -------
INSERT INTO t1 SET f1= 8 + 1; INSERT INTO t1 SET f1= 8 + 1;
...@@ -565,7 +593,7 @@ MAX(f1) ...@@ -565,7 +593,7 @@ MAX(f1)
8 8
-------- switch to master ------- -------- switch to master -------
CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY;
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
9 9
...@@ -590,12 +618,6 @@ MAX(f1) ...@@ -590,12 +618,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## TRUNCATE TABLE mysqltest1.t7 ######## ######## TRUNCATE TABLE mysqltest1.t7 ########
...@@ -637,18 +659,14 @@ MAX(f1) ...@@ -637,18 +659,14 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT * FROM mysqltest1.t7; SELECT * FROM mysqltest1.t7;
f1 f1
-------- switch to slave -------- -------- switch to slave --------
SELECT * FROM mysqltest1.t7; SELECT * FROM mysqltest1.t7;
f1 f1
-------- switch to master ------- -------- switch to master -------
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ######## ######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
...@@ -690,12 +708,6 @@ MAX(f1) ...@@ -690,12 +708,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
UNLOCK TABLES; UNLOCK TABLES;
...@@ -738,12 +750,6 @@ MAX(f1) ...@@ -738,12 +750,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
LOCK TABLES mysqltest1.t1 READ; LOCK TABLES mysqltest1.t1 READ;
...@@ -787,12 +793,6 @@ MAX(f1) ...@@ -787,12 +793,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
...@@ -835,12 +835,6 @@ MAX(f1) ...@@ -835,12 +835,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
######## DROP INDEX my_idx6 ON mysqltest1.t6 ######## ######## DROP INDEX my_idx6 ON mysqltest1.t6 ########
...@@ -882,12 +876,6 @@ MAX(f1) ...@@ -882,12 +876,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW INDEX FROM mysqltest1.t6; SHOW INDEX FROM mysqltest1.t6;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
...@@ -937,12 +925,6 @@ MAX(f1) ...@@ -937,12 +925,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW INDEX FROM mysqltest1.t5; SHOW INDEX FROM mysqltest1.t5;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
...@@ -994,12 +976,6 @@ MAX(f1) ...@@ -994,12 +976,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW DATABASES LIKE "mysqltest2"; SHOW DATABASES LIKE "mysqltest2";
Database (mysqltest2) Database (mysqltest2)
...@@ -1049,12 +1025,6 @@ MAX(f1) ...@@ -1049,12 +1025,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW DATABASES LIKE "mysqltest3"; SHOW DATABASES LIKE "mysqltest3";
Database (mysqltest3) Database (mysqltest3)
...@@ -1106,12 +1076,6 @@ MAX(f1) ...@@ -1106,12 +1076,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1 Db mysqltest1
...@@ -1122,7 +1086,8 @@ Modified # ...@@ -1122,7 +1086,8 @@ Modified #
Created # Created #
Security_type DEFINER Security_type DEFINER
Comment Comment
-------- switch to slave -------
-------- switch to slave --------
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1 Db mysqltest1
Name p1 Name p1
...@@ -1133,6 +1098,8 @@ Created # ...@@ -1133,6 +1098,8 @@ Created #
Security_type DEFINER Security_type DEFINER
Comment Comment
-------- switch to master -------
######## ALTER PROCEDURE p1 COMMENT "I have been altered" ######## ######## ALTER PROCEDURE p1 COMMENT "I have been altered" ########
-------- switch to master ------- -------- switch to master -------
...@@ -1172,12 +1139,6 @@ MAX(f1) ...@@ -1172,12 +1139,6 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1 Db mysqltest1
...@@ -1188,7 +1149,8 @@ Modified # ...@@ -1188,7 +1149,8 @@ Modified #
Created # Created #
Security_type DEFINER Security_type DEFINER
Comment I have been altered Comment I have been altered
-------- switch to slave -------
-------- switch to slave --------
SHOW PROCEDURE STATUS LIKE 'p1'; SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1 Db mysqltest1
Name p1 Name p1
...@@ -1199,6 +1161,8 @@ Created # ...@@ -1199,6 +1161,8 @@ Created #
Security_type DEFINER Security_type DEFINER
Comment I have been altered Comment I have been altered
-------- switch to master -------
######## DROP PROCEDURE p1 ######## ######## DROP PROCEDURE p1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1239,15 +1203,12 @@ MAX(f1) ...@@ -1239,15 +1203,12 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master ------- -------- switch to master -------
flush logs; SHOW PROCEDURE STATUS LIKE 'p1';
-------- switch to slave -------- -------- switch to slave --------
flush logs; SHOW PROCEDURE STATUS LIKE 'p1';
-------- switch to master ------- -------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1';
-------- switch to slave -------
SHOW PROCEDURE STATUS LIKE 'p1';
######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## ######## CREATE OR REPLACE VIEW v1 as select * from t1 ########
...@@ -1288,22 +1249,18 @@ MAX(f1) ...@@ -1288,22 +1249,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
-------- switch to slave ------- -------- switch to slave --------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
-------- switch to master -------
######## ALTER VIEW v1 AS select f1 from t1 ######## ######## ALTER VIEW v1 AS select f1 from t1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1343,22 +1300,18 @@ MAX(f1) ...@@ -1343,22 +1300,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
-------- switch to slave ------- -------- switch to slave --------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
-------- switch to master -------
######## DROP VIEW IF EXISTS v1 ######## ######## DROP VIEW IF EXISTS v1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1398,20 +1351,16 @@ MAX(f1) ...@@ -1398,20 +1351,16 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
-------- switch to slave ------- -------- switch to slave --------
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
-------- switch to master -------
######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## ######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1451,22 +1400,18 @@ MAX(f1) ...@@ -1451,22 +1400,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
-------- switch to slave ------- -------- switch to slave --------
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
-------- switch to master -------
######## DROP TRIGGER trg1 ######## ######## DROP TRIGGER trg1 ########
-------- switch to master ------- -------- switch to master -------
...@@ -1506,20 +1451,16 @@ MAX(f1) ...@@ -1506,20 +1451,16 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
-------- switch to slave ------- -------- switch to slave --------
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
-------- switch to master -------
######## CREATE USER user1@localhost ######## ######## CREATE USER user1@localhost ########
-------- switch to master ------- -------- switch to master -------
...@@ -1559,22 +1500,18 @@ MAX(f1) ...@@ -1559,22 +1500,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT user FROM mysql.user WHERE user = 'user1'; SELECT user FROM mysql.user WHERE user = 'user1';
user user
user1 user1
-------- switch to slave ------- -------- switch to slave --------
SELECT user FROM mysql.user WHERE user = 'user1'; SELECT user FROM mysql.user WHERE user = 'user1';
user user
user1 user1
-------- switch to master -------
######## RENAME USER user1@localhost TO rename1@localhost ######## ######## RENAME USER user1@localhost TO rename1@localhost ########
-------- switch to master ------- -------- switch to master -------
...@@ -1614,22 +1551,18 @@ MAX(f1) ...@@ -1614,22 +1551,18 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
user user
rename1 rename1
-------- switch to slave ------- -------- switch to slave --------
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
user user
rename1 rename1
-------- switch to master -------
######## DROP USER rename1@localhost ######## ######## DROP USER rename1@localhost ########
-------- switch to master ------- -------- switch to master -------
...@@ -1669,20 +1602,15 @@ MAX(f1) ...@@ -1669,20 +1602,15 @@ MAX(f1)
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
user user
-------- switch to slave ------- -------- switch to slave --------
SELECT user FROM mysql.user WHERE user = 'rename1'; SELECT user FROM mysql.user WHERE user = 'rename1';
user user
DROP DATABASE IF EXISTS mysqltest1; use test;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3; -------- switch to master -------
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction DROP DATABASE mysqltest1;
DROP DATABASE mysqltest3;
...@@ -24,7 +24,7 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when up ...@@ -24,7 +24,7 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when up
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_2myisam : BUG#19227 Seems to pass currently rpl_ndb_2myisam : BUG#19227 Seems to pass currently
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master
rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
......
...@@ -22,13 +22,11 @@ ...@@ -22,13 +22,11 @@
# effects like failing 'sync_slave_with_master', crashes of the slave or # effects like failing 'sync_slave_with_master', crashes of the slave or
# abort of the test case etc.. # abort of the test case etc..
# #
# 3. The assignment of the DDL command to be tested to $my_stmt can
# be a bit difficult. "'" must be avoided, because the test
# routine "include/rpl_stmt_seq.inc" performs a
# eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
#
--source include/not_ndb_default.inc --source include/not_ndb_default.inc
--source include/have_innodb.inc
--source include/master-slave.inc --source include/master-slave.inc
let $engine_type= "InnoDB"; --source include/have_innodb.inc
let $engine_type= InnoDB;
let $temp_engine_type= MEMORY;
let $show_binlog = 0;
let $manipulate = 0;
-- source extra/rpl_tests/rpl_ddl.test -- source extra/rpl_tests/rpl_ddl.test
######################## rpl_ddl.test ######################## #################### rpl_ndb_ddl.test ########################
# # # #
# DDL statements (sometimes with implicit COMMIT) executed # # DDL statements (sometimes with implicit COMMIT) executed #
# by the master and it's propagation into the slave # # by the master and it's propagation into the slave #
...@@ -22,14 +22,11 @@ ...@@ -22,14 +22,11 @@
# effects like failing 'sync_slave_with_master', crashes of the slave or # effects like failing 'sync_slave_with_master', crashes of the slave or
# abort of the test case etc.. # abort of the test case etc..
# #
# 3. The assignment of the DDL command to be tested to $my_stmt can
# be a bit difficult. "'" must be avoided, because the test
# routine "include/rpl_stmt_seq.inc" performs a
# eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
#
--source include/have_ndb.inc
--source include/master-slave.inc --source include/master-slave.inc
let $engine_type= "NDB"; --source include/have_ndb.inc
-- source extra/rpl_tests/rpl_ndb_ddl.test let $engine_type= NDB;
let $temp_engine_type= MEMORY;
let $show_binlog = 0;
let $manipulate = 0;
-- source extra/rpl_tests/rpl_ddl.test
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