1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge whalegate.ndb.mysql.com:/home/tomas/cge-5.1

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge


mysql-test/mysql-test-run.pl:
  Auto merged
This commit is contained in:
unknown
2008-01-04 16:01:36 +01:00
34 changed files with 629 additions and 506 deletions

View File

@ -831,6 +831,7 @@ our @tags=
["include/have_ndb.inc", "ndb_test", 1],
["include/have_multi_ndb.inc", "ndb_test", 1],
["include/have_ndb_extra.inc", "ndb_extra", 1],
["include/ndb_master-slave.inc", "ndb_test", 1],
["require_manager", "require_manager", 1],
);

View File

@ -409,13 +409,20 @@ sub main () {
{
# use default and add any extra_suites as defined
$opt_suites= $opt_suites_default;
my $ddd= basename(dirname($glob_mysql_test_dir));
foreach my $extra_suite (@extra_suites)
my $ccc= dirname($glob_mysql_test_dir);
my $found= 0;
while (!$found and !($ccc eq "/") and !($ccc eq ""))
{
if ($extra_suite->[0] eq "$ddd")
my $ddd= basename($ccc);
foreach my $extra_suite (@extra_suites)
{
$opt_suites= "$extra_suite->[1],$opt_suites";
if ($extra_suite->[0] eq "$ddd")
{
$opt_suites= "$extra_suite->[1],$opt_suites";
$found= 1;
}
}
$ccc= dirname($ccc);
}
}

View File

@ -38,6 +38,23 @@ a b c
1 10 3
1 11 3
1 12 3
select max(b) from t1 where a = 1;
max(b)
12
select b from t1 where a = 1 order by b desc;
b
12
11
10
9
8
7
6
5
4
3
2
1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
PRIMARY KEY (a,b,c) USING HASH)

View File

@ -46,6 +46,14 @@ a b c
1 1 1
6 1 1
10 1 1
INSERT into t1 values (1, 2, 2);
select max(b) from t1 where a = 1;
max(b)
2
select b from t1 where a = 1 order by b desc;
b
2
1
drop table t1;
CREATE TABLE t1 (
a int not null,

View File

@ -38,6 +38,10 @@ insert into t1 values
select * from t1 order by b;
# BUG#33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition
select max(b) from t1 where a = 1;
select b from t1 where a = 1 order by b desc;
DROP TABLE t1;
#

View File

@ -48,6 +48,11 @@ select * from t1 where a=21 order by a;
select * from t1 where a in (1,6,10,21) order by a;
select * from t1 where b=1 and a in (1,6,10,21) order by a;
# BUG#33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition
INSERT into t1 values (1, 2, 2);
select max(b) from t1 where a = 1;
select b from t1 where a = 1 order by b desc;
drop table t1;
#

View File

@ -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
#ndb_autodiscover3 : bug#21806
#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

View File

@ -4,7 +4,13 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
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 ---
DROP TABLE IF EXISTS t1;
--- Start test 1 Basic testing ---
@ -27,7 +33,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@ -100,7 +106,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -186,7 +192,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 CREATE TABLE t1;
Table Create Table
@ -200,7 +206,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -258,7 +264,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -274,7 +280,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -299,11 +305,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
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
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 ---
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
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 ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
@ -342,7 +348,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 CREATE TABLE t1;
Table Create Table
@ -356,7 +362,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -414,7 +420,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -430,7 +436,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -495,7 +501,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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;
Table Create Table
t1 CREATE TABLE `t1` (
@ -508,7 +514,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -533,11 +539,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
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
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 ---
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
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 ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
@ -566,7 +572,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -582,7 +588,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -607,11 +613,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
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
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 ---
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
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 ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
@ -648,7 +654,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 CREATE TABLE t1;
Table Create Table
@ -663,7 +669,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -720,7 +726,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -736,7 +742,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -793,7 +799,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -809,7 +815,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -853,3 +859,4 @@ DELETE FROM t1;
--- End test 5 key partition testing ---
--- Do Cleanup ---
DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;

View File

@ -4,7 +4,13 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
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 ---
DROP TABLE IF EXISTS t1;
--- Start test 1 Basic testing ---
@ -186,7 +192,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 CREATE TABLE t1;
Table Create Table
@ -200,7 +206,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -258,7 +264,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -274,7 +280,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -299,11 +305,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
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
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 ---
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
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 ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
@ -342,7 +348,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 CREATE TABLE t1;
Table Create Table
@ -356,7 +362,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -414,7 +420,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -430,7 +436,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -495,7 +501,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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;
Table Create Table
t1 CREATE TABLE `t1` (
@ -508,7 +514,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) 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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -533,11 +539,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
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
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 ---
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
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 ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
@ -566,7 +572,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -582,7 +588,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -607,11 +613,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
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
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 ---
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
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 ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
@ -648,7 +654,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 CREATE TABLE t1;
Table Create Table
@ -663,7 +669,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -720,7 +726,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -736,7 +742,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -793,7 +799,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@ -809,7 +815,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
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 ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@ -853,3 +859,4 @@ DELETE FROM t1;
--- End test 5 key partition testing ---
--- Do Cleanup ---
DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;

View File

@ -0,0 +1,401 @@
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;

View File

@ -8,6 +8,13 @@ SET storage_engine=ndb;
=== 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;
--- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1;
@ -402,6 +409,7 @@ DROP TABLE IF EXISTS t1;
=== NDB -> INNODB ===
alter table mysql.ndb_apply_status engine=innodb;
SET storage_engine=innodb;
--- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1;
@ -793,397 +801,4 @@ TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Do Cleanup --
DROP TABLE IF EXISTS t1;
=== 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;
drop table mysql.ndb_apply_status;

View File

@ -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_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
#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly

View File

@ -1 +1 @@
--default-storage-engine=ndbcluster
--new --default-storage-engine=ndbcluster

View File

@ -1 +1 @@
--innodb --default-storage-engine=innodb
--innodb --default-storage-engine=innodb --ndbcluster=0

View File

@ -8,9 +8,19 @@
# test and to have control over the tests.
##############################################################
-- source include/have_ndb.inc
-- source include/ndb_master-slave.inc
connection slave;
-- source include/master-slave.inc
-- connection slave
-- source include/have_innodb.inc
connection master;
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;
--source extra/rpl_tests/rpl_ndb_2multi_eng.test
--connection slave
drop table mysql.ndb_apply_status;

View File

@ -1 +1 @@
--default-storage-engine=ndbcluster
--new --default-storage-engine=ndbcluster

View File

@ -1 +1 @@
--default-storage-engine=myisam
--default-storage-engine=myisam --ndbcluster=0

View File

@ -8,6 +8,18 @@
# test and to have control over the tests.
##############################################################
-- source include/have_ndb.inc
-- source include/ndb_master-slave.inc
SET storage_engine=ndb;
-- source include/master-slave.inc
-- 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
--connection slave
drop table mysql.ndb_apply_status;

View File

@ -0,0 +1 @@
--log-slave-updates=0

View File

@ -0,0 +1,19 @@
#############################################################
# 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

View File

@ -1 +1 @@
--innodb --log-slave-updates=0
--innodb --ndbcluster=0 --log-slave-updates=0

View File

@ -7,7 +7,7 @@
--source include/have_ndb.inc
--source include/have_innodb.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.
connection master;
@ -17,6 +17,13 @@ SET storage_engine=ndb;
--echo === NDB -> MYISAM ===
--echo
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;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test
@ -24,12 +31,9 @@ SET storage_engine=myisam;
--echo === NDB -> INNODB ===
--echo
connection slave;
alter table mysql.ndb_apply_status engine=innodb;
SET storage_engine=innodb;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test
--echo
--echo === NDB -> NDB ===
--echo
connection slave;
SET storage_engine=ndb;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test
drop table mysql.ndb_apply_status;

View File

@ -3710,6 +3710,8 @@ int handler::ha_reset()
DBUG_ASSERT(inited == NONE);
/* Free cache used by filesort */
free_io_cache(table);
/* reset the bitmaps to point to defaults */
table->default_column_bitmaps();
DBUG_RETURN(reset());
}

View File

@ -7837,7 +7837,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
{
DBUG_PRINT("info",("ha_index_init returns error %d",error));
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
goto err;
}
/* Fill key data for the row */
@ -7870,7 +7870,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
DBUG_PRINT("info",("no record matching the key found in the table"));
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
DBUG_RETURN(error);
goto err;
}
/*
@ -7898,7 +7898,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
if (table->key_info->flags & HA_NOSAME)
{
table->file->ha_index_end();
DBUG_RETURN(0);
goto ok;
}
/*
@ -7930,7 +7930,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
DBUG_PRINT("info",("no record matching the given row found"));
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
DBUG_RETURN(error);
goto err;
}
}
@ -7951,7 +7951,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
DBUG_PRINT("info",("error initializing table scan"
" (ha_rnd_init returns %d)",error));
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
goto err;
}
/* Continue until we find the right record or have made a full loop */
@ -7975,7 +7975,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
" (rnd_next returns %d)",error));
table->file->print_error(error, MYF(0));
table->file->ha_rnd_end();
DBUG_RETURN(error);
goto err;
}
}
while (restart_count < 2 && record_compare(table));
@ -7995,10 +7995,14 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
table->file->ha_rnd_end();
DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == HA_ERR_RECORD_DELETED || error == 0);
DBUG_RETURN(error);
goto err;
}
ok:
table->default_column_bitmaps();
DBUG_RETURN(0);
err:
table->default_column_bitmaps();
DBUG_RETURN(error);
}
#endif

View File

@ -4086,9 +4086,7 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal)
bool ok = false;
switch(tabState){
case TableRecord::NOT_DEFINED:
case TableRecord::REORG_TABLE_PREPARED:
case TableRecord::DEFINING:
case TableRecord::CHECKED:
jam();
alterTableRef(signal, req, AlterTableRef::NoSuchTable);
return;
@ -4339,9 +4337,7 @@ Dbdict::execALTER_TAB_REQ(Signal * signal)
bool ok = false;
switch(tabState){
case TableRecord::NOT_DEFINED:
case TableRecord::REORG_TABLE_PREPARED:
case TableRecord::DEFINING:
case TableRecord::CHECKED:
jam();
alterTabRef(signal, req, AlterTableRef::NoSuchTable);
return;
@ -6690,9 +6686,7 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){
bool ok = false;
switch(tabState){
case TableRecord::NOT_DEFINED:
case TableRecord::REORG_TABLE_PREPARED:
case TableRecord::DEFINING:
case TableRecord::CHECKED:
jam();
dropTableRef(signal, req, DropTableRef::NoSuchTable);
return;
@ -7718,7 +7712,6 @@ Dbdict::execLIST_TABLES_REQ(Signal* signal)
if(DictTabInfo::isTable(type)){
switch (tablePtr.p->tabState) {
case TableRecord::DEFINING:
case TableRecord::CHECKED:
conf->setTableState(pos, DictTabInfo::StateBuilding);
break;
case TableRecord::PREPARE_DROPPING:

View File

@ -320,9 +320,7 @@ public:
enum TabState {
NOT_DEFINED = 0,
REORG_TABLE_PREPARED = 1,
DEFINING = 2,
CHECKED = 3,
DEFINED = 4,
PREPARE_DROPPING = 5,
DROPPING = 6,

View File

@ -1340,29 +1340,41 @@ NdbIndexScanOperation::readTuples(LockMode lm,
if(insertATTRINFO(word) == -1)
res = -1;
}
if(!res && order_by){
m_ordered = true;
if (!res)
{
/**
* Note that it is valid to have order_desc true and order_by false.
*
* This means that there will be no merge sort among partitions, but
* each partition will still be returned in descending sort order.
*
* This is useful eg. if it is known that the scan spans only one
* partition.
*/
if (order_desc) {
m_descending = true;
ScanTabReq * req = CAST_PTR(ScanTabReq, theSCAN_TABREQ->getDataPtrSend());
ScanTabReq::setDescendingFlag(req->requestInfo, true);
}
Uint32 cnt = m_accessTable->getNoOfColumns() - 1;
m_sort_columns = cnt; // -1 for NDB$NODE
m_current_api_receiver = m_sent_receivers_count;
m_api_receivers_count = m_sent_receivers_count;
if (order_by) {
m_ordered = true;
Uint32 cnt = m_accessTable->getNoOfColumns() - 1;
m_sort_columns = cnt; // -1 for NDB$NODE
m_current_api_receiver = m_sent_receivers_count;
m_api_receivers_count = m_sent_receivers_count;
m_sort_columns = cnt;
for(Uint32 i = 0; i<cnt; i++){
const NdbColumnImpl* key = m_accessTable->m_index->m_columns[i];
const NdbColumnImpl* col = m_currentTable->getColumn(key->m_keyInfoPos);
NdbRecAttr* tmp = NdbScanOperation::getValue_impl(col, (char*)-1);
UintPtr newVal = UintPtr(tmp);
theTupleKeyDefined[i][0] = FAKE_PTR;
theTupleKeyDefined[i][1] = (newVal & 0xFFFFFFFF);
m_sort_columns = cnt;
for(Uint32 i = 0; i<cnt; i++){
const NdbColumnImpl* key = m_accessTable->m_index->m_columns[i];
const NdbColumnImpl* col = m_currentTable->getColumn(key->m_keyInfoPos);
NdbRecAttr* tmp = NdbScanOperation::getValue_impl(col, (char*)-1);
UintPtr newVal = UintPtr(tmp);
theTupleKeyDefined[i][0] = FAKE_PTR;
theTupleKeyDefined[i][1] = (newVal & 0xFFFFFFFF);
#if (SIZEOF_CHARP == 8)
theTupleKeyDefined[i][2] = (newVal >> 32);
theTupleKeyDefined[i][2] = (newVal >> 32);
#endif
}
}
}
m_this_bound_start = 0;