mariadb/mysql-test/r/rpl_ndb_auto_inc.result

175 lines
2.6 KiB
Text
Raw Normal View History

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;
2006-02-13 16:36:11 +01:00
***************** 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);
2006-02-13 16:36:11 +01:00
******* Select from Master *************
select * from t1 ORDER BY a;
a b
2006-02-13 16:36:11 +01:00
3 1
4 2
5 3
******* Select from Slave *************
select * from t1 ORDER BY a;
a b
2006-02-13 16:36:11 +01:00
3 1
4 2
5 3
drop table t1;
2006-02-13 16:36:11 +01:00
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);
2006-02-13 16:36:11 +01:00
******* Select from Master *************
select * from t1 ORDER BY a;
a b
1 1
2 2
3 3
2006-02-13 16:36:11 +01:00
5 5
6 6
******* Select from Slave *************
select * from t1 ORDER BY a;
a b
1 1
2 2
3 3
2006-02-13 16:36:11 +01:00
5 5
6 6
drop table t1;
2006-02-13 16:36:11 +01:00
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);
2006-02-13 16:36:11 +01:00
******* Select from Master *************
select * from t1 ORDER BY a;
a
2006-02-13 16:36:11 +01:00
1
5
2006-02-13 16:36:11 +01:00
6
250
2006-02-13 16:36:11 +01:00
251
insert into t1 values (1000);
set @@insert_id=400;
insert into t1 values(NULL),(NULL);
2006-02-13 16:36:11 +01:00
******* Select from Master *************
select * from t1 ORDER BY a;
a
2006-02-13 16:36:11 +01:00
1
5
2006-02-13 16:36:11 +01:00
6
250
2006-02-13 16:36:11 +01:00
251
400
1000
2006-02-13 16:36:11 +01:00
1001
******* Select from Slave *************
select * from t1 ORDER BY a;
a
2006-02-13 16:36:11 +01:00
1
5
2006-02-13 16:36:11 +01:00
6
250
2006-02-13 16:36:11 +01:00
251
400
1000
2006-02-13 16:36:11 +01:00
1001
drop table t1;
2006-02-13 16:36:11 +01:00
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
insert into t1 values (NULL),(5),(NULL),(NULL);
2006-02-13 16:36:11 +01:00
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
2006-02-13 16:36:11 +01:00
600
set @@insert_id=600;
insert into t1 values(600),(NULL),(NULL);
2006-02-13 16:36:11 +01:00
ERROR 23000: Can't write; duplicate key in table 't1'
set @@insert_id=600;
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
2006-02-13 16:36:11 +01:00
******* Select from Master *************
select * from t1 ORDER BY a;
a
1
5
6
7
500
501
502
503
600
2006-02-13 16:36:11 +01:00
603
604
610
611
2006-02-13 16:36:11 +01:00
******* Select from Slave *************
select * from t1 ORDER BY a;
a
1
5
6
7
500
501
502
503
600
2006-02-13 16:36:11 +01:00
603
604
610
611
drop table t1;
2006-02-13 16:36:11 +01:00
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);
2006-02-13 16:36:11 +01:00
******* Select from Master *************
select * from t1 ORDER BY a;
a
1
2006-02-13 16:36:11 +01:00
2
3
2006-02-13 16:36:11 +01:00
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
2006-02-13 16:36:11 +01:00
4
5
12
22
32
42
drop table t1;