Commit 4a5e97af authored by jmiller@mysql.com's avatar jmiller@mysql.com

Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  mysql.com:/home/ndbdev/jmiller/clones/mysql-5.1-new
parents 9d2fffb8 b1a06e28
# #
# Test of auto_increment with offset # Test of auto_increment with offset
# #
#####################################
# By: JBM
# Date: 2006-02-10
# Change: NDB does not support auto inc
# in this usage. Currently there is no
# plan to implment. Skipping test when
# NDB is default engine.
#####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc -- source include/master-slave.inc
eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2 auto_increment=3; eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2 auto_increment=3;
......
...@@ -30,7 +30,6 @@ data LONGBLOB, PRIMARY KEY(c1))ENGINE=$engine_type; ...@@ -30,7 +30,6 @@ data LONGBLOB, PRIMARY KEY(c1))ENGINE=$engine_type;
INSERT INTO test.t1 VALUES (NULL, NULL); INSERT INTO test.t1 VALUES (NULL, NULL);
INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024)); INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024)); INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
CHECK TABLE test.t1;
--echo --echo
--echo **** Data Insert Validation Master Section test.t1 **** --echo **** Data Insert Validation Master Section test.t1 ****
...@@ -60,6 +59,9 @@ UPDATE t1 set data=repeat('c',17*1024) where c1 = 2; ...@@ -60,6 +59,9 @@ UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
--echo --echo
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1; SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
# Sleep is needed for NDB to allow time for
# Injector thread to populate the bin log.
sleep 10;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
...@@ -155,6 +157,9 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) ...@@ -155,6 +157,9 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1; FROM test.t2 WHERE c1=1;
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2; FROM test.t2 WHERE c1=2;
# Sleep is needed for NDB to allow time for
# Injector thread to populate the bin log.
sleep 15;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
......
...@@ -9,14 +9,14 @@ let $VERSION=`select version()`; ...@@ -9,14 +9,14 @@ let $VERSION=`select version()`;
eval create table t1(a int not null primary key) engine=$engine_type; eval create table t1(a int not null primary key) engine=$engine_type;
insert delayed into t1 values (1),(2),(3); insert delayed into t1 values (1),(2),(3);
flush tables; flush tables;
select * from t1; SELECT * FROM t1 ORDER BY a;
sync_slave_with_master; sync_slave_with_master;
connection master; connection master;
--replace_result $VERSION VERSION --replace_result $VERSION VERSION
show binlog events; show binlog events;
sync_slave_with_master; sync_slave_with_master;
select * from t1; SELECT * FROM t1 ORDER BY a;
connection master; connection master;
drop table t1; drop table t1;
sync_slave_with_master; sync_slave_with_master;
-- source include/master-slave.inc
##############################################################################
#
# Let's verify that multi-update with a subselect does not cause the slave to crash
# (BUG#10442)
#
--disable_query_log
SELECT '-------- Test for BUG#9361 --------' as "";
--enable_query_log
eval CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned
) ENGINE=$engine_type;
eval CREATE TABLE t2 (
a int unsigned not null auto_increment primary key,
b int unsigned
) ENGINE=$engine_type;
INSERT INTO t1 VALUES (NULL, 0);
INSERT INTO t1 SELECT NULL, 0 FROM t1;
INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
sync_slave_with_master;
connection slave;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
connection master;
drop table t1,t2;
##############################################################################
#
# Test for BUG#9361:
# Subselects should work inside multi-updates
#
--disable_query_log
SELECT '-------- Test 1 for BUG#9361 --------' as "";
--enable_query_log
connection master;
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings
CREATE TABLE t1 (
a1 char(30),
a2 int,
a3 int,
a4 char(30),
a5 char(30)
);
CREATE TABLE t2 (
b1 int,
b2 char(30)
);
# Insert one row per table
INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
INSERT INTO t2 VALUES (1, 'baz');
# This should update the row in t1
UPDATE t1 a, t2
SET a.a1 = 'No'
WHERE a.a2 =
(SELECT b1
FROM t2
WHERE b2 = 'baz')
AND a.a3 IS NULL
AND a.a4 = 'foo'
AND a.a5 = 'bar';
sync_slave_with_master;
connection slave;
SELECT * FROM t1;
SELECT * FROM t2;
connection master;
DROP TABLE t1, t2;
##############################################################################
#
# Second test for BUG#9361
#
--disable_query_log
SELECT '-------- Test 2 for BUG#9361 --------' as "";
--enable_query_log
connection master;
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
--enable_warnings
CREATE TABLE t1 (
i INT,
j INT,
x INT,
y INT,
z INT
);
CREATE TABLE t2 (
i INT,
k INT,
x INT,
y INT,
z INT
);
CREATE TABLE t3 (
j INT,
k INT,
x INT,
y INT,
z INT
);
INSERT INTO t1 VALUES ( 1, 2,13,14,15);
INSERT INTO t2 VALUES ( 1, 3,23,24,25);
INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
UPDATE t1 AS a
INNER JOIN t2 AS b
ON a.i = b.i
INNER JOIN t3 AS c
ON a.j = c.j AND b.k = c.k
SET a.x = b.x,
a.y = b.y,
a.z = (
SELECT sum(z)
FROM t3
WHERE y = 34
)
WHERE b.x = 23;
sync_slave_with_master;
connection slave;
SELECT * FROM t1;
connection master;
DROP TABLE t1, t2, t3;
...@@ -46,7 +46,10 @@ CALL test.p2(); ...@@ -46,7 +46,10 @@ CALL test.p2();
SELECT release_lock("test"); SELECT release_lock("test");
SELECT * FROM test.t1; SELECT * FROM test.t1;
#show binlog events; #show binlog events;
# Added sleep for use with NDB to ensure that
# the injector thread will populate log before
# we switch to the slave.
sleep 5;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
SELECT * FROM test.t1; SELECT * FROM test.t1;
......
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
# TEST: Use after insert and before inset triggers and stored procdures to # # TEST: Use after insert and before inset triggers and stored procdures to #
# Update and insert data # # Update and insert data #
############################################################################# #############################################################################
# Change Auth: JBM #
# Date: 2006-02-14 #
# Change: Added error, sleep and comments (ndb) #
####################################################
# Begin clean up test section # Begin clean up test section
connection master; connection master;
...@@ -25,12 +28,16 @@ CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO t ...@@ -25,12 +28,16 @@ CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO t
delimiter ;// delimiter ;//
INSERT INTO test.t2 VALUES (1, 0.0); INSERT INTO test.t2 VALUES (1, 0.0);
--error 0,1062 # Expect duplicate error 1022 == ndb
--error 1022,1062
INSERT INTO test.t2 VALUES (1, 0.0); INSERT INTO test.t2 VALUES (1, 0.0);
#show binlog events; #show binlog events;
select * from test.t1; select * from test.t1;
select * from test.t2; select * from test.t2;
# Have to sleep for a few seconds to allow
# NDB injector thread to populate binlog
sleep 10;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
select * from test.t1; select * from test.t1;
......
######################################################
# By JBM 2006-02-16 So that the code is not repeated #
# in test cases and can be reused. #
######################################################
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
# there is no neat way to find the backupid, this is a hack to find it...
--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
--replace_column 1 <the_backup_id>
SELECT @the_backup_id:=backup_id FROM test.backup_info;
let the_backup_id=`select @the_backup_id`;
DROP TABLE test.backup_info;
######################################################
# By JBM 2006-02-16 So that the code is not repeated #
# in test cases and can be reused. #
######################################################
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -p 8 -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
--require r/true.require
disable_query_log;
select convert(@@table_type using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
enable_query_log;
This diff is collapsed.
...@@ -4,7 +4,7 @@ reset master; ...@@ -4,7 +4,7 @@ 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;
create table t1 (a int); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t2 values (1); insert into t2 values (1);
......
...@@ -24,7 +24,7 @@ use mysqltest_to; ...@@ -24,7 +24,7 @@ use mysqltest_to;
select * from a; select * from a;
i i
3 3
create table t1 (a int); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t2 values (1); insert into t2 values (1);
......
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;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=NDB;
INSERT INTO test.t1 VALUES(1,UUID(),UUID());
create procedure test.p1()
begin
INSERT INTO test.t1 VALUES(2,UUID(),UUID());
INSERT INTO test.t1 VALUES(3,UUID(),UUID());
end|
CALL test.p1();
create function test.fn1(x int)
returns int
begin
insert into t1 values (4+x,UUID(),UUID());
insert into t1 values (5+x,UUID(),UUID());
return 0;
end|
select fn1(0);
fn1(0)
0
create table t2 (a int);
insert into t2 values(fn1(2));
SHOW CREATE TABLE test.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
`blob_column` longblob,
`vchar_column` varchar(100) default NULL,
PRIMARY KEY (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
DROP PROCEDURE test.p1;
DROP FUNCTION test.fn1;
DROP TABLE test.t1;
DROP TABLE test.t2;
...@@ -4,116 +4,94 @@ reset master; ...@@ -4,116 +4,94 @@ 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;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3; ***************** Test 1 ************************
CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3;
insert into t1 values (NULL,1),(NULL,2),(NULL,3); insert into t1 values (NULL,1),(NULL,2),(NULL,3);
select * from t1; ******* Select from Master *************
select * from t1 ORDER BY a;
a b a b
12 1 3 1
22 2 4 2
32 3 5 3
select * from t1; ******* Select from Slave *************
select * from t1 ORDER BY a;
a b a b
12 1 3 1
22 2 4 2
32 3 5 3
drop table t1; drop table t1;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam; create table t1 (a int not null auto_increment,b int, primary key (a)) engine=NDB;
insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4); insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
delete from t1 where b=4; delete from t1 where b=4;
insert into t1 values (NULL,5),(NULL,6); insert into t1 values (NULL,5),(NULL,6);
select * from t1; ******* Select from Master *************
select * from t1 ORDER BY a;
a b a b
1 1 1 1
2 2 2 2
3 3 3 3
22 5 5 5
32 6 6 6
select * from t1; ******* Select from Slave *************
select * from t1 ORDER BY a;
a b a b
1 1 1 1
2 2 2 2
3 3 3 3
22 5 5 5
32 6 6 6
drop table t1; drop table t1;
set @@session.auto_increment_increment=100, @@session.auto_increment_offset=10; create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
show variables like "%auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
insert into t1 values (NULL),(5),(NULL); insert into t1 values (NULL),(5),(NULL);
insert into t1 values (250),(NULL); insert into t1 values (250),(NULL);
select * from t1; ******* Select from Master *************
a
5 select * from t1 ORDER BY a;
10
110
250
310
insert into t1 values (1000);
set @@insert_id=400;
insert into t1 values(NULL),(NULL);
select * from t1;
a
5
10
110
250
310
400
410
1000
select * from t1;
a
5
10
110
250
310
400
410
1000
drop table t1;
create table t1 (a int not null auto_increment, primary key (a)) engine=innodb;
insert into t1 values (NULL),(5),(NULL);
insert into t1 values (250),(NULL);
select * from t1;
a a
1
5 5
10 6
110
250 250
310 251
insert into t1 values (1000); insert into t1 values (1000);
set @@insert_id=400; set @@insert_id=400;
insert into t1 values(NULL),(NULL); insert into t1 values(NULL),(NULL);
select * from t1; ******* Select from Master *************
select * from t1 ORDER BY a;
a a
1
5 5
10 6
110
250 250
310 251
400 400
410
1000 1000
select * from t1; 1001
******* Select from Slave *************
select * from t1 ORDER BY a;
a a
1
5 5
10 6
110
250 250
310 251
400 400
410
1000 1000
1001
drop table t1; drop table t1;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
insert into t1 values (NULL),(5),(NULL),(NULL); insert into t1 values (NULL),(5),(NULL),(NULL);
insert into t1 values (500),(NULL),(502),(NULL),(NULL); insert into t1 values (500),(NULL),(502),(NULL),(600);
select * from t1; ******* Select from Master *************
select * from t1 ORDER BY a;
a a
1 1
5 5
...@@ -123,13 +101,15 @@ a ...@@ -123,13 +101,15 @@ a
501 501
502 502
503 503
504 600
set @@insert_id=600; set @@insert_id=600;
insert into t1 values(600),(NULL),(NULL); insert into t1 values(600),(NULL),(NULL);
ERROR 23000: Duplicate entry '600' for key 1 ERROR 23000: Can't write; duplicate key in table 't1'
set @@insert_id=600; set @@insert_id=600;
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL); insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
select * from t1; ******* Select from Master *************
select * from t1 ORDER BY a;
a a
1 1
5 5
...@@ -139,11 +119,14 @@ a ...@@ -139,11 +119,14 @@ a
501 501
502 502
503 503
504
600 600
603
604
610 610
611 611
select * from t1; ******* Select from Slave *************
select * from t1 ORDER BY a;
a a
1 1
5 5
...@@ -153,33 +136,39 @@ a ...@@ -153,33 +136,39 @@ a
501 501
502 502
503 503
504
600 600
603
604
610 610
611 611
drop table t1; drop table t1;
set @@session.auto_increment_increment=10, @@session.auto_increment_offset=1; create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
insert into t1 values(2),(12),(22),(32),(42); insert into t1 values(2),(12),(22),(32),(42);
insert into t1 values (NULL),(NULL); insert into t1 values (NULL),(NULL);
insert into t1 values (3),(NULL),(NULL); insert into t1 values (3),(NULL),(NULL);
select * from t1; ******* Select from Master *************
select * from t1 ORDER BY a;
a a
1 1
2
3 3
11 4
21 5
31 ******* Select from Slave *************
select * from t1;
** Slave should have 2, 12, 22, 32, 42 **
** Master will have 2 but not 12, 22, 32, 42 **
select * from t1 ORDER BY a;
a a
1 1
2 2
3 3
11 4
5
12 12
21
22 22
31
32 32
42 42
drop table t1; drop table t1;
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;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
CREATE TABLE test.t1 (c1 int not null auto_increment,
data LONGBLOB, PRIMARY KEY(c1))ENGINE=#;
**** Data Insert Section test.t1 *****
INSERT INTO test.t1 VALUES (NULL, NULL);
INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
**** Data Insert Validation Master Section test.t1 ****
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
LENGTH(data)
NULL
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
1024
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
**** Data Insert Validation Slave Section test.t1 ****
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
LENGTH(data)
NULL
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
1024
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
**** Data Update Section test.t1 ****
UPDATE test.t1 set data=repeat('a',18*1024) where c1 = 1;
UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
**** Data Update Validation Master Section test.t1 ****
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
LENGTH(data)
18432
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
**** Data Update Validation Slave Section test.t1 ****
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
LENGTH(data)
18432
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
**** End Test Section test.t1 ****
**** Create Table test.t2 ****
CREATE TABLE test.t2 (
c1 INT NOT NULL PRIMARY KEY,
c2 TEXT,
c3 INT,
c4 LONGBLOB,
KEY(c3))ENGINE=#;
*** Setup Values For test.t2 ***
set @x0 = '01234567012345670123456701234567';
set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
set @b1 = 'b1';
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
set @b1 = concat(@b1,@x0);
set @d1 = 'dd1';
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @b2 = 'b2';
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @d2 = 'dd2';
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
**** Data Insert Section test.t2 *****
INSERT INTO test.t2 VALUES(1,@b1,111,@d1);
INSERT INTO test.t2 VALUES(2,@b2,222,@d2);
**** Data Insert Validation Master Section test.t2 ****
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
1 2256 b1 3000 dd1
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
**** Data Insert Validation Slave Section test.t2 ****
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
1 2256 b1 3000 dd1
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
**** Data Update Section test.t2 ****
UPDATE test.t2 SET c2=@b2, c4=@d2 WHERE c1=1;
UPDATE test.t2 SET c2=@b1, c4=@d1 WHERE c1=2;
**** Data Update Validation Master Section test.t2 ****
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
1 20000 b2 30000 dd2
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
**** Data Update Validation Slave Section test.t2 ****
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
1 20000 b2 30000 dd2
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
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 timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;
--- --master--
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
--- --slave--
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
set @@collation_server=armscii8_bin;
drop database mysqltest3;
create database mysqltest3;
--- --master--
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
--- --slave--
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
use mysqltest2;
create table t1 (a int auto_increment primary key, b varchar(100));
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server);
insert into t1 (b) values(@@character_set_client);
insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection);
--- --master--
select * from t1 order by a;
a b
1 armscii8
2 armscii8_bin
3 cp850
4 latin2
5 latin2_croatian_ci
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 armscii8
2 armscii8_bin
3 cp850
4 latin2
5 latin2_croatian_ci
select "--- --muller--" as "";
--- --muller--
set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Mller","Muffler"));
set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Mller","Muffler"));
--- --master--
select * from t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Mller
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Mller
select "--- --INSERT--" as "";
--- --INSERT--
set @a= _cp850 'Mller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
--- --master--
select * from t1 order by a;
a b
1 cp850_general_ci
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest2
master-bin.000001 # Query 1 # drop database if exists mysqltest3
master-bin.000001 # Query 1 # create database mysqltest2 character set latin2
master-bin.000001 # Query 1 # create database mysqltest3
master-bin.000001 # Query 1 # drop database mysqltest3
master-bin.000001 # Query 1 # create database mysqltest3
master-bin.000001 # Query 1 # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1
master-bin.000001 # Table_map 1 # mysqltest2.t1
master-bin.000001 # Write_rows 1 #
master-bin.000001 # Query 1 # drop database mysqltest2
master-bin.000001 # Query 1 # drop database mysqltest3
select "--- --global--" as "";
--- --global--
set global character_set_server=latin2;
set global character_set_server=latin1;
set global character_set_server=latin2;
set global character_set_server=latin1;
select "--- --oneshot--" as "";
--- --oneshot--
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin1
set @@character_set_server=latin5;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin5
set one_shot max_join_size=10;
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
set character_set_client=9999999;
ERROR 42000: Unknown character set: '9999999'
set collation_server=9999998;
ERROR HY000: Unknown collation: '9999998'
select "--- --3943--" as "";
--- --3943--
use test;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES (', ',', ');
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
drop table t1;
select "--- --6676--" as "";
--- --6676--
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=NDB default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
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;
CREATE TABLE t1 (a INT) ENGINE=NDB;
begin;
insert into t1 values(1);
flush tables with read lock;
commit;
unlock tables;
drop table t1;
This diff is collapsed.
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;
create table t1 (a int, b int) engine=NDB;
insert into t1 values(1,1);
select * from t1;
a b
1 1
delete from t1;
select * from t1;
a b
drop table t1;
...@@ -70,3 +70,4 @@ row2 new on slave 2 ...@@ -70,3 +70,4 @@ row2 new on slave 2
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master>
DROP TABLE IF EXISTS t1;
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;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned,
unique (b)
) ENGINE=NDB;
CREATE TABLE t2 (
a int unsigned, # to force INSERT SELECT to have a certain order
b int unsigned
) ENGINE=NDB;
INSERT INTO t1 VALUES (NULL, 1);
INSERT INTO t1 VALUES (NULL, 2);
INSERT INTO t1 VALUES (NULL, 3);
INSERT INTO t1 VALUES (NULL, 4);
INSERT INTO t2 VALUES (1, 1);
INSERT INTO t2 VALUES (2, 2);
INSERT INTO t2 VALUES (3, 5);
INSERT INTO t2 VALUES (4, 3);
INSERT INTO t2 VALUES (5, 4);
INSERT INTO t2 VALUES (6, 6);
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
SELECT * FROM t1 ORDER BY a;
a b
1 1
2 2
3 3
4 4
5 5
6 6
SELECT * FROM t1 ORDER BY a;
a b
1 1
2 2
3 3
4 4
5 5
6 6
drop table t1;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned,
unique (b)
) ENGINE=myisam;
INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 VALUES (2, 2);
INSERT INTO t1 VALUES (3, 3);
INSERT INTO t1 VALUES (4, 4);
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
SELECT * FROM t1 ORDER BY a;
a b
1 1
2 2
3 3
4 4
5 5
6 6
SELECT * FROM t1 ORDER BY a;
a b
1 1
2 2
3 3
4 4
5 5
6 6
drop table t1, t2;
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;
drop table if exists t1,t2;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned
) ENGINE=NDB;
CREATE TABLE t2 (
a int unsigned not null auto_increment primary key,
b int unsigned
) ENGINE=NDB;
INSERT INTO t1 VALUES (NULL, 0);
INSERT INTO t1 SELECT NULL, 0 FROM t1;
INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
SELECT * FROM t1 ORDER BY a;
a b
1 0
2 0
SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a;
SELECT * FROM t1 ORDER BY a;
a b
1 4
2 5
SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
SELECT * FROM t1 ORDER BY a;
a b
1 4
2 5
SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
drop table t1,t2;
reset master;
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (0);
UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
select * from t1;
a
3
select * from t1;
a
3
drop table t1;
...@@ -9,11 +9,11 @@ start slave; ...@@ -9,11 +9,11 @@ start slave;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int unsigned not null auto_increment primary key, a int unsigned not null auto_increment primary key,
b int unsigned b int unsigned
) ENGINE=MyISAM; ) ENGINE=NDB;
CREATE TABLE t2 ( CREATE TABLE t2 (
a int unsigned not null auto_increment primary key, a int unsigned not null auto_increment primary key,
b int unsigned b int unsigned
) ENGINE=MyISAM; ) ENGINE=NDB;
INSERT INTO t1 VALUES (NULL, 0); INSERT INTO t1 VALUES (NULL, 0);
INSERT INTO t1 SELECT NULL, 0 FROM t1; INSERT INTO t1 SELECT NULL, 0 FROM t1;
INSERT INTO t2 VALUES (NULL, 0), (NULL,1); INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
...@@ -122,3 +122,75 @@ SELECT * FROM t1; ...@@ -122,3 +122,75 @@ SELECT * FROM t1;
i j x y z i j x y z
1 2 23 24 71 1 2 23 24 71
DROP TABLE t1, t2, t3; DROP TABLE t1, t2, t3;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
DROP TABLE IF EXISTS t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t1 (
idp int(11) NOT NULL default '0',
idpro int(11) default NULL,
price decimal(19,4) default NULL,
PRIMARY KEY (idp)
);
CREATE TABLE t2 (
idpro int(11) NOT NULL default '0',
price decimal(19,4) default NULL,
nbprice int(11) default NULL,
PRIMARY KEY (idpro)
);
INSERT INTO t1 VALUES
(1,1,'3.0000'),
(2,2,'1.0000'),
(3,1,'1.0000'),
(4,1,'4.0000'),
(5,3,'2.0000'),
(6,2,'4.0000');
INSERT INTO t2 VALUES
(1,'0.0000',0),
(2,'0.0000',0),
(3,'0.0000',0);
update
t2
join
( select idpro, min(price) as min_price, count(*) as nbr_price
from t1
where idpro>0 and price>0
group by idpro
) as table_price
on t2.idpro = table_price.idpro
set t2.price = table_price.min_price,
t2.nbprice = table_price.nbr_price;
select "-- MASTER AFTER JOIN --" as "";
-- MASTER AFTER JOIN --
select * from t1;
idp idpro price
1 1 3.0000
2 2 1.0000
3 1 1.0000
4 1 4.0000
5 3 2.0000
6 2 4.0000
select * from t2;
idpro price nbprice
1 1.0000 3
2 1.0000 2
3 2.0000 1
select "-- SLAVE AFTER JOIN --" as "";
-- SLAVE AFTER JOIN --
select * from t1;
idp idpro price
1 1 3.0000
2 2 1.0000
3 1 1.0000
4 1 4.0000
5 3 2.0000
6 2 4.0000
select * from t2;
idpro price nbprice
1 1.0000 3
2 1.0000 2
3 2.0000 1
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;
stop slave;
create table t1 (a int) engine=NDB;
reset slave;
start slave;
stop slave;
start slave;
select max(a) from t1;
max(a)
8000
drop table t1;
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;
CREATE TABLE t1 (word CHAR(20) NOT NULL);
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word LIMIT 10;
word
Aarhus
Aarhus
Aarhus
Aarhus
Aaron
Aaron
Aaron
Aaron
Ababa
Ababa
STOP SLAVE;
SET PASSWORD FOR root@"localhost" = PASSWORD('foo');
START SLAVE;
SET PASSWORD FOR root@"localhost" = PASSWORD('');
CREATE TABLE t3(n INT);
INSERT INTO t3 VALUES(1),(2);
SELECT * FROM t3 ORDER BY n;
n
1
2
SELECT SUM(LENGTH(word)) FROM t1;
SUM(LENGTH(word))
1022
DROP TABLE t1,t3;
CREATE TABLE t1 (n INT) ENGINE=NDB;
RESET MASTER;
STOP SLAVE;
RESET SLAVE;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
LOCK TABLES t1 READ;
START SLAVE;
UNLOCK TABLES;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
DROP TABLE t1;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES(3456);
SELECT n FROM t1;
n
3456
DROP TABLE t1;
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;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=NDBCLUSTER;
CREATE PROCEDURE test.p1()
BEGIN
INSERT INTO test.t1 VALUES (4);
SELECT get_lock("test", 100);
UPDATE test.t1 set a=a+4 WHERE a=4;
END|
CREATE PROCEDURE test.p2()
BEGIN
UPDATE test.t1 SET a=a+1;
END|
SELECT get_lock("test", 200);
get_lock("test", 200)
1
CALL test.p1();
CALL test.p2();
SELECT release_lock("test");
release_lock("test")
1
SELECT * FROM test.t1;
a
5
SELECT * FROM test.t1;
a
5
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=NDBCLUSTER;
CALL test.p2();
CALL test.p1();
get_lock("test", 100)
0
SELECT * FROM test.t1;
a
8
SELECT * FROM test.t1;
a
8
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
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;
create database if not exists mysqltest1;
DROP PROCEDURE IF EXISTS mysqltest1.p1;
DROP PROCEDURE IF EXISTS mysqltest1.p2;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
CREATE PROCEDURE mysqltest1.p1()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE spa CHAR(16);
DECLARE spb INT;
DECLARE cur1 CURSOR FOR SELECT name,
(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
FROM mysqltest1.t1;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
OPEN cur1;
SET AUTOCOMMIT=0;
REPEAT
FETCH cur1 INTO spa, spb;
IF NOT done THEN
START TRANSACTION;
INSERT INTO mysqltest1.t2 VALUES (spa,spb);
COMMIT;
END IF;
UNTIL done END REPEAT;
SET AUTOCOMMIT=1;
CLOSE cur1;
END|
CREATE PROCEDURE mysqltest1.p2()
BEGIN
INSERT INTO mysqltest1.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
END|
CALL mysqltest1.p2();
CALL mysqltest1.p1();
DROP PROCEDURE IF EXISTS mysqltest1.p1;
DROP PROCEDURE IF EXISTS mysqltest1.p2;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
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;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE PROCEDURE test.p1(IN i INT)
BEGIN
DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (num INT,PRIMARY KEY(num))ENGINE=NDBCLUSTER;
START TRANSACTION;
INSERT INTO test.t1 VALUES(i);
savepoint t1_save;
INSERT INTO test.t1 VALUES (14);
ROLLBACK to savepoint t1_save;
COMMIT;
END|
< ---- Master selects-- >
-------------------------
CALL test.p1(12);
Warnings:
Note 1051 Unknown table 't1'
SELECT * FROM test.t1;
num
12
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t1;
num
12
< ---- Master selects-- >
-------------------------
CALL test.p1(13);
SELECT * FROM test.t1;
num
13
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t1;
num
13
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
...@@ -25,11 +25,13 @@ hex(c2) hex(c3) c1 ...@@ -25,11 +25,13 @@ hex(c2) hex(c3) c1
0 1 BCDEF 0 1 BCDEF
1 0 CD 1 0 CD
0 0 DEFGHIJKL 0 0 DEFGHIJKL
CREATE TEMPORARY TABLE cluster_replication.backup_info (id INT, backup_id INT) ENGINE=HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP;
DELETE FROM cluster_replication.backup_info;
LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info;
@the_backup_id:=backup_id @the_backup_id:=backup_id
<the_backup_id> <the_backup_id>
DROP TABLE cluster_replication.backup_info;
UPDATE t1 SET c2=0 WHERE c3="row2"; UPDATE t1 SET c2=0 WHERE c3="row2";
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
hex(c1) hex(c2) c3 hex(c1) hex(c2) c3
......
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;
DROP TRIGGER test.t1_bi_t2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=NDB;
CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=NDB;
CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
INSERT INTO test.t2 VALUES (1, 0.0);
INSERT INTO test.t2 VALUES (1, 0.0);
Got one of the listed errors
select * from test.t1;
n d
1 1.234
select * from test.t2;
n f
1 0
select * from test.t1;
n d
1 1.234
select * from test.t2;
n f
1 0
DROP TRIGGER test.t1_bi_t2;
DROP TABLE test.t1;
DROP TABLE test.t2;
...@@ -11,7 +11,7 @@ set @var1= "from-master-1"; ...@@ -11,7 +11,7 @@ set @var1= "from-master-1";
execute stmt1 using @var1; execute stmt1 using @var1;
set @var1= "from-master-2-'',"; set @var1= "from-master-2-'',";
execute stmt1 using @var1; execute stmt1 using @var1;
select * from t1; SELECT * FROM t1 ORDER BY n;
n n
from-master-1 from-master-1
from-master-2-'', from-master-2-'',
...@@ -19,7 +19,7 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))'; ...@@ -19,7 +19,7 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))';
prepare stmt2 from @var2; prepare stmt2 from @var2;
set @var1='from-master-3'; set @var1='from-master-3';
execute stmt2 using @var1; execute stmt2 using @var1;
select * from t1; SELECT * FROM t1 ORDER BY n;
n n
from-master-1 from-master-1
from-master-2-'', from-master-2-'',
......
...@@ -25,11 +25,6 @@ SHOW TABLES; ...@@ -25,11 +25,6 @@ SHOW TABLES;
Tables_in_test_ignore Tables_in_test_ignore
t2 t2
INSERT INTO t2 VALUES (3,3), (4,4); INSERT INTO t2 VALUES (3,3), (4,4);
SHOW BINLOG EVENTS FROM 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 Query 1 195 use `test`; CREATE TABLE t1 (a INT, b INT)
master-bin.000001 195 Table_map 1 235 test.t1
master-bin.000001 235 Write_rows 1 282
**** On Slave **** **** On Slave ****
SHOW DATABASES; SHOW DATABASES;
Database Database
......
...@@ -7,7 +7,7 @@ start slave; ...@@ -7,7 +7,7 @@ start slave;
create table t1(a int not null primary key) engine=myisam; create table t1(a int not null primary key) engine=myisam;
insert delayed into t1 values (1),(2),(3); insert delayed into t1 values (1),(2),(3);
flush tables; flush tables;
select * from t1; SELECT * FROM t1 ORDER BY a;
a a
1 1
2 2
...@@ -19,7 +19,7 @@ master-bin.000001 102 Query 1 222 use `test`; create table t1(a int not null pri ...@@ -19,7 +19,7 @@ master-bin.000001 102 Query 1 222 use `test`; create table t1(a int not null pri
master-bin.000001 222 Table_map 1 261 test.t1 master-bin.000001 222 Table_map 1 261 test.t1
master-bin.000001 261 Write_rows 1 305 master-bin.000001 261 Write_rows 1 305
master-bin.000001 305 Query 1 380 use `test`; flush tables master-bin.000001 305 Query 1 380 use `test`; flush tables
select * from t1; SELECT * FROM t1 ORDER BY a;
a a
1 1
2 2
......
...@@ -29,17 +29,5 @@ a ...@@ -29,17 +29,5 @@ a
SELECT * FROM test.t2; SELECT * FROM test.t2;
a a
2 2
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 193 use `test`; DROP TABLE IF EXISTS test.t2
master-bin.000001 193 Query 1 299 use `test`; CREATE TABLE test.t1 (a INT,PRIMARY KEY(a))
master-bin.000001 299 Query 1 405 use `test`; CREATE TABLE test.t2 (a INT,PRIMARY KEY(a))
master-bin.000001 405 Table_map 1 444 test.t1
master-bin.000001 444 Write_rows 1 483
master-bin.000001 483 Table_map 1 540 mysql.proc
master-bin.000001 540 Write_rows 1 723
master-bin.000001 723 Table_map 1 762 test.t2
master-bin.000001 762 Write_rows 1 796
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
...@@ -12,6 +12,7 @@ CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=INNOD ...@@ -12,6 +12,7 @@ CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=INNOD
CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)// CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
INSERT INTO test.t2 VALUES (1, 0.0); INSERT INTO test.t2 VALUES (1, 0.0);
INSERT INTO test.t2 VALUES (1, 0.0); INSERT INTO test.t2 VALUES (1, 0.0);
Got one of the listed errors
select * from test.t1; select * from test.t1;
n d n d
1 1.234 1 1.234
......
...@@ -4,6 +4,9 @@ reset master; ...@@ -4,6 +4,9 @@ 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;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
create table t2 (a int auto_increment, primary key (a), b int); create table t2 (a int auto_increment, primary key (a), b int);
create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
# Do not use any TAB characters for whitespace. # Do not use any TAB characters for whitespace.
# #
############################################################################## ##############################################################################
events : Test case instability - infinite locking. To be fixed. events : Test case instability - infinite locking. To be fixed.
func_group : Bug#15448 func_group : Bug#15448
func_math : Bug#15448 func_math : Bug#15448
...@@ -19,6 +18,7 @@ ndb_autodiscover : Needs to be fixed w.r.t binlog ...@@ -19,6 +18,7 @@ ndb_autodiscover : Needs to be fixed w.r.t binlog
ndb_autodiscover2 : Needs to be fixed w.r.t binlog ndb_autodiscover2 : Needs to be fixed w.r.t binlog
ndb_binlog_basic : Results are not deterministic, Tomas will fix ndb_binlog_basic : Results are not deterministic, Tomas will fix
ndb_binlog_ddl_multi : Bug#17038 [PATCH PENDING] ndb_binlog_ddl_multi : Bug#17038 [PATCH PENDING]
ndb_dd_backuprestore : Bug#17045 NdbDictionaryImpl::fix_blob_events causes core
ndb_gis : garbled msgs from corrupt THD* ndb_gis : garbled msgs from corrupt THD*
partition_03ndb : Bug#16385 partition_03ndb : Bug#16385
ps_7ndb : dbug assert in RBR mode when executing test suite ps_7ndb : dbug assert in RBR mode when executing test suite
...@@ -26,7 +26,13 @@ rpl_bit_npk : Bug#13418 ...@@ -26,7 +26,13 @@ rpl_bit_npk : Bug#13418
rpl_ddl : Bug#15963 SBR does not show "Definer" correctly rpl_ddl : Bug#15963 SBR does not show "Definer" correctly
rpl_ndb_auto_inc : Bug#17086 rpl_ndb_auto_inc : Bug#17086
rpl_ndb_basic : Bug#16228 [IN REVIEW] rpl_ndb_basic : Bug#16228 [IN REVIEW]
rpl_ndb_charset : Bug#17246
rpl_ndb_ddl : Bug#17400: delete & update of rows in table without pk fails
rpl_ndb_delete_nowhere : Bug#17400: delete & update of rows in table without pk fails
rpl_ndb_multi_update3 : Bug#17400: delete & update of rows in table without pk fails
rpl_ndb_insert_ignore : Bugs: #17431: INSERT IGNORE INTO returns failed: 1296
rpl_ndb_relay_space : Bug#16993 rpl_ndb_relay_space : Bug#16993
rpl_ndb_sp007 : Bug #17290
rpl_sp : Bug#16456 rpl_sp : Bug#16456
rpl_until : Unstable test case, bug#15886 rpl_until : Unstable test case, bug#15886
sp-goto : GOTO is currently is disabled - will be fixed in the future sp-goto : GOTO is currently is disabled - will be fixed in the future
......
########################################
# Author: JBM
# Date: 2006-01-24
# Purpose: Test CDD backup and restore
########################################
-- source include/have_ndb.inc
--disable_warnings
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
DROP TABLE IF EXISTS test.t4;
DROP TABLE IF EXISTS test.t5;
DROP TABLE IF EXISTS test.t6;
--enable_warnings
############ Test 1 Simple DD backup and restore #############
-- echo **** Test 1 Simple DD backup and restore ****
CREATE LOGFILE GROUP log_group1
ADD UNDOFILE './log_group1/undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
CREATE TABLESPACE table_space1
ADD DATAFILE './table_space1/datafile.dat'
USE LOGFILE GROUP log_group1
INITIAL_SIZE 12M
ENGINE NDB;
CREATE TABLE test.t1
(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 CHAR(50) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL) TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
let $j= 500;
--disable_query_log
while ($j)
{
eval INSERT INTO test.t1 VALUES (NULL, "Sweden", $j, b'1');
dec $j;
}
--enable_query_log
SELECT COUNT(*) FROM test.t1;
SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-- source include/ndb_backup.inc
DROP TABLE test.t1;
ALTER TABLESPACE table_space1
DROP DATAFILE './table_space1/datafile.dat'
ENGINE = NDB;
DROP TABLESPACE table_space1
ENGINE = NDB;
DROP LOGFILE GROUP log_group1
ENGINE =NDB;
-- source include/ndb_restore_master.inc
SELECT COUNT(*) FROM test.t1;
SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
################# Mixed Cluster Test ############################
-- echo **** Test 2 Mixed Cluster Test backup and restore ****
CREATE TABLE test.t2
(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 VARCHAR(200) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL)ENGINE=NDB;
let $j= 500;
--disable_query_log
while ($j)
{
eval INSERT INTO test.t2 VALUES (NULL, "Sweden, Texas", $j, b'0');
dec $j;
}
--enable_query_log
CREATE TABLE test.t3 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
CREATE TABLE test.t4 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))ENGINE=NDB;
let $j= 50;
--disable_query_log
while ($j)
{
INSERT INTO test.t3 VALUES (NULL, repeat('a',1*1024));
INSERT INTO test.t3 VALUES (NULL, repeat('b',16*1024));
INSERT INTO test.t4 VALUES (NULL, repeat('a',1*1024));
INSERT INTO test.t4 VALUES (NULL, repeat('b',16*1024));
dec $j;
}
--enable_query_log
SELECT COUNT(*) FROM test.t1;
SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
SELECT COUNT(*) FROM test.t2;
SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
SELECT COUNT(*) FROM test.t3;
SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
SELECT COUNT(*) FROM test.t4;
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
-- source include/ndb_backup.inc
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
DROP TABLE test.t4;
ALTER TABLESPACE table_space1
DROP DATAFILE './table_space1/datafile.dat'
ENGINE = NDB;
DROP TABLESPACE table_space1
ENGINE = NDB;
DROP LOGFILE GROUP log_group1
ENGINE =NDB;
-- source include/ndb_restore_master.inc
SELECT COUNT(*) FROM test.t1;
SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
SELECT COUNT(*) FROM test.t2;
SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
SELECT COUNT(*) FROM test.t3;
SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
SELECT COUNT(*) FROM test.t4;
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
DROP TABLE test.t4;
###################### Adding partition #################################
-- echo **** Test 3 Adding partition Test backup and restore ****
CREATE TABLESPACE table_space2
ADD DATAFILE './table_space2/datafile.dat'
USE LOGFILE GROUP log_group1
INITIAL_SIZE 12M
ENGINE NDB;
CREATE TABLE test.t1 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(150) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 4;
CREATE TABLE test.t4 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(180) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 2;
CREATE TABLE test.t2 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY KEY(c3) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
CREATE TABLE test.t5 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY KEY(pk1) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
CREATE TABLE test.t3 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(202) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY RANGE (c3) PARTITIONS 3 (PARTITION x1 VALUES LESS THAN (105), PARTITION x2 VALUES LESS THAN (333), PARTITION x3 VALUES LESS THAN (720));
CREATE TABLE test.t6 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(220) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY RANGE (pk1) PARTITIONS 2 (PARTITION x1 VALUES LESS THAN (333), PARTITION x2 VALUES LESS THAN (720));
SHOW CREATE TABLE test.t1;
SHOW CREATE TABLE test.t2;
SHOW CREATE TABLE test.t3;
SHOW CREATE TABLE test.t4;
SHOW CREATE TABLE test.t5;
SHOW CREATE TABLE test.t6;
SELECT * FROM information_schema.partitions WHERE table_name= 't1';
SELECT * FROM information_schema.partitions WHERE table_name= 't2';
SELECT * FROM information_schema.partitions WHERE table_name= 't3';
SELECT * FROM information_schema.partitions WHERE table_name= 't4';
SELECT * FROM information_schema.partitions WHERE table_name= 't5';
SELECT * FROM information_schema.partitions WHERE table_name= 't6';
let $j= 500;
--disable_query_log
while ($j)
{
eval INSERT INTO test.t1 VALUES (NULL, "Sweden, Texas", $j, b'0');
eval INSERT INTO test.t4 VALUES (NULL, "Sweden, Texas", $j, b'0');
dec $j;
eval INSERT INTO test.t2 VALUES (NULL, "Sweden, Texas, ITALY, Kyle, JO, JBM,TU", $j, b'1');
eval INSERT INTO test.t5 VALUES (NULL, "Sweden, Texas, ITALY, Kyle, JO, JBM,TU", $j, b'1');
dec $j;
eval INSERT INTO test.t3 VALUES (NULL, "TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU", $j, b'1');
eval INSERT INTO test.t6 VALUES (NULL, "TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU", $j, b'1'); } --enable_query_log
SELECT COUNT(*) FROM test.t1;
SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t2;
SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t3;
SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t4;
SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t5;
SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t6;
SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
-- source include/ndb_backup.inc
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
DROP TABLE test.t4;
DROP TABLE test.t5;
DROP TABLE test.t6;
ALTER TABLESPACE table_space1
DROP DATAFILE './table_space1/datafile.dat'
ENGINE = NDB;
ALTER TABLESPACE table_space2
DROP DATAFILE './table_space2/datafile.dat'
ENGINE = NDB;
DROP TABLESPACE table_space1
ENGINE = NDB;
DROP TABLESPACE table_space2
ENGINE = NDB;
DROP LOGFILE GROUP log_group1
ENGINE =NDB;
-- source include/ndb_restore_master.inc
SHOW CREATE TABLE test.t1;
SHOW CREATE TABLE test.t2;
SHOW CREATE TABLE test.t3;
SHOW CREATE TABLE test.t4;
SHOW CREATE TABLE test.t5;
SHOW CREATE TABLE test.t6;
SELECT * FROM information_schema.partitions WHERE table_name= 't1';
SELECT * FROM information_schema.partitions WHERE table_name= 't2';
SELECT * FROM information_schema.partitions WHERE table_name= 't3';
SELECT * FROM information_schema.partitions WHERE table_name= 't4';
SELECT * FROM information_schema.partitions WHERE table_name= 't5';
SELECT * FROM information_schema.partitions WHERE table_name= 't6';
SELECT COUNT(*) FROM test.t1;
SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t2;
SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t3;
SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t4;
SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t5;
SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
SELECT COUNT(*) FROM test.t6;
SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
# Cleanup
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
DROP TABLE test.t4;
DROP TABLE test.t5;
DROP TABLE test.t6;
ALTER TABLESPACE table_space1 DROP DATAFILE './table_space1/datafile.dat' ENGINE=NDB;
ALTER TABLESPACE table_space2 DROP DATAFILE './table_space2/datafile.dat' ENGINE=NDB;
DROP TABLESPACE table_space1 ENGINE = NDB;
DROP TABLESPACE table_space2 ENGINE = NDB;
DROP LOGFILE GROUP log_group1 ENGINE = NDB;
#End 5.1 test case
########################################################
# By JBM 2006-02-14 Wrapped to share test code between #
# engines. Added to skip test when NDB is default #
########################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam; let $engine_type=myisam;
-- source extra/rpl_tests/rpl_EE_err.test -- source extra/rpl_tests/rpl_EE_err.test
##################################### #####################################
# Wrapper for rpl_auto_increment.test# # Wrapper for rpl_auto_increment.test#
##################################### #####################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=innodb; let $engine_type=innodb;
let $engine_type2=myisam; let $engine_type2=myisam;
......
##################################### #####################################
# Wrapper for rpl_commit_after_flush# # Wrapper for rpl_commit_after_flush#
##################################### #####################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=innodb; let $engine_type=innodb;
-- source extra/rpl_tests/rpl_commit_after_flush.test -- source extra/rpl_tests/rpl_commit_after_flush.test
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
# routine "include/rpl_stmt_seq.inc" performs a # routine "include/rpl_stmt_seq.inc" performs a
# eval SELECT CONCAT('######## ','$my_stmt',' ########') as ""; # eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
# #
--source include/not_ndb_default.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/master-slave.inc --source include/master-slave.inc
let $engine_type= "InnoDB"; let $engine_type= "InnoDB";
......
################################ ################################
# Wrapper for rpl_deadlock.test# # Wrapper for rpl_deadlock.test#
################################ ################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=innodb; let $engine_type=innodb;
-- source extra/rpl_tests/rpl_deadlock.test -- source extra/rpl_tests/rpl_deadlock.test
###################################################
# By JBM 2006-02-14 added to skip test when NDB #
##################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam; let $engine_type=myisam;
-- source extra/rpl_tests/rpl_delete_no_where.test -- source extra/rpl_tests/rpl_delete_no_where.test
####################################### #######################################
# Wrapper for rpl_failed_optimize.test# # Wrapper for rpl_failed_optimize.test#
####################################### #######################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=InnoDB; let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_failed_optimize.test -- source extra/rpl_tests/rpl_failed_optimize.test
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# Change Date: 2006-01-17 # Change Date: 2006-01-17
# Change: FK not supported, skip test when NDB is forced # Change: FK not supported, skip test when NDB is forced
#################################### ####################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=INNODB; let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_foreign_key.test -- source extra/rpl_tests/rpl_foreign_key.test
################################# #################################
# Wrapper for rpl_insert_id.test# # Wrapper for rpl_insert_id.test#
################################# #################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=innodb; let $engine_type=innodb;
-- source extra/rpl_tests/rpl_insert_id.test -- source extra/rpl_tests/rpl_insert_id.test
################################# #################################
# Wrapper for rpl_insert_id.test# # Wrapper for rpl_insert_id.test#
################################# #################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=innodb; let $engine_type=innodb;
-- source extra/rpl_tests/rpl_insert_id_pk.test -- source extra/rpl_tests/rpl_insert_id_pk.test
##################################### #####################################
# Wrapper for rpl_insert_ignore.test# # Wrapper for rpl_insert_ignore.test#
##################################### #####################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=innodb; let $engine_type=innodb;
let $engine_type2=myisam; let $engine_type2=myisam;
......
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
let $engine_type=MyISAM; let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_loaddata.test -- source extra/rpl_tests/rpl_loaddata.test
...@@ -36,6 +36,9 @@ delimiter ;| ...@@ -36,6 +36,9 @@ delimiter ;|
CALL test.p1(); CALL test.p1();
SELECT * FROM test.t1 ORDER BY blob_column; SELECT * FROM test.t1 ORDER BY blob_column;
save_master_pos; save_master_pos;
# Need to allow some time when NDB engine is used for
# the injector thread to have time to populate binlog
sleep 10;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
SELECT * FROM test.t1 ORDER BY blob_column; SELECT * FROM test.t1 ORDER BY blob_column;
......
source include/master-slave.inc; source include/master-slave.inc;
create table t1 (a int); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t2 values (1); insert into t2 values (1);
delete t1.* from t1, t2 where t1.a = t2.a; delete t1.* from t1, t2 where t1.a = t2.a;
save_master_pos; save_master_pos;
......
...@@ -36,7 +36,7 @@ select * from a; ...@@ -36,7 +36,7 @@ select * from a;
# BUG#3461 # BUG#3461
connection master; connection master;
create table t1 (a int); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
......
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
let $engine_type=MyISAM; let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_multi_update.test -- source extra/rpl_tests/rpl_multi_update.test
#######################################################
# Wrapper for rpl_multi_update2.test to allow multi #
# Engines to reuse test code. By JBM 2006-02-15 #
# Added comments section and to skip when ndb is #
# Default engine. #
#######################################################
--source include/not_ndb_default.inc
let $engine_type=MyISAM; let $engine_type=MyISAM;
--source extra/rpl_tests/rpl_multi_update2.test --source extra/rpl_tests/rpl_multi_update2.test
#######################################################
# Wrapper for rpl_multi_update3.test to allow multi #
# Engines to reuse test code. By JBM 2006-02-15 #
# Added comments section and to skip when ndb is #
# Default engine. #
#######################################################
--source include/not_ndb_default.inc
let $engine_type=MyISAM; let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_multi_update3.test -- source extra/rpl_tests/rpl_multi_update3.test
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
########################################################
--source include/have_ndb.inc
let $engine_type=NDB;
--source extra/rpl_tests/rpl_row_UUID.test
--auto-increment-increment=10 --auto-increment-offset=2
#
# Test of auto_increment in CRBR
#
##################################### #####################################
# Wrapper for rpl_auto_increment.test# # By: JBM
# Date: 2006-02-10
# Change: Augmented test to use with cluster
##################################### #####################################
-- source include/have_innodb.inc -- source include/master-slave.inc
let $engine_type=NDB;
let $engine_type2=myisam; --echo ***************** Test 1 ************************
-- source extra/rpl_tests/rpl_auto_increment.test --echo
CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3;
insert into t1 values (NULL,1),(NULL,2),(NULL,3);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=NDB;
insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
delete from t1 where b=4;
insert into t1 values (NULL,5),(NULL,6);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
# Insert with 2 insert statements to get better testing of logging
insert into t1 values (NULL),(5),(NULL);
insert into t1 values (250),(NULL);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
insert into t1 values (1000);
set @@insert_id=400;
insert into t1 values(NULL),(NULL);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
# Insert with 2 insert statements to get better testing of logging
insert into t1 values (NULL),(5),(NULL),(NULL);
insert into t1 values (500),(NULL),(502),(NULL),(600);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
set @@insert_id=600;
# We expect a duplicate key error that we will ignore below
--error 1022
insert into t1 values(600),(NULL),(NULL);
set @@insert_id=600;
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
#
# Test that auto-increment works when slave has rows in the table
#
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
sync_slave_with_master;
insert into t1 values(2),(12),(22),(32),(42);
connection master;
insert into t1 values (NULL),(NULL);
insert into t1 values (3),(NULL),(NULL);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
--echo ** Slave should have 2, 12, 22, 32, 42 **
--echo ** Master will have 2 but not 12, 22, 32, 42 **
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
# End cleanup
sync_slave_with_master;
#################################
# Wrapper for rpl_row_blob.test #
# Using wrapper to share test #
# code between engine tests #
#################################
-- source include/have_ndb.inc
let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_blob.test
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
########################################################
--source include/have_ndb.inc
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_row_charset.test
#####################################
# Wrapper for rpl_commit_after_flush#
# Wrapped to reuse test code on #
# Different engines #
# By JBM 2004-02-15 #
#####################################
-- source include/have_ndb.inc
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_commit_after_flush.test
######################## rpl_ddl.test ########################
# #
# DDL statements (sometimes with implicit COMMIT) executed #
# by the master and it's propagation into the slave #
# #
##############################################################
#
# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
#
# 1. !All! objects to be dropped, renamed, altered ... must be created
# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test
# sequences start.
#
# 2. Never use a test object, which was direct or indirect affected by a
# preceeding test sequence again.
# Except table d1.t1 where ONLY DML is allowed.
#
# If one preceeding test sequence hits a (sometimes not good visible,
# because the sql error code of the statement might be 0) bug
# and these rules are ignored, a following test sequence might earn ugly
# effects like failing 'sync_slave_with_master', crashes of the slave or
# abort of the test case etc..
#
# 3. The assignment of the DDL command to be tested to $my_stmt can
# be a bit difficult. "'" must be avoided, because the test
# routine "include/rpl_stmt_seq.inc" performs a
# eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
#
--source include/have_ndb.inc
--source include/master-slave.inc
let $engine_type= "NDB";
-- source extra/rpl_tests/rpl_ddl.test
#########################################
# By JBM 2006-02-14 Test wrapping to #
# Share test code between engine tests #
#########################################
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_delete_no_where.test
...@@ -109,3 +109,8 @@ SELECT * FROM t1; ...@@ -109,3 +109,8 @@ SELECT * FROM t1;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> --replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master>
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
connection master;
DROP TABLE IF EXISTS t1;
# End of 5.1 Test
#####################################
# Wrapper for rpl_insert_ignore.test#
#####################################
-- source include/have_ndb.inc
let $engine_type=NDB;
let $engine_type2=myisam;
-- source extra/rpl_tests/rpl_insert_ignore.test
--replicate-ignore-table=nothing.sensible
############################################################
# By JBM 2006-02-15 Wrapper for rpl_multi_update2.test #
# to reuse test code between engine runs #
############################################################
-- source include/have_ndb.inc
let $engine_type=NDB;
--source extra/rpl_tests/rpl_multi_update2.test
############################################################
# By JBM 2006-02-15 Wrapper for rpl_multi_update3.test #
# to reuse test code between engine runs #
############################################################
-- source include/have_ndb.inc
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_multi_update3.test
-O max_relay_log_size=16384
--innodb
--log-warnings
############################################################
# By JBM 2006-02-15 Wrapper for rpl_relayrotate.test #
# to reuse test code between engine runs #
############################################################
-- source include/have_ndb.inc
-- source include/have_ndb_extra.inc
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_relayrotate.test
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
########################################################
--source include/have_ndb.inc
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_row_001.test
#################################
# Wrapper for rpl_row_sp003.test#
# These tests have been wrapped #
# so the same code can be used #
# For different engines #
#################################
-- source include/have_ndb.inc
let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_sp003.test
#################################
# Wrapper for rpl_row_sp006.test#
# These tests have been wrapped #
# so the same code can be used #
# For different engines #
#################################
-- source include/have_ndb.inc
let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_sp006.test
#################################
# Wrapper for rpl_row_sp007.test#
# These tests have been wrapped #
# so the same code can be used #
# For different engines #
#################################
-- source include/have_ndb.inc
let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_sp007.test
...@@ -27,12 +27,13 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; ...@@ -27,12 +27,13 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
# take a backup on master # take a backup on master
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat
CREATE TEMPORARY TABLE cluster_replication.backup_info (id INT, backup_id INT) ENGINE=HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP;
DELETE FROM cluster_replication.backup_info;
LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ',';
--replace_column 1 <the_backup_id> --replace_column 1 <the_backup_id>
SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info;
let the_backup_id=`select @the_backup_id` ; let the_backup_id=`select @the_backup_id` ;
DROP TABLE cluster_replication.backup_info;
# update a row # update a row
UPDATE t1 SET c2=0 WHERE c3="row2"; UPDATE t1 SET c2=0 WHERE c3="row2";
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
...@@ -129,3 +130,5 @@ connection slave; ...@@ -129,3 +130,5 @@ connection slave;
reset slave; reset slave;
# should now contain nothing # should now contain nothing
select * from cluster_replication.apply_status; select * from cluster_replication.apply_status;
# End 5.1 Test
#############################################################################
# Original Author: JBM #
# Original Date: 2006-02-14 #
#############################################################################
# TEST: Use before insert triggers and has the second insert fail #
# Test is wrapped to save code and share between engines #
#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
-- source include/have_ndb.inc
-- source include/master-slave.inc
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_trig004.test
...@@ -3,9 +3,14 @@ ...@@ -3,9 +3,14 @@
# You can replace OPTIMIZE by REPAIR. # You can replace OPTIMIZE by REPAIR.
##################################### #####################################
# Change Author: JBM # Change Author: JBM
# Change Date: 2006-01-17 # Change Date: 2006-02-09
# Change: # Change: NDB does not and will not support
# OPTIMIZE for memory tables. If and when
# it does support for Disk Data, a new
# version of this test will be need.
# Skipping this test if default engine = ndb
##################################### #####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc -- source include/master-slave.inc
create table t1 (a int not null auto_increment primary key, b int, key(b)); create table t1 (a int not null auto_increment primary key, b int, key(b));
......
# #
# Test of replicating user variables # Test of replicating user variables
# #
###########################################################
# 2006-02-08 By JBM added order by for use w/ NDB engine
###########################################################
source include/master-slave.inc; source include/master-slave.inc;
#save_master_pos; #save_master_pos;
...@@ -20,7 +23,7 @@ set @var1= "from-master-1"; ...@@ -20,7 +23,7 @@ set @var1= "from-master-1";
execute stmt1 using @var1; execute stmt1 using @var1;
set @var1= "from-master-2-'',"; set @var1= "from-master-2-'',";
execute stmt1 using @var1; execute stmt1 using @var1;
select * from t1; SELECT * FROM t1 ORDER BY n;
set @var2= 'insert into t1 values (concat("from-var-", ?))'; set @var2= 'insert into t1 values (concat("from-var-", ?))';
prepare stmt2 from @var2; prepare stmt2 from @var2;
...@@ -30,7 +33,7 @@ execute stmt2 using @var1; ...@@ -30,7 +33,7 @@ execute stmt2 using @var1;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
select * from t1; SELECT * FROM t1 ORDER BY n;
connection master; connection master;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#Change Date: 2006-02-03 # #Change Date: 2006-02-03 #
#Change: Added Comments # #Change: Added Comments #
################################### ###################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=InnoDB; let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_sv_relay_space.test -- source extra/rpl_tests/rpl_sv_relay_space.test
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#Change Date: 2006-02-03 # #Change Date: 2006-02-03 #
#Change: Added Comments # #Change: Added Comments #
################################### ###################################
-- source include/not_ndb_default.inc
let $engine_type=MyISAM; let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_sv_relay_space.test -- source extra/rpl_tests/rpl_sv_relay_space.test
#######################################################
# Wrapper for rpl_relayrotate.test to allow multi #
# Engines to reuse test code. By JBM 2006-02-15 #
# Added comments section and to skip when ndb is #
# Default engine. #
#######################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=innodb; let $engine_type=innodb;
-- source extra/rpl_tests/rpl_relayrotate.test -- source extra/rpl_tests/rpl_relayrotate.test
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
let $engine_type=MYISAM; let $engine_type=MYISAM;
-- source extra/rpl_tests/rpl_row_001.test -- source extra/rpl_tests/rpl_row_001.test
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam; let $engine_type=myisam;
--source extra/rpl_tests/rpl_row_UUID.test --source extra/rpl_tests/rpl_row_UUID.test
...@@ -17,7 +17,7 @@ USE test_ignore; ...@@ -17,7 +17,7 @@ USE test_ignore;
CREATE TABLE t2 (a INT, b INT); CREATE TABLE t2 (a INT, b INT);
SHOW TABLES; SHOW TABLES;
INSERT INTO t2 VALUES (3,3), (4,4); INSERT INTO t2 VALUES (3,3), (4,4);
SHOW BINLOG EVENTS FROM 102; #SHOW BINLOG EVENTS FROM 102;
sync_slave_with_master; sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
SHOW DATABASES; SHOW DATABASES;
......
################################# #################################
# Wrapper for rpl_row_blob.test# # Wrapper for rpl_row_blob.test#
################################# #################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=InnoDB; let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_row_blob.test -- source extra/rpl_tests/rpl_row_blob.test
......
################################# #################################
# Wrapper for rpl_row_blob.test# # Wrapper for rpl_row_blob.test#
################################# #################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam; let $engine_type=myisam;
-- source extra/rpl_tests/rpl_row_blob.test -- source extra/rpl_tests/rpl_row_blob.test
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam; let $engine_type=myisam;
-- source extra/rpl_tests/rpl_row_charset.test -- source extra/rpl_tests/rpl_row_charset.test
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam; let $engine_type=myisam;
-- source extra/rpl_tests/rpl_row_delayed_ins.test -- source extra/rpl_tests/rpl_row_delayed_ins.test
################################### ###################################
# Wrapper for rpl_row_func003.test# # Wrapper for rpl_row_func003.test#
################################### ###################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=INNODB; let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_func003.test -- source extra/rpl_tests/rpl_row_func003.test
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
# Same test. NDB produced a diff # # Same test. NDB produced a diff #
# bin-log # # bin-log #
################################### ###################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc -- source include/have_binlog_format_row.inc
let $engine_type=MyISAM; let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_log.test -- source extra/rpl_tests/rpl_log.test
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# Same test. NDB produced a diff # # Same test. NDB produced a diff #
# bin-log # # bin-log #
################################### ###################################
-- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc -- source include/have_binlog_format_row.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=InnoDB; let $engine_type=InnoDB;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# Test of manual relay log rotation with FLUSH LOGS. # Test of manual relay log rotation with FLUSH LOGS.
# Requires statement logging # Requires statement logging
-- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc -- source include/have_binlog_format_row.inc
-- source extra/rpl_tests/rpl_max_relay_size.test -- source extra/rpl_tests/rpl_max_relay_size.test
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_row_multi_update3.test
################################# #################################
# Wrapper for rpl_row_sp002.test# # Wrapper for rpl_row_sp002.test#
################################# #################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=INNODB; let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_sp002.test -- source extra/rpl_tests/rpl_row_sp002.test
################################# #################################
# Wrapper for rpl_row_sp003.test# # Wrapper for rpl_row_sp003.test#
################################# #################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=INNODB; let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_sp003.test -- source extra/rpl_tests/rpl_row_sp003.test
################################# #################################
# Wrapper for rpl_row_sp006.test# # Wrapper for rpl_row_sp006.test#
################################# #################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
let $engine_type=InnoDB; let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_row_sp006.test -- source extra/rpl_tests/rpl_row_sp006.test
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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