Bug#32648 Test failure between NDB Cluster and other engines

parent c9ecf312
...@@ -831,6 +831,7 @@ our @tags= ...@@ -831,6 +831,7 @@ our @tags=
["include/have_ndb.inc", "ndb_test", 1], ["include/have_ndb.inc", "ndb_test", 1],
["include/have_multi_ndb.inc", "ndb_test", 1], ["include/have_multi_ndb.inc", "ndb_test", 1],
["include/have_ndb_extra.inc", "ndb_extra", 1], ["include/have_ndb_extra.inc", "ndb_extra", 1],
["include/ndb_master-slave.inc", "ndb_test", 1],
["require_manager", "require_manager", 1], ["require_manager", "require_manager", 1],
); );
......
...@@ -15,3 +15,6 @@ ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t ...@@ -15,3 +15,6 @@ ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_autodiscover3 : bug#21806 #ndb_autodiscover3 : bug#21806
#ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages #ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages
#rpl_ndb_extraColMaster : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris
#rpl_ndb_mix_innodb : Bug #32720 Test rpl_ndb_mix_innodb fails on SPARC and PowerPC
#rpl_ndb_dd_advance : Bug #30222 rpl_ndb_dd_advance.test fails
...@@ -4,7 +4,13 @@ reset master; ...@@ -4,7 +4,13 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
SET storage_engine=ndb; CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=INNODB;
--- Doing pre test cleanup --- --- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--- Start test 1 Basic testing --- --- Start test 1 Basic testing ---
...@@ -27,7 +33,7 @@ t1 CREATE TABLE `t1` ( ...@@ -27,7 +33,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Show table on slave --- --- Show table on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -100,7 +106,7 @@ t1 CREATE TABLE `t1` ( ...@@ -100,7 +106,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -186,7 +192,7 @@ t1 CREATE TABLE `t1` ( ...@@ -186,7 +192,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Show table on slave -- --- Show table on slave --
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -200,7 +206,7 @@ t1 CREATE TABLE `t1` ( ...@@ -200,7 +206,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -258,7 +264,7 @@ t1 CREATE TABLE `t1` ( ...@@ -258,7 +264,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -274,7 +280,7 @@ t1 CREATE TABLE `t1` ( ...@@ -274,7 +280,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -299,11 +305,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ...@@ -299,11 +305,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
...@@ -342,7 +348,7 @@ t1 CREATE TABLE `t1` ( ...@@ -342,7 +348,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Show table on slave --- --- Show table on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -356,7 +362,7 @@ t1 CREATE TABLE `t1` ( ...@@ -356,7 +362,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -414,7 +420,7 @@ t1 CREATE TABLE `t1` ( ...@@ -414,7 +420,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -430,7 +436,7 @@ t1 CREATE TABLE `t1` ( ...@@ -430,7 +436,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -495,7 +501,7 @@ t1 CREATE TABLE `t1` ( ...@@ -495,7 +501,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -508,7 +514,7 @@ t1 CREATE TABLE `t1` ( ...@@ -508,7 +514,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -533,11 +539,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ...@@ -533,11 +539,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
...@@ -566,7 +572,7 @@ t1 CREATE TABLE `t1` ( ...@@ -566,7 +572,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -582,7 +588,7 @@ t1 CREATE TABLE `t1` ( ...@@ -582,7 +588,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -607,11 +613,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ...@@ -607,11 +613,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
...@@ -648,7 +654,7 @@ t1 CREATE TABLE `t1` ( ...@@ -648,7 +654,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Show that tables on slave --- --- Show that tables on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -663,7 +669,7 @@ t1 CREATE TABLE `t1` ( ...@@ -663,7 +669,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -720,7 +726,7 @@ t1 CREATE TABLE `t1` ( ...@@ -720,7 +726,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Make sure that our tables on slave are still right type --- --- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -736,7 +742,7 @@ t1 CREATE TABLE `t1` ( ...@@ -736,7 +742,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -793,7 +799,7 @@ t1 CREATE TABLE `t1` ( ...@@ -793,7 +799,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -809,7 +815,7 @@ t1 CREATE TABLE `t1` ( ...@@ -809,7 +815,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -853,3 +859,4 @@ DELETE FROM t1; ...@@ -853,3 +859,4 @@ DELETE FROM t1;
--- End test 5 key partition testing --- --- End test 5 key partition testing ---
--- Do Cleanup --- --- Do Cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;
...@@ -4,7 +4,13 @@ reset master; ...@@ -4,7 +4,13 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
SET storage_engine=ndb; CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
--- Doing pre test cleanup --- --- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--- Start test 1 Basic testing --- --- Start test 1 Basic testing ---
...@@ -186,7 +192,7 @@ t1 CREATE TABLE `t1` ( ...@@ -186,7 +192,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Show table on slave -- --- Show table on slave --
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -200,7 +206,7 @@ t1 CREATE TABLE `t1` ( ...@@ -200,7 +206,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -258,7 +264,7 @@ t1 CREATE TABLE `t1` ( ...@@ -258,7 +264,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -274,7 +280,7 @@ t1 CREATE TABLE `t1` ( ...@@ -274,7 +280,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -299,11 +305,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ...@@ -299,11 +305,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
...@@ -342,7 +348,7 @@ t1 CREATE TABLE `t1` ( ...@@ -342,7 +348,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Show table on slave --- --- Show table on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -356,7 +362,7 @@ t1 CREATE TABLE `t1` ( ...@@ -356,7 +362,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -414,7 +420,7 @@ t1 CREATE TABLE `t1` ( ...@@ -414,7 +420,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -430,7 +436,7 @@ t1 CREATE TABLE `t1` ( ...@@ -430,7 +436,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -495,7 +501,7 @@ t1 CREATE TABLE `t1` ( ...@@ -495,7 +501,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -508,7 +514,7 @@ t1 CREATE TABLE `t1` ( ...@@ -508,7 +514,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -533,11 +539,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ...@@ -533,11 +539,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
...@@ -566,7 +572,7 @@ t1 CREATE TABLE `t1` ( ...@@ -566,7 +572,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -582,7 +588,7 @@ t1 CREATE TABLE `t1` ( ...@@ -582,7 +588,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -607,11 +613,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ...@@ -607,11 +613,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
...@@ -648,7 +654,7 @@ t1 CREATE TABLE `t1` ( ...@@ -648,7 +654,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Show that tables on slave --- --- Show that tables on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -663,7 +669,7 @@ t1 CREATE TABLE `t1` ( ...@@ -663,7 +669,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -720,7 +726,7 @@ t1 CREATE TABLE `t1` ( ...@@ -720,7 +726,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Make sure that our tables on slave are still right type --- --- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -736,7 +742,7 @@ t1 CREATE TABLE `t1` ( ...@@ -736,7 +742,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -793,7 +799,7 @@ t1 CREATE TABLE `t1` ( ...@@ -793,7 +799,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -809,7 +815,7 @@ t1 CREATE TABLE `t1` ( ...@@ -809,7 +815,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
...@@ -853,3 +859,4 @@ DELETE FROM t1; ...@@ -853,3 +859,4 @@ DELETE FROM t1;
--- End test 5 key partition testing --- --- End test 5 key partition testing ---
--- Do Cleanup --- --- Do Cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;
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;
SET storage_engine=ndb;
=== NDB -> NDB ===
SET storage_engine=ndb;
--- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1;
--- Create Table Section ---
CREATE TABLE t1 (id MEDIUMINT NOT NULL,
b1 INT,
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));
--- Show table on master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` varchar(255) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` varchar(255) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
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
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
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
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
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
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t
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
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
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
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
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
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
--- Check that simple Alter statements are replicated correctly --
ALTER TABLE t1 DROP PRIMARY KEY;
ALTER TABLE t1 MODIFY vc char(32);
--- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` char(32) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` char(32) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
--- Check that replication works when slave has more columns than master
ALTER TABLE t1 ADD PRIMARY KEY(id,total);
ALTER TABLE t1 MODIFY vc TEXT;
INSERT INTO t1 VALUES(3,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(20,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(50,1,'Testing MySQL databases is a cool ',
'Must make it bug free for the customer',
654321.4321,15.21,0,1965,"1985-11-14");
--- Add columns on slave ---
ALTER TABLE t1 ADD (u int, v char(16) default 'default');
UPDATE t1 SET u=7 WHERE id < 50;
UPDATE t1 SET v='explicit' WHERE id >10;
--- Show changed table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` text,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
`u` int(11) DEFAULT NULL,
`v` char(16) DEFAULT 'default',
PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT *
FROM t1
ORDER BY id;
id b1 vc bc d f total y t u v
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
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
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
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
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
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
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
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
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
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t u v
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 NULL default
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
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 NULL default
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
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 NULL default
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
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 NULL default
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 NULL default
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t u v
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
7
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
7
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Check that replication works when master has more columns than slave
--- Remove columns on slave ---
ALTER TABLE t1 DROP COLUMN v;
ALTER TABLE t1 DROP COLUMN u;
ALTER TABLE t1 DROP COLUMN t;
ALTER TABLE t1 DROP COLUMN y;
--- Show changed table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` text,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
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
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
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
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
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
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Do Cleanup --
DROP TABLE IF EXISTS t1;
...@@ -8,6 +8,13 @@ SET storage_engine=ndb; ...@@ -8,6 +8,13 @@ SET storage_engine=ndb;
=== NDB -> MYISAM === === NDB -> MYISAM ===
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
SET storage_engine=myisam; SET storage_engine=myisam;
--- Doing pre test cleanup --- --- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
...@@ -402,6 +409,7 @@ DROP TABLE IF EXISTS t1; ...@@ -402,6 +409,7 @@ DROP TABLE IF EXISTS t1;
=== NDB -> INNODB === === NDB -> INNODB ===
alter table mysql.ndb_apply_status engine=innodb;
SET storage_engine=innodb; SET storage_engine=innodb;
--- Doing pre test cleanup --- --- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
...@@ -793,397 +801,4 @@ TRUNCATE TABLE t1; ...@@ -793,397 +801,4 @@ TRUNCATE TABLE t1;
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
--- Do Cleanup -- --- Do Cleanup --
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;
=== NDB -> NDB ===
SET storage_engine=ndb;
--- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1;
--- Create Table Section ---
CREATE TABLE t1 (id MEDIUMINT NOT NULL,
b1 INT,
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));
--- Show table on master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` varchar(255) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` varchar(255) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
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
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
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
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
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
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t
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
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
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
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
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
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
--- Check that simple Alter statements are replicated correctly --
ALTER TABLE t1 DROP PRIMARY KEY;
ALTER TABLE t1 MODIFY vc char(32);
--- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` char(32) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` char(32) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
--- Check that replication works when slave has more columns than master
ALTER TABLE t1 ADD PRIMARY KEY(id,total);
ALTER TABLE t1 MODIFY vc TEXT;
INSERT INTO t1 VALUES(3,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(20,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(50,1,'Testing MySQL databases is a cool ',
'Must make it bug free for the customer',
654321.4321,15.21,0,1965,"1985-11-14");
--- Add columns on slave ---
ALTER TABLE t1 ADD (u int, v char(16) default 'default');
UPDATE t1 SET u=7 WHERE id < 50;
UPDATE t1 SET v='explicit' WHERE id >10;
--- Show changed table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` text,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
`u` int(11) DEFAULT NULL,
`v` char(16) DEFAULT 'default',
PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT *
FROM t1
ORDER BY id;
id b1 vc bc d f total y t u v
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
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
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
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
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
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
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
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
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
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t u v
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 NULL default
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
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 NULL default
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
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 NULL default
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
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 NULL default
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 NULL default
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t u v
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
7
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
7
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Check that replication works when master has more columns than slave
--- Remove columns on slave ---
ALTER TABLE t1 DROP COLUMN v;
ALTER TABLE t1 DROP COLUMN u;
ALTER TABLE t1 DROP COLUMN t;
ALTER TABLE t1 DROP COLUMN y;
--- Show changed table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` text,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
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
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
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
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
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
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Do Cleanup --
DROP TABLE IF EXISTS t1;
...@@ -11,13 +11,6 @@ ...@@ -11,13 +11,6 @@
############################################################################## ##############################################################################
rpl_ndb_2innodb : Bug #32648 Test failure between NDB Cluster and other engines
rpl_ndb_2myisam : Bug #32648 Test failure between NDB Cluster and other engines
rpl_ndb_2other : Bug #32648 Test failure between NDB Cluster and other engines
rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset
rpl_ndb_extraColMaster : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris
rpl_ndb_mix_innodb : Bug #32720 Test rpl_ndb_mix_innodb fails on SPARC and PowerPC
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
--default-storage-engine=ndbcluster --new --default-storage-engine=ndbcluster
--innodb --default-storage-engine=innodb --innodb --default-storage-engine=innodb --ndbcluster=0
...@@ -8,9 +8,19 @@ ...@@ -8,9 +8,19 @@
# test and to have control over the tests. # test and to have control over the tests.
############################################################## ##############################################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/ndb_master-slave.inc -- source include/master-slave.inc
connection slave;
-- connection slave
-- source include/have_innodb.inc -- source include/have_innodb.inc
connection master; CREATE TABLE mysql.ndb_apply_status
SET storage_engine=ndb; ( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=INNODB;
--source extra/rpl_tests/rpl_ndb_2multi_eng.test --source extra/rpl_tests/rpl_ndb_2multi_eng.test
--connection slave
drop table mysql.ndb_apply_status;
--default-storage-engine=ndbcluster --new --default-storage-engine=ndbcluster
--default-storage-engine=myisam --default-storage-engine=myisam --ndbcluster=0
...@@ -8,6 +8,18 @@ ...@@ -8,6 +8,18 @@
# test and to have control over the tests. # test and to have control over the tests.
############################################################## ##############################################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/ndb_master-slave.inc -- source include/master-slave.inc
SET storage_engine=ndb;
-- connection slave
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
--source extra/rpl_tests/rpl_ndb_2multi_eng.test --source extra/rpl_tests/rpl_ndb_2multi_eng.test
--connection slave
drop table mysql.ndb_apply_status;
#############################################################
# Author: Rafal Somla
# Date: 2006-08-20
# Purpose: Trying to test ability to replicate from cluster
# to other engines (innodb, myisam), see also rpl_ndb_2other.test
##############################################################
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc
# On master use NDB as storage engine.
connection master;
SET storage_engine=ndb;
--echo
--echo === NDB -> NDB ===
--echo
connection slave;
SET storage_engine=ndb;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test
--innodb --log-slave-updates=0 --innodb --ndbcluster=0 --log-slave-updates=0
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_binlog_format_mixed_or_row.inc --source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/master-slave.inc
# On master use NDB as storage engine. # On master use NDB as storage engine.
connection master; connection master;
...@@ -17,6 +17,13 @@ SET storage_engine=ndb; ...@@ -17,6 +17,13 @@ SET storage_engine=ndb;
--echo === NDB -> MYISAM === --echo === NDB -> MYISAM ===
--echo --echo
connection slave; connection slave;
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
SET storage_engine=myisam; SET storage_engine=myisam;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test --source extra/rpl_tests/rpl_ndb_2multi_basic.test
...@@ -24,12 +31,9 @@ SET storage_engine=myisam; ...@@ -24,12 +31,9 @@ SET storage_engine=myisam;
--echo === NDB -> INNODB === --echo === NDB -> INNODB ===
--echo --echo
connection slave; connection slave;
alter table mysql.ndb_apply_status engine=innodb;
SET storage_engine=innodb; SET storage_engine=innodb;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test --source extra/rpl_tests/rpl_ndb_2multi_basic.test
--echo
--echo === NDB -> NDB ===
--echo
connection slave; connection slave;
SET storage_engine=ndb; drop table mysql.ndb_apply_status;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment