summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/r/rpl_insert_id.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/rpl/r/rpl_insert_id.result')
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id.result50
1 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result
index 05ef04e8a1d..00b41109884 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_id.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id.result
@@ -9,13 +9,16 @@
#
include/master-slave.inc
[connection master]
+connection master;
SET @old_concurrent_insert= @@global.concurrent_insert;
SET @@global.concurrent_insert= 0;
+connection master;
create table t1(a int auto_increment, key(a)) engine=myisam;
create table t2(b int auto_increment, c int, key(b)) engine=myisam;
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
+connection slave;
select * from t1 ORDER BY a;
a
1
@@ -25,6 +28,7 @@ a
select * from t2 ORDER BY b;
b c
1 4
+connection master;
drop table t1;
drop table t2;
create table t1(a int auto_increment, key(a)) engine=myisam;
@@ -35,6 +39,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
+connection slave;
select * from t1;
a
10
@@ -45,6 +50,7 @@ select * from t2;
b c
5 0
6 11
+connection master;
#
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
#
@@ -63,6 +69,7 @@ b c
7 11
8 12
9 13
+connection slave;
select * from t1 ORDER BY a;
a
10
@@ -76,21 +83,28 @@ b c
7 11
8 12
9 13
+connection master;
drop table t1;
drop table t2;
+connection slave;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
# FOREIGN_KEY_CHECKS
#
+connection master;
SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE ) engine=myisam;
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
Got one of the listed errors
+connection slave;
+connection master;
drop table t1;
+connection slave;
#
# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
#
+connection master;
set @@session.sql_auto_is_null=1;
create table t1(a int auto_increment, key(a)) engine=myisam;
create table t2(a int) engine=myisam;
@@ -100,9 +114,12 @@ insert into t2 (a) select a from t1 where a is null;
select * from t2;
a
1
+connection slave;
+connection slave;
select * from t2;
a
1
+connection master;
drop table t1;
drop table t2;
#
@@ -113,6 +130,7 @@ drop table t2;
#
# The solution is not to reset last_insert_id on enter to sub-statement.
#
+connection master;
drop function if exists bug15728;
drop function if exists bug15728_insert;
drop table if exists t1, t2;
@@ -178,6 +196,7 @@ id last_id
1 3
2 4
3 5
+connection slave;
select * from t1;
id last_id
1 0
@@ -191,6 +210,7 @@ id last_id
1 3
2 4
3 5
+connection master;
drop function bug15728;
drop function bug15728_insert;
drop table t1,t2;
@@ -211,20 +231,24 @@ insert into t1 values(null,100);
select * from t1 order by n;
n b
1 100
+connection slave;
insert into t1 values(null,200),(null,300);
delete from t1 where b <> 100;
select * from t1 order by n;
n b
1 100
+connection master;
replace into t1 values(null,100),(null,350);
select * from t1 order by n;
n b
2 100
3 350
+connection slave;
select * from t1 order by n;
n b
2 100
3 350
+connection master;
insert into t1 values (NULL,400),(3,500),(NULL,600) on duplicate key UPDATE n=1000;
select * from t1 order by n;
n b
@@ -232,12 +256,14 @@ n b
4 400
1000 350
1001 600
+connection slave;
select * from t1 order by n;
n b
2 100
4 400
1000 350
1001 600
+connection master;
drop table t1;
create table t1 (n int primary key auto_increment not null,
b int, unique(b)) engine=myisam;
@@ -245,21 +271,27 @@ insert into t1 values(null,100);
select * from t1 order by n;
n b
1 100
+connection slave;
insert into t1 values(null,200),(null,300);
delete from t1 where b <> 100;
select * from t1 order by n;
n b
1 100
+connection master;
insert into t1 values(null,100),(null,350) on duplicate key update n=2;
select * from t1 order by n;
n b
2 100
3 350
+connection slave;
select * from t1 order by n;
n b
2 100
3 350
+connection master;
drop table t1;
+connection slave;
+connection master;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
UNIQUE(b)) ENGINE=myisam;
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
@@ -267,10 +299,12 @@ SELECT * FROM t1 ORDER BY a;
a b
1 10
2 2
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 10
2 2
+connection master;
drop table t1;
CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL auto_increment,
@@ -309,6 +343,7 @@ id field_1 field_2 field_3
4 4 d 4d
5 5 e 5e
6 6 f 6f
+connection slave;
SELECT * FROM t1 ORDER BY id;
id field_1 field_2 field_3
1 1 a 1a
@@ -317,7 +352,9 @@ id field_1 field_2 field_3
4 4 d 4d
5 5 e 5e
6 6 f 6f
+connection master;
drop table t1, t2;
+connection master;
DROP PROCEDURE IF EXISTS p1;
DROP TABLE IF EXISTS t1, t2;
SELECT LAST_INSERT_ID(0);
@@ -345,12 +382,14 @@ id last_id
SELECT * FROM t2 ORDER BY id;
id last_id
1 0
+connection slave;
SELECT * FROM t1 ORDER BY id;
id last_id
0 1
SELECT * FROM t2 ORDER BY id;
id last_id
1 0
+connection master;
DROP PROCEDURE p1;
DROP TABLE t1, t2;
DROP PROCEDURE IF EXISTS p1;
@@ -396,7 +435,9 @@ INSERT INTO t1 VALUES (NULL, f2());
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
UPDATE t1 SET j= -1 WHERE i IS NULL;
INSERT INTO t1 (i) VALUES (NULL);
+connection master1;
INSERT INTO t1 (i) VALUES (NULL);
+connection master;
SELECT f3();
f3()
0
@@ -426,6 +467,7 @@ i
5
6
16
+connection slave;
SELECT * FROM t1;
i j
1 -1
@@ -452,19 +494,23 @@ i
5
6
16
+connection master;
DROP PROCEDURE p1;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
DROP TABLE t1, t2;
+connection slave;
#
# End of 5.0 tests
#
+connection master;
create table t2 (
id int not null auto_increment,
last_id int,
primary key (id)
) engine=myisam;
+connection master;
truncate table t2;
create table t1 (id tinyint primary key) engine=myisam;
create function insid() returns int
@@ -491,6 +537,7 @@ select * from t2 order by id;
id last_id
4 0
8 0
+connection slave;
select * from t1 order by id;
id
0
@@ -498,6 +545,7 @@ select * from t2 order by id;
id last_id
4 0
8 0
+connection master;
drop table t1;
drop function insid;
truncate table t2;
@@ -517,12 +565,14 @@ n b
select * from t2 order by id;
id last_id
1 3
+connection slave;
select * from t1 order by n;
n b
1 10
select * from t2 order by id;
id last_id
1 3
+connection master;
drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;