mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Has issues with original tree, so had to pull new tree and copy test over. Running last test now and will push after
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test mysql-test/t/rpl_extraCol_innodb-master.opt: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/t/rpl_extraCol_innodb-master.opt mysql-test/t/rpl_extraCol_innodb-slave.opt: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/t/rpl_extraCol_innodb-slave.opt mysql-test/t/rpl_extraCol_innodb.test: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/t/rpl_extraCol_innodb.test mysql-test/t/rpl_extraCol_myisam.test: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/t/rpl_extraCol_myisam.test mysql-test/r/rpl_extraCol_innodb.result: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/r/rpl_extraCol_innodb.result mysql-test/r/rpl_extraCol_myisam.result: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/r/rpl_extraCol_myisam.result mysql-test/r/rpl_ndb_extraCol.result: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/r/rpl_ndb_extraCol.result mysql-test/t/rpl_ndb_extraCol.test: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/t/rpl_ndb_extraCol.test mysql-test/extra/rpl_tests/rpl_ndb_ddl.test: BitKeeper file /data0/mysql-5.1-new-rpl/mysql-test/extra/rpl_tests/rpl_ndb_ddl.test
This commit is contained in:
parent
88b5cf4040
commit
77b1bb8477
13 changed files with 3637 additions and 17 deletions
853
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
Normal file
853
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
Normal file
|
@ -0,0 +1,853 @@
|
|||
#################################################
|
||||
# Author: Jeb
|
||||
# Date: 2006-09-07
|
||||
# Purpose: To test having extra columns on the slave.
|
||||
##################################################
|
||||
|
||||
########### Clean up ################
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17;
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
|
||||
#################################################
|
||||
############ Different Table Def Test ###########
|
||||
#################################################
|
||||
# Purpose: To have different table def on the #
|
||||
# master and slave. Most of these tests#
|
||||
# should stop the slave. #
|
||||
#################################################
|
||||
|
||||
--echo **** Diff Table Def Start ****
|
||||
|
||||
##############################################
|
||||
### Try to replicate w/ PK on diff columns ###
|
||||
### Should Stop Slave ###
|
||||
##############################################
|
||||
|
||||
--echo *** On Slave ***
|
||||
sync_slave_with_master;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
|
||||
eval CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(4) DEFAULT 'TEST')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t1 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
|
||||
INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
--echo *** Select from slave ***
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
--echo *** Drop t1 ***
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
############################################
|
||||
### Try to replicate CHAR(10) to CHAR(5) ###
|
||||
### Should Stop Slave or truncate value ###
|
||||
############################################
|
||||
|
||||
## BUG22086
|
||||
#--echo *** Create t2 on slave ***
|
||||
#STOP SLAVE;
|
||||
#RESET SLAVE;
|
||||
#eval CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
|
||||
# d FLOAT DEFAULT '2.00',
|
||||
# e CHAR(5) DEFAULT 'TEST2')
|
||||
# ENGINE=$engine_type;
|
||||
#
|
||||
#--echo *** Create t2 on Master ***
|
||||
#connection master;
|
||||
#eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
|
||||
# ) ENGINE=$engine_type;
|
||||
#RESET MASTER;
|
||||
#
|
||||
#--echo *** Start Slave ***
|
||||
#connection slave;
|
||||
#START SLAVE;
|
||||
#
|
||||
#--echo *** Master Data Insert ***
|
||||
#connection master;
|
||||
#
|
||||
#INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
|
||||
#SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
#--echo *** Select from slave ***
|
||||
#sync_slave_with_master;
|
||||
#SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
#--echo *** Drop t2 ***
|
||||
#connection master;
|
||||
#DROP TABLE t2;
|
||||
#sync_slave_with_master;
|
||||
|
||||
####################################
|
||||
### Try to replicate BLOB to INT ###
|
||||
### Should Stop Slave ###
|
||||
####################################
|
||||
--echo *** Create t3 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t3 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
|
||||
set @b1 = 'b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
|
||||
INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
|
||||
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1522 ***
|
||||
--echo ********************************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Drop t3 ***
|
||||
connection master;
|
||||
DROP TABLE t3;
|
||||
sync_slave_with_master;
|
||||
|
||||
#####################################################
|
||||
# Columns with different types, more columns at end #
|
||||
# Expect: proper error message (wrong types) #
|
||||
#####################################################
|
||||
|
||||
--echo *** Create t4 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t4 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
|
||||
INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
|
||||
(30000.22,4,'QA TESTING');
|
||||
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1522 ***
|
||||
--echo ********************************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Drop t4 ***
|
||||
connection master;
|
||||
DROP TABLE t4;
|
||||
sync_slave_with_master;
|
||||
|
||||
#######################################################
|
||||
# Columns with different types, same number of colums #
|
||||
# Expect: Proper error message #
|
||||
#######################################################
|
||||
|
||||
--echo *** Create t5 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
|
||||
c FLOAT, d INT, e DOUBLE,
|
||||
f DECIMAL(8,2))ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t5 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
|
||||
c DECIMAL(8,2), d BIT, e BLOB,
|
||||
f FLOAT) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
|
||||
INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
|
||||
(2,'JOE',300.01,0,'b2b2',1.0000009);
|
||||
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1522 ***
|
||||
--echo ********************************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Drop t5 ***
|
||||
connection master;
|
||||
DROP TABLE t5;
|
||||
sync_slave_with_master;
|
||||
|
||||
#######################################################
|
||||
################## Continued ##########################
|
||||
#######################################################
|
||||
# Columns with different types, same number of colums #
|
||||
# Expect: Proper error message #
|
||||
#######################################################
|
||||
|
||||
--echo *** Create t6 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
|
||||
c FLOAT, d INT)ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t6 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
|
||||
c DECIMAL(8,2), d BIT
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
|
||||
INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
|
||||
(2,'JOE',300.01,0);
|
||||
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1522 ***
|
||||
--echo ********************************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
|
||||
#START SLAVE;
|
||||
|
||||
--echo *** Drop t6 ***
|
||||
connection master;
|
||||
DROP TABLE t6;
|
||||
connection slave;
|
||||
DROP TABLE t6;
|
||||
START SLAVE;
|
||||
#sync_slave_with_master;
|
||||
|
||||
|
||||
--echo **** Diff Table Def End ****
|
||||
|
||||
#######################################
|
||||
#### Extra Column on Slave Testing ####
|
||||
#######################################
|
||||
# Purpose: To test extra colums on the#
|
||||
# Slave #
|
||||
#######################################
|
||||
|
||||
--echo **** Extra Colums Start ****
|
||||
|
||||
##########################################
|
||||
# More columns in slave at end of table, #
|
||||
# added columns have default values #
|
||||
# Expect: it should work, default values #
|
||||
# should be used #
|
||||
##########################################
|
||||
|
||||
--echo *** Create t7 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
|
||||
e CHAR(20) DEFAULT 'Extra Column Testing')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t7 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
|
||||
--echo *** Select from slave ***
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
|
||||
--echo *** Drop t7 ***
|
||||
connection master;
|
||||
DROP TABLE t7;
|
||||
sync_slave_with_master;
|
||||
|
||||
###########################################
|
||||
# More columns in slave at end of table, #
|
||||
# added columns do not have default values#
|
||||
# Expect: Proper error message #
|
||||
###########################################
|
||||
# NOTE: This should fail but currently #
|
||||
# works. BUG#22101 #
|
||||
###########################################
|
||||
--echo *** Create t8 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
|
||||
e INT)ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t8 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
|
||||
### Uncomment once bug is fixed
|
||||
|
||||
#connection slave;
|
||||
#wait_for_slave_to_stop;
|
||||
#--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
#--query_vertical SHOW SLAVE STATUS
|
||||
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
#START SLAVE;
|
||||
|
||||
--echo *** Drop t8 ***
|
||||
connection master;
|
||||
DROP TABLE t8;
|
||||
sync_slave_with_master;
|
||||
|
||||
###########################################
|
||||
############# Continued ###################
|
||||
# More columns in slave at end of table, #
|
||||
# added columns do not have default values#
|
||||
# Expect: Proper error message #
|
||||
###########################################
|
||||
# Commented out due to Bug #23907 Extra Slave Col is not
|
||||
# erroring on extra col with no default values.
|
||||
########################################################
|
||||
#--echo *** Create t9 on slave ***
|
||||
#STOP SLAVE;
|
||||
#RESET SLAVE;
|
||||
#eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
|
||||
# d TIMESTAMP,
|
||||
# e INT DEFAULT '1')ENGINE=$engine_type;
|
||||
|
||||
#--echo *** Create t9 on Master ***
|
||||
#connection master;
|
||||
#eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
# ) ENGINE=$engine_type;
|
||||
#RESET MASTER;
|
||||
|
||||
#--echo *** Start Slave ***
|
||||
#connection slave;
|
||||
#START SLAVE;
|
||||
|
||||
#--echo *** Master Data Insert ***
|
||||
#connection master;
|
||||
#set @b1 = 'b1b1b1b1';
|
||||
#set @b1 = concat(@b1,@b1);
|
||||
#INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
|
||||
#--echo *************************************************
|
||||
#--echo ** Currently giving wrong error see bug#22234 ***
|
||||
#--echo *************************************************
|
||||
#sync_slave_with_master;
|
||||
#connection slave;
|
||||
|
||||
#--echo *** Select from T9 ***
|
||||
#wait_for_slave_to_stop;
|
||||
#--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
#--query_vertical SHOW SLAVE STATUS
|
||||
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
#START SLAVE;
|
||||
|
||||
#--echo *** Drop t9 ***
|
||||
#connection master;
|
||||
#DROP TABLE t9;
|
||||
#sync_slave_with_master;
|
||||
|
||||
############################################
|
||||
# More columns in slave at middle of table #
|
||||
# Expect: Proper error message #
|
||||
############################################
|
||||
--echo *** Create t10 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
|
||||
c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t10 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1522 ***
|
||||
--echo ********************************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Drop t10 ***
|
||||
connection master;
|
||||
DROP TABLE t10;
|
||||
sync_slave_with_master;
|
||||
|
||||
############################################
|
||||
############## Continued ###################
|
||||
############################################
|
||||
# More columns in slave at middle of table #
|
||||
# Expect: Proper error message #
|
||||
############################################
|
||||
--echo *** Create t11 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t11 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1522 ***
|
||||
--echo ********************************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Drop t11 ***
|
||||
connection master;
|
||||
DROP TABLE t11;
|
||||
sync_slave_with_master;
|
||||
|
||||
############################################
|
||||
############## Continued ###################
|
||||
############################################
|
||||
# More columns in slave at middle of table #
|
||||
# Expect: This one should pass blob-text #
|
||||
############################################
|
||||
--echo *** Create t12 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t12 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t12 ORDER BY a;
|
||||
|
||||
--echo *** Select on Slave ***
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t12 ORDER BY a;
|
||||
|
||||
--echo *** Drop t12 ***
|
||||
connection master;
|
||||
DROP TABLE t12;
|
||||
sync_slave_with_master;
|
||||
|
||||
--echo **** Extra Colums End ****
|
||||
|
||||
###############################
|
||||
# BUG#22177 CURRENT_TIMESTAMP #
|
||||
# Sould work with ^ #
|
||||
###############################
|
||||
--echo *** BUG 22177 Start ***
|
||||
--echo *** Create t13 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d INT DEFAULT '1',
|
||||
e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t13 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t13 ORDER BY a;
|
||||
|
||||
--echo *** Select on Slave ****
|
||||
sync_slave_with_master;
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t13 ORDER BY a;
|
||||
|
||||
--echo *** Drop t13 ***
|
||||
connection master;
|
||||
DROP TABLE t13;
|
||||
sync_slave_with_master;
|
||||
|
||||
--echo *** 22117 END ***
|
||||
|
||||
##############################
|
||||
# ALTER MASTER TABLE TESTING #
|
||||
##############################
|
||||
|
||||
--echo *** Alter Master Table Testing Start ***
|
||||
|
||||
####################################################
|
||||
# - Alter Master adding columns at middle of table #
|
||||
# Expect: columns added #
|
||||
####################################################
|
||||
|
||||
--echo *** Create t14 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t14 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
|
||||
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
|
||||
|
||||
--echo *** Select on Slave ****
|
||||
sync_slave_with_master;
|
||||
--replace_column 7 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
|
||||
|
||||
####################################################
|
||||
# - Alter Master Dropping columns from the middle. #
|
||||
# Expect: columns dropped #
|
||||
####################################################
|
||||
|
||||
--echo *** connect to master and drop columns ***
|
||||
connection master;
|
||||
ALTER TABLE t14 DROP COLUMN c2;
|
||||
ALTER TABLE t14 DROP COLUMN c4;
|
||||
--echo *** Select from Master ***
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
|
||||
--echo *** Select from Slave ***
|
||||
sync_slave_with_master;
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
|
||||
--echo *** Drop t14 ***
|
||||
connection master;
|
||||
DROP TABLE t14;
|
||||
sync_slave_with_master;
|
||||
|
||||
##############################################################
|
||||
# - Alter Master adding columns that already exist on slave. #
|
||||
# Expect: proper error message #
|
||||
##############################################################
|
||||
|
||||
--echo *** Create t15 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t15 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5)) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
|
||||
|
||||
--echo *** Select on Slave ****
|
||||
sync_slave_with_master;
|
||||
--replace_column 7 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
|
||||
--echo *** Add column on master that is a Extra on Slave ***
|
||||
connection master;
|
||||
ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
|
||||
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1060 ***
|
||||
--echo ********************************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Try to insert in master ****
|
||||
connection master;
|
||||
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
|
||||
--echo *** Try to select from slave ****
|
||||
sync_slave_with_master;
|
||||
--replace_column 7 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
|
||||
--echo *** DROP TABLE t15 ***
|
||||
connection master;
|
||||
DROP TABLE t15;
|
||||
sync_slave_with_master;
|
||||
|
||||
####################################
|
||||
# - Alter Master and ADD PARTITION #
|
||||
# Expect:? #
|
||||
####################################
|
||||
|
||||
--echo *** Create t16 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t16 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5))ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t16 ORDER BY c1;
|
||||
|
||||
--echo *** Select on Slave ****
|
||||
sync_slave_with_master;
|
||||
--replace_column 7 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t16 ORDER BY c1;
|
||||
|
||||
--echo *** Add Partition on master ***
|
||||
connection master;
|
||||
ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
|
||||
INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
|
||||
SHOW CREATE TABLE t16;
|
||||
|
||||
--echo *** Show table on Slave ****
|
||||
sync_slave_with_master;
|
||||
SHOW CREATE TABLE t16;
|
||||
|
||||
--echo *** DROP TABLE t16 ***
|
||||
connection master;
|
||||
DROP TABLE t16;
|
||||
sync_slave_with_master;
|
||||
|
||||
--echo *** Alter Master End ***
|
||||
|
||||
############################################
|
||||
### Try to replicate BIGINT to SMALLINT ###
|
||||
### Should Stop Slave ###
|
||||
############################################
|
||||
|
||||
--echo *** Create t17 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t17 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
|
||||
) ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
|
||||
INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
|
||||
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1522 ***
|
||||
--echo ********************************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo ** DROP table t17 ***
|
||||
connection master;
|
||||
DROP TABLE t17;
|
||||
sync_slave_with_master;
|
||||
|
||||
#### Clean Up ####
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17;
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
|
||||
# END 5.1 Test Case
|
||||
|
||||
|
507
mysql-test/extra/rpl_tests/rpl_ndb_ddl.test
Normal file
507
mysql-test/extra/rpl_tests/rpl_ndb_ddl.test
Normal file
|
@ -0,0 +1,507 @@
|
|||
######################## 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
|
||||
|
741
mysql-test/r/rpl_extraCol_innodb.result
Normal file
741
mysql-test/r/rpl_extraCol_innodb.result
Normal file
|
@ -0,0 +1,741 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
**** Diff Table Def Start ****
|
||||
*** On Slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(4) DEFAULT 'TEST')
|
||||
ENGINE='InnoDB';
|
||||
*** Create t1 on Master ***
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b c
|
||||
1 2 TEXAS
|
||||
2 1 AUSTIN
|
||||
3 4 QA
|
||||
*** Select from slave ***
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b c d e
|
||||
1 2 TEXAS 2 TEST
|
||||
2 1 AUSTIN 2 TEST
|
||||
3 4 QA 2 TEST
|
||||
*** Drop t1 ***
|
||||
DROP TABLE t1;
|
||||
*** Create t3 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='InnoDB';
|
||||
*** Create t3 on Master ***
|
||||
CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t3 ***
|
||||
DROP TABLE t3;
|
||||
*** Create t4 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='InnoDB';
|
||||
*** Create t4 on Master ***
|
||||
CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
|
||||
(30000.22,4,'QA TESTING');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t4 ***
|
||||
DROP TABLE t4;
|
||||
*** Create t5 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
|
||||
c FLOAT, d INT, e DOUBLE,
|
||||
f DECIMAL(8,2))ENGINE='InnoDB';
|
||||
*** Create t5 on Master ***
|
||||
CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
|
||||
c DECIMAL(8,2), d BIT, e BLOB,
|
||||
f FLOAT) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
|
||||
(2,'JOE',300.01,0,'b2b2',1.0000009);
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t5 ***
|
||||
DROP TABLE t5;
|
||||
*** Create t6 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
|
||||
c FLOAT, d INT)ENGINE='InnoDB';
|
||||
*** Create t6 on Master ***
|
||||
CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
|
||||
c DECIMAL(8,2), d BIT
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
|
||||
(2,'JOE',300.01,0);
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
|
||||
*** Drop t6 ***
|
||||
DROP TABLE t6;
|
||||
DROP TABLE t6;
|
||||
START SLAVE;
|
||||
**** Diff Table Def End ****
|
||||
**** Extra Colums Start ****
|
||||
*** Create t7 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
|
||||
e CHAR(20) DEFAULT 'Extra Column Testing')
|
||||
ENGINE='InnoDB';
|
||||
*** Create t7 on Master ***
|
||||
CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1 Kyle
|
||||
2 b1b1 JOE
|
||||
3 b1b1 QA
|
||||
*** Select from slave ***
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
a b c d e
|
||||
1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
|
||||
2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
|
||||
3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
|
||||
*** Drop t7 ***
|
||||
DROP TABLE t7;
|
||||
*** Create t8 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
|
||||
e INT)ENGINE='InnoDB';
|
||||
*** Create t8 on Master ***
|
||||
CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
*** Drop t8 ***
|
||||
DROP TABLE t8;
|
||||
*** Create t10 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
|
||||
c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
|
||||
*** Create t10 on Master ***
|
||||
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t10 ***
|
||||
DROP TABLE t10;
|
||||
*** Create t11 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
|
||||
*** Create t11 on Master ***
|
||||
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t11 ***
|
||||
DROP TABLE t11;
|
||||
*** Create t12 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
|
||||
*** Create t12 on Master ***
|
||||
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t12 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ***
|
||||
SELECT * FROM t12 ORDER BY a;
|
||||
a b f c e
|
||||
1 b1b1b1b1b1b1b1b1 Kyle test 1
|
||||
2 b1b1b1b1b1b1b1b1 JOE test 1
|
||||
3 b1b1b1b1b1b1b1b1 QA test 1
|
||||
*** Drop t12 ***
|
||||
DROP TABLE t12;
|
||||
**** Extra Colums End ****
|
||||
*** BUG 22177 Start ***
|
||||
*** Create t13 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d INT DEFAULT '1',
|
||||
e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='InnoDB';
|
||||
*** Create t13 on Master ***
|
||||
CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t13 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t13 ORDER BY a;
|
||||
a b c d e
|
||||
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Drop t13 ***
|
||||
DROP TABLE t13;
|
||||
*** 22117 END ***
|
||||
*** Alter Master Table Testing Start ***
|
||||
*** Create t14 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='InnoDB';
|
||||
*** Create t14 on Master ***
|
||||
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
|
||||
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** connect to master and drop columns ***
|
||||
ALTER TABLE t14 DROP COLUMN c2;
|
||||
ALTER TABLE t14 DROP COLUMN c4;
|
||||
*** Select from Master ***
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c3 c5
|
||||
1 Replication Testing Extra Col Kyle
|
||||
2 This Test Should work JOE
|
||||
3 If is does not, I will open a bug QA
|
||||
*** Select from Slave ***
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c3 c5 c6 c7
|
||||
1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
|
||||
2 This Test Should work JOE 1 CURRENT_TIMESTAMP
|
||||
3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
|
||||
*** Drop t14 ***
|
||||
DROP TABLE t14;
|
||||
*** Create t15 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='InnoDB';
|
||||
*** Create t15 on Master ***
|
||||
CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Add column on master that is a Extra on Slave ***
|
||||
ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1060 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1060
|
||||
Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Try to insert in master ****
|
||||
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
|
||||
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
|
||||
*** Try to select from slave ****
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** DROP TABLE t15 ***
|
||||
DROP TABLE t15;
|
||||
*** Create t16 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='InnoDB';
|
||||
*** Create t16 on Master ***
|
||||
CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5))ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t16 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t16 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Add Partition on master ***
|
||||
ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
|
||||
INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
|
||||
SHOW CREATE TABLE t16;
|
||||
Table Create Table
|
||||
t16 CREATE TABLE `t16` (
|
||||
`c1` int(11) NOT NULL,
|
||||
`c2` decimal(8,2) DEFAULT NULL,
|
||||
`c3` text,
|
||||
`c4` blob,
|
||||
`c5` char(5) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
|
||||
*** Show table on Slave ****
|
||||
SHOW CREATE TABLE t16;
|
||||
Table Create Table
|
||||
t16 CREATE TABLE `t16` (
|
||||
`c1` int(11) NOT NULL,
|
||||
`c2` decimal(8,2) DEFAULT NULL,
|
||||
`c3` text,
|
||||
`c4` blob,
|
||||
`c5` char(5) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT '1',
|
||||
`c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
|
||||
*** DROP TABLE t16 ***
|
||||
DROP TABLE t16;
|
||||
*** Alter Master End ***
|
||||
*** Create t17 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='InnoDB';
|
||||
*** Create t17 on Master ***
|
||||
CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
|
||||
) ENGINE='InnoDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
** DROP table t17 ***
|
||||
DROP TABLE t17;
|
741
mysql-test/r/rpl_extraCol_myisam.result
Normal file
741
mysql-test/r/rpl_extraCol_myisam.result
Normal file
|
@ -0,0 +1,741 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
**** Diff Table Def Start ****
|
||||
*** On Slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(4) DEFAULT 'TEST')
|
||||
ENGINE='MyISAM';
|
||||
*** Create t1 on Master ***
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b c
|
||||
1 2 TEXAS
|
||||
2 1 AUSTIN
|
||||
3 4 QA
|
||||
*** Select from slave ***
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b c d e
|
||||
1 2 TEXAS 2 TEST
|
||||
2 1 AUSTIN 2 TEST
|
||||
3 4 QA 2 TEST
|
||||
*** Drop t1 ***
|
||||
DROP TABLE t1;
|
||||
*** Create t3 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='MyISAM';
|
||||
*** Create t3 on Master ***
|
||||
CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t3 ***
|
||||
DROP TABLE t3;
|
||||
*** Create t4 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='MyISAM';
|
||||
*** Create t4 on Master ***
|
||||
CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
|
||||
(30000.22,4,'QA TESTING');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t4 ***
|
||||
DROP TABLE t4;
|
||||
*** Create t5 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
|
||||
c FLOAT, d INT, e DOUBLE,
|
||||
f DECIMAL(8,2))ENGINE='MyISAM';
|
||||
*** Create t5 on Master ***
|
||||
CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
|
||||
c DECIMAL(8,2), d BIT, e BLOB,
|
||||
f FLOAT) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
|
||||
(2,'JOE',300.01,0,'b2b2',1.0000009);
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t5 ***
|
||||
DROP TABLE t5;
|
||||
*** Create t6 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
|
||||
c FLOAT, d INT)ENGINE='MyISAM';
|
||||
*** Create t6 on Master ***
|
||||
CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
|
||||
c DECIMAL(8,2), d BIT
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
|
||||
(2,'JOE',300.01,0);
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
|
||||
*** Drop t6 ***
|
||||
DROP TABLE t6;
|
||||
DROP TABLE t6;
|
||||
START SLAVE;
|
||||
**** Diff Table Def End ****
|
||||
**** Extra Colums Start ****
|
||||
*** Create t7 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
|
||||
e CHAR(20) DEFAULT 'Extra Column Testing')
|
||||
ENGINE='MyISAM';
|
||||
*** Create t7 on Master ***
|
||||
CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1 Kyle
|
||||
2 b1b1 JOE
|
||||
3 b1b1 QA
|
||||
*** Select from slave ***
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
a b c d e
|
||||
1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
|
||||
2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
|
||||
3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
|
||||
*** Drop t7 ***
|
||||
DROP TABLE t7;
|
||||
*** Create t8 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
|
||||
e INT)ENGINE='MyISAM';
|
||||
*** Create t8 on Master ***
|
||||
CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
*** Drop t8 ***
|
||||
DROP TABLE t8;
|
||||
*** Create t10 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
|
||||
c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
|
||||
*** Create t10 on Master ***
|
||||
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t10 ***
|
||||
DROP TABLE t10;
|
||||
*** Create t11 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
|
||||
*** Create t11 on Master ***
|
||||
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t11 ***
|
||||
DROP TABLE t11;
|
||||
*** Create t12 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
|
||||
*** Create t12 on Master ***
|
||||
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t12 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ***
|
||||
SELECT * FROM t12 ORDER BY a;
|
||||
a b f c e
|
||||
1 b1b1b1b1b1b1b1b1 Kyle test 1
|
||||
2 b1b1b1b1b1b1b1b1 JOE test 1
|
||||
3 b1b1b1b1b1b1b1b1 QA test 1
|
||||
*** Drop t12 ***
|
||||
DROP TABLE t12;
|
||||
**** Extra Colums End ****
|
||||
*** BUG 22177 Start ***
|
||||
*** Create t13 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d INT DEFAULT '1',
|
||||
e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='MyISAM';
|
||||
*** Create t13 on Master ***
|
||||
CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t13 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t13 ORDER BY a;
|
||||
a b c d e
|
||||
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Drop t13 ***
|
||||
DROP TABLE t13;
|
||||
*** 22117 END ***
|
||||
*** Alter Master Table Testing Start ***
|
||||
*** Create t14 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='MyISAM';
|
||||
*** Create t14 on Master ***
|
||||
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
|
||||
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** connect to master and drop columns ***
|
||||
ALTER TABLE t14 DROP COLUMN c2;
|
||||
ALTER TABLE t14 DROP COLUMN c4;
|
||||
*** Select from Master ***
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c3 c5
|
||||
1 Replication Testing Extra Col Kyle
|
||||
2 This Test Should work JOE
|
||||
3 If is does not, I will open a bug QA
|
||||
*** Select from Slave ***
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c3 c5 c6 c7
|
||||
1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
|
||||
2 This Test Should work JOE 1 CURRENT_TIMESTAMP
|
||||
3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
|
||||
*** Drop t14 ***
|
||||
DROP TABLE t14;
|
||||
*** Create t15 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='MyISAM';
|
||||
*** Create t15 on Master ***
|
||||
CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Add column on master that is a Extra on Slave ***
|
||||
ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1060 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1060
|
||||
Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Try to insert in master ****
|
||||
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
|
||||
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
|
||||
*** Try to select from slave ****
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** DROP TABLE t15 ***
|
||||
DROP TABLE t15;
|
||||
*** Create t16 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='MyISAM';
|
||||
*** Create t16 on Master ***
|
||||
CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5))ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t16 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t16 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Add Partition on master ***
|
||||
ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
|
||||
INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
|
||||
SHOW CREATE TABLE t16;
|
||||
Table Create Table
|
||||
t16 CREATE TABLE `t16` (
|
||||
`c1` int(11) NOT NULL,
|
||||
`c2` decimal(8,2) DEFAULT NULL,
|
||||
`c3` text,
|
||||
`c4` blob,
|
||||
`c5` char(5) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
|
||||
*** Show table on Slave ****
|
||||
SHOW CREATE TABLE t16;
|
||||
Table Create Table
|
||||
t16 CREATE TABLE `t16` (
|
||||
`c1` int(11) NOT NULL,
|
||||
`c2` decimal(8,2) DEFAULT NULL,
|
||||
`c3` text,
|
||||
`c4` blob,
|
||||
`c5` char(5) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT '1',
|
||||
`c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
|
||||
*** DROP TABLE t16 ***
|
||||
DROP TABLE t16;
|
||||
*** Alter Master End ***
|
||||
*** Create t17 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='MyISAM';
|
||||
*** Create t17 on Master ***
|
||||
CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
|
||||
) ENGINE='MyISAM';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
** DROP table t17 ***
|
||||
DROP TABLE t17;
|
|
@ -359,8 +359,6 @@ MAX(f1)
|
|||
|
||||
-------- switch to master -------
|
||||
ROLLBACK;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
SELECT MAX(f1) FROM t1;
|
||||
MAX(f1)
|
||||
5
|
||||
|
@ -370,9 +368,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
|
|||
-------- switch to slave --------
|
||||
SELECT MAX(f1) FROM t1;
|
||||
MAX(f1)
|
||||
6
|
||||
5
|
||||
|
||||
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
||||
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
|
||||
|
||||
-------- switch to master -------
|
||||
flush logs;
|
||||
|
@ -401,7 +399,7 @@ MAX(f1)
|
|||
-------- switch to slave --------
|
||||
SELECT MAX(f1) FROM t1;
|
||||
MAX(f1)
|
||||
6
|
||||
5
|
||||
|
||||
-------- switch to master -------
|
||||
RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
|
||||
|
@ -506,7 +504,7 @@ f2 bigint(20) YES NULL
|
|||
|
||||
-------- switch to master -------
|
||||
|
||||
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ########
|
||||
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB" ########
|
||||
|
||||
-------- switch to master -------
|
||||
INSERT INTO t1 SET f1= 7 + 1;
|
||||
|
@ -520,7 +518,7 @@ MAX(f1)
|
|||
7
|
||||
|
||||
-------- switch to master -------
|
||||
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB";
|
||||
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB";
|
||||
SELECT MAX(f1) FROM t1;
|
||||
MAX(f1)
|
||||
8
|
||||
|
@ -579,8 +577,6 @@ MAX(f1)
|
|||
|
||||
-------- switch to master -------
|
||||
ROLLBACK;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
SELECT MAX(f1) FROM t1;
|
||||
MAX(f1)
|
||||
8
|
||||
|
@ -590,9 +586,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
|
|||
-------- switch to slave --------
|
||||
SELECT MAX(f1) FROM t1;
|
||||
MAX(f1)
|
||||
9
|
||||
8
|
||||
|
||||
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
||||
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
|
||||
|
||||
-------- switch to master -------
|
||||
flush logs;
|
||||
|
@ -613,7 +609,7 @@ MAX(f1)
|
|||
-------- switch to slave --------
|
||||
SELECT MAX(f1) FROM t1;
|
||||
MAX(f1)
|
||||
9
|
||||
8
|
||||
|
||||
-------- switch to master -------
|
||||
TRUNCATE TABLE mysqltest1.t7;
|
||||
|
@ -650,11 +646,9 @@ flush logs;
|
|||
-------- switch to master -------
|
||||
SELECT * FROM mysqltest1.t7;
|
||||
f1
|
||||
|
||||
-------- switch to slave --------
|
||||
SELECT * FROM mysqltest1.t7;
|
||||
f1
|
||||
|
||||
-------- switch to master -------
|
||||
|
||||
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
|
||||
|
@ -957,7 +951,7 @@ t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
|
|||
-------- switch to slave --------
|
||||
SHOW INDEX FROM mysqltest1.t5;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t5 1 my_idx5 1 f1 A NULL NULL NULL YES BTREE
|
||||
t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
|
||||
|
||||
-------- switch to master -------
|
||||
|
||||
|
@ -1691,3 +1685,4 @@ user
|
|||
DROP DATABASE IF EXISTS mysqltest1;
|
||||
DROP DATABASE IF EXISTS mysqltest2;
|
||||
DROP DATABASE IF EXISTS mysqltest3;
|
||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||
|
|
742
mysql-test/r/rpl_ndb_extraCol.result
Normal file
742
mysql-test/r/rpl_ndb_extraCol.result
Normal file
|
@ -0,0 +1,742 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
**** Diff Table Def Start ****
|
||||
*** On Slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(4) DEFAULT 'TEST')
|
||||
ENGINE='NDB';
|
||||
*** Create t1 on Master ***
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b c
|
||||
1 2 TEXAS
|
||||
2 1 AUSTIN
|
||||
3 4 QA
|
||||
*** Select from slave ***
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b c d e
|
||||
1 2 TEXAS 2 TEST
|
||||
2 1 AUSTIN 2 TEST
|
||||
3 4 QA 2 TEST
|
||||
*** Drop t1 ***
|
||||
DROP TABLE t1;
|
||||
*** Create t3 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='NDB';
|
||||
*** Create t3 on Master ***
|
||||
CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t3 ***
|
||||
DROP TABLE t3;
|
||||
*** Create t4 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='NDB';
|
||||
*** Create t4 on Master ***
|
||||
CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
|
||||
(30000.22,4,'QA TESTING');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t4 ***
|
||||
DROP TABLE t4;
|
||||
*** Create t5 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
|
||||
c FLOAT, d INT, e DOUBLE,
|
||||
f DECIMAL(8,2))ENGINE='NDB';
|
||||
*** Create t5 on Master ***
|
||||
CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
|
||||
c DECIMAL(8,2), d BIT, e BLOB,
|
||||
f FLOAT) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
|
||||
(2,'JOE',300.01,0,'b2b2',1.0000009);
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t5 ***
|
||||
DROP TABLE t5;
|
||||
*** Create t6 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
|
||||
c FLOAT, d INT)ENGINE='NDB';
|
||||
*** Create t6 on Master ***
|
||||
CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
|
||||
c DECIMAL(8,2), d BIT
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
|
||||
(2,'JOE',300.01,0);
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
|
||||
*** Drop t6 ***
|
||||
DROP TABLE t6;
|
||||
DROP TABLE t6;
|
||||
START SLAVE;
|
||||
**** Diff Table Def End ****
|
||||
**** Extra Colums Start ****
|
||||
*** Create t7 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
|
||||
e CHAR(20) DEFAULT 'Extra Column Testing')
|
||||
ENGINE='NDB';
|
||||
*** Create t7 on Master ***
|
||||
CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1 Kyle
|
||||
2 b1b1 JOE
|
||||
3 b1b1 QA
|
||||
*** Select from slave ***
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
a b c d e
|
||||
1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
|
||||
2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
|
||||
3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
|
||||
*** Drop t7 ***
|
||||
DROP TABLE t7;
|
||||
*** Create t8 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
|
||||
e INT)ENGINE='NDB';
|
||||
*** Create t8 on Master ***
|
||||
CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
*** Drop t8 ***
|
||||
DROP TABLE t8;
|
||||
*** Create t10 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
|
||||
c CHAR(5), e INT DEFAULT '1')ENGINE='NDB';
|
||||
*** Create t10 on Master ***
|
||||
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t10 ***
|
||||
DROP TABLE t10;
|
||||
*** Create t11 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB';
|
||||
*** Create t11 on Master ***
|
||||
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Drop t11 ***
|
||||
DROP TABLE t11;
|
||||
*** Create t12 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB';
|
||||
*** Create t12 on Master ***
|
||||
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t12 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ***
|
||||
SELECT * FROM t12 ORDER BY a;
|
||||
a b f c e
|
||||
1 b1b1b1b1b1b1b1b1 Kyle test 1
|
||||
2 b1b1b1b1b1b1b1b1 JOE test 1
|
||||
3 b1b1b1b1b1b1b1b1 QA test 1
|
||||
*** Drop t12 ***
|
||||
DROP TABLE t12;
|
||||
**** Extra Colums End ****
|
||||
*** BUG 22177 Start ***
|
||||
*** Create t13 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
|
||||
d INT DEFAULT '1',
|
||||
e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='NDB';
|
||||
*** Create t13 on Master ***
|
||||
CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
SELECT * FROM t13 ORDER BY a;
|
||||
a b c
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t13 ORDER BY a;
|
||||
a b c d e
|
||||
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Drop t13 ***
|
||||
DROP TABLE t13;
|
||||
*** 22117 END ***
|
||||
*** Alter Master Table Testing Start ***
|
||||
*** Create t14 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='NDB';
|
||||
*** Create t14 on Master ***
|
||||
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
|
||||
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** connect to master and drop columns ***
|
||||
ALTER TABLE t14 DROP COLUMN c2;
|
||||
ALTER TABLE t14 DROP COLUMN c4;
|
||||
*** Select from Master ***
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c3 c5
|
||||
1 Replication Testing Extra Col Kyle
|
||||
2 This Test Should work JOE
|
||||
3 If is does not, I will open a bug QA
|
||||
*** Select from Slave ***
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
c1 c3 c5 c6 c7
|
||||
1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
|
||||
2 This Test Should work JOE 1 CURRENT_TIMESTAMP
|
||||
3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
|
||||
*** Drop t14 ***
|
||||
DROP TABLE t14;
|
||||
*** Create t15 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='NDB';
|
||||
*** Create t15 on Master ***
|
||||
CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5)) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Add column on master that is a Extra on Slave ***
|
||||
ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1060 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1060
|
||||
Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
*** Try to insert in master ****
|
||||
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
|
||||
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
|
||||
*** Try to select from slave ****
|
||||
SELECT * FROM t15 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
|
||||
*** DROP TABLE t15 ***
|
||||
DROP TABLE t15;
|
||||
*** Create t16 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='NDB';
|
||||
*** Create t16 on Master ***
|
||||
CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
|
||||
c4 BLOB, c5 CHAR(5))ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE'),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA');
|
||||
SELECT * FROM t16 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t16 ORDER BY c1;
|
||||
c1 c2 c3 c4 c5 c6 c7
|
||||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
*** Add Partition on master ***
|
||||
ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
|
||||
INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
|
||||
SHOW CREATE TABLE t16;
|
||||
Table Create Table
|
||||
t16 CREATE TABLE `t16` (
|
||||
`c1` int(11) NOT NULL,
|
||||
`c2` decimal(8,2) DEFAULT NULL,
|
||||
`c3` text,
|
||||
`c4` blob,
|
||||
`c5` char(5) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
|
||||
*** Show table on Slave ****
|
||||
SHOW CREATE TABLE t16;
|
||||
Table Create Table
|
||||
t16 CREATE TABLE `t16` (
|
||||
`c1` int(11) NOT NULL,
|
||||
`c2` decimal(8,2) DEFAULT NULL,
|
||||
`c3` text,
|
||||
`c4` blob,
|
||||
`c5` char(5) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT '1',
|
||||
`c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
|
||||
*** DROP TABLE t16 ***
|
||||
DROP TABLE t16;
|
||||
*** Alter Master End ***
|
||||
*** Create t17 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
|
||||
d FLOAT DEFAULT '2.00',
|
||||
e CHAR(5) DEFAULT 'TEST2')
|
||||
ENGINE='NDB';
|
||||
*** Create t17 on Master ***
|
||||
CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
|
||||
) ENGINE='NDB';
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
|
||||
********************************************
|
||||
*** Expect slave to fail with Error 1522 ***
|
||||
********************************************
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1522
|
||||
Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
** DROP table t17 ***
|
||||
DROP TABLE t17;
|
|
@ -29,7 +29,7 @@ rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not r
|
|||
rpl_ndb_2myisam : BUG#19227 Seems to pass currently
|
||||
#rpl_ndb_commit_afterflush : BUG#19328 2006-05-04 tomas Slave timeout with COM_REGISTER_SLAVE error causing stop
|
||||
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_ndb_ddl : BUG#18946 result file needs update + test needs to checked
|
||||
rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
|
||||
#rpl_ndb_log : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
|
||||
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
|
||||
|
|
1
mysql-test/t/rpl_extraCol_innodb-master.opt
Normal file
1
mysql-test/t/rpl_extraCol_innodb-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--innodb
|
1
mysql-test/t/rpl_extraCol_innodb-slave.opt
Normal file
1
mysql-test/t/rpl_extraCol_innodb-slave.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--innodb
|
13
mysql-test/t/rpl_extraCol_innodb.test
Normal file
13
mysql-test/t/rpl_extraCol_innodb.test
Normal file
|
@ -0,0 +1,13 @@
|
|||
###########################################
|
||||
# Author: Jeb
|
||||
# Date: 2006-09-08
|
||||
# Purpose: Wapper for rpl_extraSlave_Col.test
|
||||
# Using innodb
|
||||
###########################################
|
||||
-- source include/have_binlog_format_row.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/master-slave.inc
|
||||
let $engine_type = 'InnoDB';
|
||||
-- source extra/rpl_tests/rpl_extraSlave_Col.test
|
||||
|
||||
|
12
mysql-test/t/rpl_extraCol_myisam.test
Normal file
12
mysql-test/t/rpl_extraCol_myisam.test
Normal file
|
@ -0,0 +1,12 @@
|
|||
###########################################
|
||||
# Author: Jeb
|
||||
# Date: 2006-09-07
|
||||
# Purpose: Wapper for rpl_extraSlave_Col.test
|
||||
# Using MyISAM
|
||||
###########################################
|
||||
-- source include/have_binlog_format_row.inc
|
||||
-- source include/master-slave.inc
|
||||
let $engine_type = 'MyISAM';
|
||||
-- source extra/rpl_tests/rpl_extraSlave_Col.test
|
||||
|
||||
|
|
@ -31,4 +31,5 @@
|
|||
--source include/have_ndb.inc
|
||||
--source include/master-slave.inc
|
||||
let $engine_type= "NDB";
|
||||
-- source extra/rpl_tests/rpl_ddl.test
|
||||
-- source extra/rpl_tests/rpl_ndb_ddl.test
|
||||
|
||||
|
|
13
mysql-test/t/rpl_ndb_extraCol.test
Normal file
13
mysql-test/t/rpl_ndb_extraCol.test
Normal file
|
@ -0,0 +1,13 @@
|
|||
###########################################
|
||||
# Author: Jeb
|
||||
# Date: 2006-09-08
|
||||
# Purpose: Wapper for rpl_extraSlave_Col.test
|
||||
# Using NDB
|
||||
###########################################
|
||||
-- source include/have_binlog_format_row.inc
|
||||
--source include/have_ndb.inc
|
||||
-- source include/master-slave.inc
|
||||
let $engine_type = 'NDB';
|
||||
-- source extra/rpl_tests/rpl_extraSlave_Col.test
|
||||
|
||||
|
Loading…
Reference in a new issue