mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
Many files:
Added new test case for dropping column on the end of master table mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: Added new test case for dropping column on the end of master table mysql-test/r/rpl_extraCol_innodb.result: Added new test case for dropping column on the end of master table mysql-test/r/rpl_extraCol_myisam.result: Added new test case for dropping column on the end of master table mysql-test/r/rpl_ndb_extraCol.result: Added new test case for dropping column on the end of master table
This commit is contained in:
parent
6a2ef78c89
commit
42886677ca
4 changed files with 244 additions and 2 deletions
|
@ -10,7 +10,7 @@
|
|||
########### 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;
|
||||
DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
|
||||
|
@ -653,6 +653,68 @@ sync_slave_with_master;
|
|||
--replace_column 7 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t14 ORDER BY c1;
|
||||
|
||||
####################################################
|
||||
# - Alter Master drop column at end of table #
|
||||
# Expect: column dropped #
|
||||
####################################################
|
||||
|
||||
--echo *** Create t14a on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
--echo *** Create t14a on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t14a (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;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14a () VALUES(1,@b1,'Kyle'),
|
||||
(2,@b1,'JOE'),
|
||||
(3,@b1,'QA');
|
||||
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
--echo *** Select on Slave ****
|
||||
sync_slave_with_master;
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
|
||||
--echo *** Master Drop c5 ***
|
||||
connection master;
|
||||
ALTER TABLE t14a DROP COLUMN c5;
|
||||
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 t14a () VALUES(4,@b1),
|
||||
(5,@b1),
|
||||
(6,@b1);
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
|
||||
--echo *** Select on Slave ****
|
||||
sync_slave_with_master;
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
|
||||
####################################################
|
||||
# - Alter Master Dropping columns from the middle. #
|
||||
|
@ -847,7 +909,7 @@ 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;
|
||||
DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
|
||||
|
|
|
@ -548,6 +548,66 @@ 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
|
||||
*** Create t14a on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='InnoDB';
|
||||
*** Create t14a on Master ***
|
||||
CREATE TABLE t14a (c1 INT PRIMARY KEY, 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 t14a () VALUES(1,@b1,'Kyle'),
|
||||
(2,@b1,'JOE'),
|
||||
(3,@b1,'QA');
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5 c6 c7
|
||||
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
*** Master Drop c5 ***
|
||||
ALTER TABLE t14a DROP COLUMN c5;
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14a () VALUES(4,@b1),
|
||||
(5,@b1),
|
||||
(6,@b1);
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4
|
||||
1 b1b1b1b1b1b1b1b1
|
||||
2 b1b1b1b1b1b1b1b1
|
||||
3 b1b1b1b1b1b1b1b1
|
||||
4 b1b1b1b1b1b1b1b1
|
||||
5 b1b1b1b1b1b1b1b1
|
||||
6 b1b1b1b1b1b1b1b1
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5 c6 c7
|
||||
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
|
||||
5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
|
||||
6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
|
||||
*** connect to master and drop columns ***
|
||||
ALTER TABLE t14 DROP COLUMN c2;
|
||||
ALTER TABLE t14 DROP COLUMN c4;
|
||||
|
|
|
@ -548,6 +548,66 @@ 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
|
||||
*** Create t14a on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='MyISAM';
|
||||
*** Create t14a on Master ***
|
||||
CREATE TABLE t14a (c1 INT PRIMARY KEY, 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 t14a () VALUES(1,@b1,'Kyle'),
|
||||
(2,@b1,'JOE'),
|
||||
(3,@b1,'QA');
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5 c6 c7
|
||||
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
*** Master Drop c5 ***
|
||||
ALTER TABLE t14a DROP COLUMN c5;
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14a () VALUES(4,@b1),
|
||||
(5,@b1),
|
||||
(6,@b1);
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4
|
||||
1 b1b1b1b1b1b1b1b1
|
||||
2 b1b1b1b1b1b1b1b1
|
||||
3 b1b1b1b1b1b1b1b1
|
||||
4 b1b1b1b1b1b1b1b1
|
||||
5 b1b1b1b1b1b1b1b1
|
||||
6 b1b1b1b1b1b1b1b1
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5 c6 c7
|
||||
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
|
||||
4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
|
||||
5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
|
||||
6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
|
||||
*** connect to master and drop columns ***
|
||||
ALTER TABLE t14 DROP COLUMN c2;
|
||||
ALTER TABLE t14 DROP COLUMN c4;
|
||||
|
|
|
@ -548,6 +548,66 @@ c1 c2 c3 c4 c5 c6 c7
|
|||
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
|
||||
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
|
||||
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
|
||||
*** Create t14a on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE='NDB';
|
||||
*** Create t14a on Master ***
|
||||
CREATE TABLE t14a (c1 INT PRIMARY KEY, 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 t14a () VALUES(1,@b1,'Kyle'),
|
||||
(2,@b1,'JOE'),
|
||||
(3,@b1,'QA');
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5
|
||||
1 b1b1b1b1b1b1b1b1 Kyle
|
||||
2 b1b1b1b1b1b1b1b1 JOE
|
||||
3 b1b1b1b1b1b1b1b1 QA
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5 c6 c7
|
||||
1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
*** Master Drop c5 ***
|
||||
ALTER TABLE t14a DROP COLUMN c5;
|
||||
RESET MASTER;
|
||||
*** Start Slave ***
|
||||
START SLAVE;
|
||||
*** Master Data Insert ***
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14a () VALUES(4,@b1),
|
||||
(5,@b1),
|
||||
(6,@b1);
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4
|
||||
1 b1b1b1b1b1b1b1b1
|
||||
2 b1b1b1b1b1b1b1b1
|
||||
3 b1b1b1b1b1b1b1b1
|
||||
4 b1b1b1b1b1b1b1b1
|
||||
5 b1b1b1b1b1b1b1b1
|
||||
6 b1b1b1b1b1b1b1b1
|
||||
*** Select on Slave ****
|
||||
SELECT * FROM t14a ORDER BY c1;
|
||||
c1 c4 c5 c6 c7
|
||||
1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
|
||||
2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
|
||||
3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
|
||||
4 b1b1b1b1b1b1b1b1 NULL NULL CURRENT_TIMESTAMP
|
||||
5 b1b1b1b1b1b1b1b1 NULL NULL CURRENT_TIMESTAMP
|
||||
6 b1b1b1b1b1b1b1b1 NULL NULL CURRENT_TIMESTAMP
|
||||
*** connect to master and drop columns ***
|
||||
ALTER TABLE t14 DROP COLUMN c2;
|
||||
ALTER TABLE t14 DROP COLUMN c4;
|
||||
|
|
Loading…
Add table
Reference in a new issue