Loading mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test 0 → 100644 +343 −0 Original line number Diff line number Diff line ####################################### # Author: JBM # # Date: 2006-02-23 # # Purpose: See if replication between # # NDB -> MyISAM and InnoDB works. # # and if # # MyISAM and InnoDB -> NDB works. # ####################################### # By JBM # # Date 2006-02-28 # # Change: Implemented review comments # ####################################### --echo --- Doing pre test cleanup --- connection master; --disable_warnings DROP TABLE IF EXISTS t1; --enable_query_log --echo --- Start test 1 Basic testing --- --echo --- Create Table Section --- ################################################# # Requirment: Create basic table, replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE,PRIMARY KEY(id)); --echo --- Show table on master --- SHOW CREATE TABLE t1; --echo --- Show table on slave --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc # Okay lets see how it holds up to table changes --echo --- Check that simple Alter statements are replicated correctly -- ALTER TABLE t1 MODIFY vc TEXT; ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- End test 1 Basic testing --- --echo --- Do Cleanup -- DROP TABLE IF EXISTS t1; ################################################################# --echo --- Start test 2 partition RANGE testing -- --echo --- Do setup -- ################################################# # Requirment: Create table that is partitioned # # by range on year i.e. year(t) and replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE) PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901), PARTITION p1 VALUES LESS THAN (1946), PARTITION p2 VALUES LESS THAN (1966), PARTITION p3 VALUES LESS THAN (1986), PARTITION p4 VALUES LESS THAN (2005), PARTITION p5 VALUES LESS THAN MAXVALUE); --echo --- Show table on master --- SHOW CREATE TABLE t1; --echo --- Show table on slave -- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 MODIFY vc TEXT; --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --enable_query_log --source include/rpl_multi_engine3.inc --echo --- End test 2 partition RANGE testing --- --echo --- Do Cleanup --- DROP TABLE IF EXISTS t1; ######################################################## --echo --- Start test 3 partition LIST testing --- --echo --- Do setup --- ################################################# # Requirment: Create table that is partitioned # # by list on id i.e. (2,4). Pretend that we # # missed one and alter to add. Then replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE) PARTITION BY LIST(id) (PARTITION p0 VALUES IN (2, 4), PARTITION p1 VALUES IN (42, 142)); --echo --- Test 3 Alter to add partition --- ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412)); --echo --- Show table on master --- SHOW CREATE TABLE t1; --echo --- Show table on slave --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 MODIFY vc TEXT; --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- End test 3 partition LIST testing --- --echo --- Do Cleanup -- DROP TABLE IF EXISTS t1; ######################################################## --echo --- Start test 4 partition HASH testing --- --echo --- Do setup --- ################################################# # Requirment: Create table that is partitioned # # by hash on year i.e. YEAR(t). Then replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE) PARTITION BY HASH( YEAR(t) ) PARTITIONS 4; --echo --- show that tables have been created correctly --- SHOW CREATE TABLE t1; sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 MODIFY vc TEXT; --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- End test 4 partition HASH testing --- --echo --- Do Cleanup -- DROP TABLE IF EXISTS t1; ######################################################## --echo --- Start test 5 partition by key testing --- --echo --- Create Table Section --- ################################################# # Requirment: Create table that is partitioned # # by key on id with 4 parts. Then replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE,PRIMARY KEY(id)) PARTITION BY KEY() PARTITIONS 4; --echo --- Show that tables on master are ndbcluster tables --- SHOW CREATE TABLE t1; --echo --- Show that tables on slave --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc # Okay lets see how it holds up to table changes --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still right type --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 MODIFY vc TEXT; --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- End test 5 key partition testing --- --echo --- Do Cleanup --- DROP TABLE IF EXISTS t1; # End of 5.1 test case mysql-test/include/rpl_multi_engine3.inc 0 → 100644 +62 −0 Original line number Diff line number Diff line ############################################################# # Author: JBM # Date: 2006-02-23 # Purpose: To reuse through out test and make maint easier ############################################################# connection master; --echo "--- Insert into t1 --" as ""; --disable_query_log INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"1905-11-14"); INSERT INTO t1 VALUES(2,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"1965-11-14"); INSERT INTO t1 VALUES(4,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"1985-11-14"); INSERT INTO t1 VALUES(142,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"1995-11-14"); INSERT INTO t1 VALUES(412,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"2005-11-14"); --enable_query_log --echo --- Select from t1 on master --- select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; sync_slave_with_master; --echo --- Select from t1 on slave --- select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; connection master; --echo --- Update t1 on master -- UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; --echo --- Check the update on master --- SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; # Must give injector thread a little time to get update # into the binlog other wise we will miss the update. sleep 3; sync_slave_with_master; --echo --- Check Update on slave --- SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; connection master; --echo --- Remove a record from t1 on master --- DELETE FROM t1 WHERE id = 42; --echo --- Show current count on master for t1 --- SELECT COUNT(*) FROM t1; sync_slave_with_master; --echo --- Show current count on slave for t1 --- SELECT COUNT(*) FROM t1; connection master; DELETE FROM t1; mysql-test/r/events.result +48 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,54 @@ alter event event3 rename to event2; drop event event2; create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end; drop event event2; CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost RECURRING NULL 10 SECOND # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 0 1 ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02'; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 1 1 ALTER EVENT event_starts_test COMMENT "non-empty comment"; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 1 1 non-empty comment ALTER EVENT event_starts_test COMMENT ""; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 1 1 DROP EVENT event_starts_test; CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost RECURRING NULL 20 SECOND # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 0 0 ALTER EVENT event_starts_test COMMENT "non-empty comment"; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost RECURRING NULL 20 SECOND # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 0 0 non-empty comment ALTER EVENT event_starts_test COMMENT ""; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost RECURRING NULL 20 SECOND # # ENABLED DROP EVENT event_starts_test; create event e_43 on schedule every 1 second do set @a = 5; set global event_scheduler = 1; alter event e_43 do alter event e_43 do set @a = 4; Loading mysql-test/t/disabled.def +4 −0 Original line number Diff line number Diff line Loading @@ -22,12 +22,16 @@ partition_03ndb : Bug#16385 ps_7ndb : dbug assert in RBR mode when executing test suite rpl_bit_npk : Bug#13418 rpl_ddl : Bug#15963 SBR does not show "Definer" correctly rpl_ndb_2innodb : Bugs#17400, 17687, 17701 rpl_ndb_2myisam : Bugs#17400, 17687, 17701 rpl_ndb_auto_inc : Bug#17086 rpl_ndb_basic : Bug#16228 [IN REVIEW] rpl_ndb_charset : Bug#17246 rpl_ndb_ddl : Bug#17400: delete & update of rows in table without pk fails rpl_ndb_delete_nowhere : Bug#17400: delete & update of rows in table without pk fails rpl_ndb_innodb2ndb : Bugs#17400, 17687, 17701 rpl_ndb_insert_ignore : Bugs: #17431: INSERT IGNORE INTO returns failed: 1296 rpl_ndb_myisam2ndb : Bugs#17400, 17687, 17701 rpl_ndb_log : result not deterministic rpl_ndb_relay_space : Bug#16993 rpl_ndb_multi_update3 : Bug#17400: delete & update of rows in table without pk fails Loading mysql-test/t/events.test +32 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,38 @@ drop event event2; create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end; drop event event2; # BUG #16537 (Events: mysql.event.starts is null) CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02'; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT "non-empty comment"; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT ""; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; DROP EVENT event_starts_test; CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT "non-empty comment"; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT ""; --replace_column 8 # 9 # SHOW EVENTS; DROP EVENT event_starts_test; # # create event e_43 on schedule every 1 second do set @a = 5; set global event_scheduler = 1; --sleep 2 Loading Loading
mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test 0 → 100644 +343 −0 Original line number Diff line number Diff line ####################################### # Author: JBM # # Date: 2006-02-23 # # Purpose: See if replication between # # NDB -> MyISAM and InnoDB works. # # and if # # MyISAM and InnoDB -> NDB works. # ####################################### # By JBM # # Date 2006-02-28 # # Change: Implemented review comments # ####################################### --echo --- Doing pre test cleanup --- connection master; --disable_warnings DROP TABLE IF EXISTS t1; --enable_query_log --echo --- Start test 1 Basic testing --- --echo --- Create Table Section --- ################################################# # Requirment: Create basic table, replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE,PRIMARY KEY(id)); --echo --- Show table on master --- SHOW CREATE TABLE t1; --echo --- Show table on slave --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc # Okay lets see how it holds up to table changes --echo --- Check that simple Alter statements are replicated correctly -- ALTER TABLE t1 MODIFY vc TEXT; ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- End test 1 Basic testing --- --echo --- Do Cleanup -- DROP TABLE IF EXISTS t1; ################################################################# --echo --- Start test 2 partition RANGE testing -- --echo --- Do setup -- ################################################# # Requirment: Create table that is partitioned # # by range on year i.e. year(t) and replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE) PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901), PARTITION p1 VALUES LESS THAN (1946), PARTITION p2 VALUES LESS THAN (1966), PARTITION p3 VALUES LESS THAN (1986), PARTITION p4 VALUES LESS THAN (2005), PARTITION p5 VALUES LESS THAN MAXVALUE); --echo --- Show table on master --- SHOW CREATE TABLE t1; --echo --- Show table on slave -- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 MODIFY vc TEXT; --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --enable_query_log --source include/rpl_multi_engine3.inc --echo --- End test 2 partition RANGE testing --- --echo --- Do Cleanup --- DROP TABLE IF EXISTS t1; ######################################################## --echo --- Start test 3 partition LIST testing --- --echo --- Do setup --- ################################################# # Requirment: Create table that is partitioned # # by list on id i.e. (2,4). Pretend that we # # missed one and alter to add. Then replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE) PARTITION BY LIST(id) (PARTITION p0 VALUES IN (2, 4), PARTITION p1 VALUES IN (42, 142)); --echo --- Test 3 Alter to add partition --- ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412)); --echo --- Show table on master --- SHOW CREATE TABLE t1; --echo --- Show table on slave --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 MODIFY vc TEXT; --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- End test 3 partition LIST testing --- --echo --- Do Cleanup -- DROP TABLE IF EXISTS t1; ######################################################## --echo --- Start test 4 partition HASH testing --- --echo --- Do setup --- ################################################# # Requirment: Create table that is partitioned # # by hash on year i.e. YEAR(t). Then replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE) PARTITION BY HASH( YEAR(t) ) PARTITIONS 4; --echo --- show that tables have been created correctly --- SHOW CREATE TABLE t1; sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 MODIFY vc TEXT; --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- End test 4 partition HASH testing --- --echo --- Do Cleanup -- DROP TABLE IF EXISTS t1; ######################################################## --echo --- Start test 5 partition by key testing --- --echo --- Create Table Section --- ################################################# # Requirment: Create table that is partitioned # # by key on id with 4 parts. Then replicate # # basice operations such at insert, update # # delete between 2 different storage engines # # Alter table and ensure table is handled # # Correctly on the slave # ################################################# CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t DATE,PRIMARY KEY(id)) PARTITION BY KEY() PARTITIONS 4; --echo --- Show that tables on master are ndbcluster tables --- SHOW CREATE TABLE t1; --echo --- Show that tables on slave --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc # Okay lets see how it holds up to table changes --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still right type --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- Check that simple Alter statements are replicated correctly --- ALTER TABLE t1 MODIFY vc TEXT; --echo --- Show the new improved table on the master --- SHOW CREATE TABLE t1; --echo --- Make sure that our tables on slave are still same engine --- --echo --- and that the alter statements replicated correctly --- sync_slave_with_master; SHOW CREATE TABLE t1; --echo --- Perform basic operation on master --- --echo --- and ensure replicated correctly --- --source include/rpl_multi_engine3.inc --echo --- End test 5 key partition testing --- --echo --- Do Cleanup --- DROP TABLE IF EXISTS t1; # End of 5.1 test case
mysql-test/include/rpl_multi_engine3.inc 0 → 100644 +62 −0 Original line number Diff line number Diff line ############################################################# # Author: JBM # Date: 2006-02-23 # Purpose: To reuse through out test and make maint easier ############################################################# connection master; --echo "--- Insert into t1 --" as ""; --disable_query_log INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"1905-11-14"); INSERT INTO t1 VALUES(2,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"1965-11-14"); INSERT INTO t1 VALUES(4,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"1985-11-14"); INSERT INTO t1 VALUES(142,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"1995-11-14"); INSERT INTO t1 VALUES(412,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer', 654321.4321,15.21,0,1965,"2005-11-14"); --enable_query_log --echo --- Select from t1 on master --- select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; sync_slave_with_master; --echo --- Select from t1 on slave --- select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; connection master; --echo --- Update t1 on master -- UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; --echo --- Check the update on master --- SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; # Must give injector thread a little time to get update # into the binlog other wise we will miss the update. sleep 3; sync_slave_with_master; --echo --- Check Update on slave --- SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; connection master; --echo --- Remove a record from t1 on master --- DELETE FROM t1 WHERE id = 42; --echo --- Show current count on master for t1 --- SELECT COUNT(*) FROM t1; sync_slave_with_master; --echo --- Show current count on slave for t1 --- SELECT COUNT(*) FROM t1; connection master; DELETE FROM t1;
mysql-test/r/events.result +48 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,54 @@ alter event event3 rename to event2; drop event event2; create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end; drop event event2; CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost RECURRING NULL 10 SECOND # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 0 1 ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02'; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 1 1 ALTER EVENT event_starts_test COMMENT "non-empty comment"; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 1 1 non-empty comment ALTER EVENT event_starts_test COMMENT ""; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 1 1 DROP EVENT event_starts_test; CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost RECURRING NULL 20 SECOND # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 0 0 ALTER EVENT event_starts_test COMMENT "non-empty comment"; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost RECURRING NULL 20 SECOND # # ENABLED SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; starts IS NULL ends IS NULL comment 0 0 non-empty comment ALTER EVENT event_starts_test COMMENT ""; SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test event_starts_test root@localhost RECURRING NULL 20 SECOND # # ENABLED DROP EVENT event_starts_test; create event e_43 on schedule every 1 second do set @a = 5; set global event_scheduler = 1; alter event e_43 do alter event e_43 do set @a = 4; Loading
mysql-test/t/disabled.def +4 −0 Original line number Diff line number Diff line Loading @@ -22,12 +22,16 @@ partition_03ndb : Bug#16385 ps_7ndb : dbug assert in RBR mode when executing test suite rpl_bit_npk : Bug#13418 rpl_ddl : Bug#15963 SBR does not show "Definer" correctly rpl_ndb_2innodb : Bugs#17400, 17687, 17701 rpl_ndb_2myisam : Bugs#17400, 17687, 17701 rpl_ndb_auto_inc : Bug#17086 rpl_ndb_basic : Bug#16228 [IN REVIEW] rpl_ndb_charset : Bug#17246 rpl_ndb_ddl : Bug#17400: delete & update of rows in table without pk fails rpl_ndb_delete_nowhere : Bug#17400: delete & update of rows in table without pk fails rpl_ndb_innodb2ndb : Bugs#17400, 17687, 17701 rpl_ndb_insert_ignore : Bugs: #17431: INSERT IGNORE INTO returns failed: 1296 rpl_ndb_myisam2ndb : Bugs#17400, 17687, 17701 rpl_ndb_log : result not deterministic rpl_ndb_relay_space : Bug#16993 rpl_ndb_multi_update3 : Bug#17400: delete & update of rows in table without pk fails Loading
mysql-test/t/events.test +32 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,38 @@ drop event event2; create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end; drop event event2; # BUG #16537 (Events: mysql.event.starts is null) CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02'; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT "non-empty comment"; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT ""; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; DROP EVENT event_starts_test; CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT "non-empty comment"; --replace_column 8 # 9 # SHOW EVENTS; SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT ""; --replace_column 8 # 9 # SHOW EVENTS; DROP EVENT event_starts_test; # # create event e_43 on schedule every 1 second do set @a = 5; set global event_scheduler = 1; --sleep 2 Loading