mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
174 lines
2.6 KiB
Text
174 lines
2.6 KiB
Text
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;
|
|
***************** 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);
|
|
******* Select from Master *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a b
|
|
3 1
|
|
4 2
|
|
5 3
|
|
******* Select from Slave *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a b
|
|
3 1
|
|
4 2
|
|
5 3
|
|
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);
|
|
******* Select from Master *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a b
|
|
1 1
|
|
2 2
|
|
3 3
|
|
5 5
|
|
6 6
|
|
******* Select from Slave *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a b
|
|
1 1
|
|
2 2
|
|
3 3
|
|
5 5
|
|
6 6
|
|
drop table t1;
|
|
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
|
|
insert into t1 values (NULL),(5),(NULL);
|
|
insert into t1 values (250),(NULL);
|
|
******* Select from Master *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a
|
|
1
|
|
5
|
|
6
|
|
250
|
|
251
|
|
insert into t1 values (1000);
|
|
set @@insert_id=400;
|
|
insert into t1 values(NULL),(NULL);
|
|
******* Select from Master *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a
|
|
1
|
|
5
|
|
6
|
|
250
|
|
251
|
|
400
|
|
1000
|
|
1001
|
|
******* Select from Slave *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a
|
|
1
|
|
5
|
|
6
|
|
250
|
|
251
|
|
400
|
|
1000
|
|
1001
|
|
drop table t1;
|
|
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
|
|
insert into t1 values (NULL),(5),(NULL),(NULL);
|
|
insert into t1 values (500),(NULL),(502),(NULL),(600);
|
|
******* Select from Master *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a
|
|
1
|
|
5
|
|
6
|
|
7
|
|
500
|
|
501
|
|
502
|
|
503
|
|
600
|
|
set @@insert_id=600;
|
|
insert into t1 values(600),(NULL),(NULL);
|
|
ERROR 23000: Can't write; duplicate key in table 't1'
|
|
set @@insert_id=600;
|
|
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
|
|
******* Select from Master *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a
|
|
1
|
|
5
|
|
6
|
|
7
|
|
500
|
|
501
|
|
502
|
|
503
|
|
600
|
|
603
|
|
604
|
|
610
|
|
611
|
|
******* Select from Slave *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a
|
|
1
|
|
5
|
|
6
|
|
7
|
|
500
|
|
501
|
|
502
|
|
503
|
|
600
|
|
603
|
|
604
|
|
610
|
|
611
|
|
drop table t1;
|
|
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
|
|
insert into t1 values(2),(12),(22),(32),(42);
|
|
insert into t1 values (NULL),(NULL);
|
|
insert into t1 values (3),(NULL),(NULL);
|
|
******* Select from Master *************
|
|
|
|
select * from t1 ORDER BY a;
|
|
a
|
|
1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
******* Select from Slave *************
|
|
|
|
** 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
|
|
1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
12
|
|
22
|
|
32
|
|
42
|
|
drop table t1;
|