mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Adding proper setup phase for test case rpl_insert_id
mysql-test/r/rpl_insert_id.result: Updated result file
This commit is contained in:
@ -1,9 +1,20 @@
|
|||||||
|
#
|
||||||
|
# Setup
|
||||||
|
#
|
||||||
stop slave;
|
stop 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;
|
||||||
reset master;
|
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;
|
||||||
|
use test;
|
||||||
|
drop table if exists t1, t2, t3;
|
||||||
|
#
|
||||||
|
# See if queries that use both auto_increment and LAST_INSERT_ID()
|
||||||
|
# are replicated well
|
||||||
|
#
|
||||||
|
# We also check how the foreign_key_check variable is replicated
|
||||||
|
#
|
||||||
create table t1(a int auto_increment, key(a));
|
create table t1(a int auto_increment, key(a));
|
||||||
create table t2(b int auto_increment, c int, key(b));
|
create table t2(b int auto_increment, c int, key(b));
|
||||||
insert into t1 values (1),(2),(3);
|
insert into t1 values (1),(2),(3);
|
||||||
@ -38,6 +49,9 @@ select * from t2;
|
|||||||
b c
|
b c
|
||||||
5 0
|
5 0
|
||||||
6 11
|
6 11
|
||||||
|
#
|
||||||
|
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
|
||||||
|
#
|
||||||
drop table t2;
|
drop table t2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1(a int auto_increment, key(a));
|
create table t1(a int auto_increment, key(a));
|
||||||
@ -68,11 +82,18 @@ b c
|
|||||||
9 13
|
9 13
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
#
|
||||||
|
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
|
||||||
|
# FOREIGN_KEY_CHECKS
|
||||||
|
#
|
||||||
SET TIMESTAMP=1000000000;
|
SET TIMESTAMP=1000000000;
|
||||||
CREATE TABLE t1 ( a INT UNIQUE );
|
CREATE TABLE t1 ( a INT UNIQUE );
|
||||||
SET FOREIGN_KEY_CHECKS=0;
|
SET FOREIGN_KEY_CHECKS=0;
|
||||||
INSERT INTO t1 VALUES (1),(1);
|
INSERT INTO t1 VALUES (1),(1);
|
||||||
ERROR 23000: Duplicate entry '1' for key 1
|
ERROR 23000: Duplicate entry '1' for key 1
|
||||||
|
#
|
||||||
|
# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
|
||||||
|
#
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1(a int auto_increment, key(a));
|
create table t1(a int auto_increment, key(a));
|
||||||
create table t2(a int);
|
create table t2(a int);
|
||||||
@ -87,3 +108,6 @@ a
|
|||||||
1
|
1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
#
|
||||||
|
# End of 4.1 tests
|
||||||
|
#
|
||||||
|
@ -1,10 +1,21 @@
|
|||||||
# See if queries that use both auto_increment and LAST_INSERT_ID()
|
--echo #
|
||||||
# are replicated well
|
--echo # Setup
|
||||||
|
--echo #
|
||||||
# We also check how the foreign_key_check variable is replicated
|
|
||||||
|
|
||||||
source include/master-slave.inc;
|
source include/master-slave.inc;
|
||||||
source include/have_innodb.inc;
|
source include/have_innodb.inc;
|
||||||
|
use test;
|
||||||
|
--disable_warnings
|
||||||
|
drop table if exists t1, t2, t3;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # See if queries that use both auto_increment and LAST_INSERT_ID()
|
||||||
|
--echo # are replicated well
|
||||||
|
--echo #
|
||||||
|
--echo # We also check how the foreign_key_check variable is replicated
|
||||||
|
--echo #
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
create table t1(a int auto_increment, key(a));
|
create table t1(a int auto_increment, key(a));
|
||||||
create table t2(b int auto_increment, c int, key(b));
|
create table t2(b int auto_increment, c int, key(b));
|
||||||
@ -39,7 +50,9 @@ select * from t1;
|
|||||||
select * from t2;
|
select * from t2;
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
|
--echo #
|
||||||
|
--echo # check if INSERT SELECT in auto_increment is well replicated (bug #490)
|
||||||
|
--echo #
|
||||||
|
|
||||||
drop table t2;
|
drop table t2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
@ -62,10 +75,11 @@ save_master_pos;
|
|||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
|
|
||||||
#
|
--echo #
|
||||||
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
|
--echo # Bug#8412: Error codes reported in binary log for CHARACTER SET,
|
||||||
# FOREIGN_KEY_CHECKS
|
--echo # FOREIGN_KEY_CHECKS
|
||||||
#
|
--echo #
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
SET TIMESTAMP=1000000000;
|
SET TIMESTAMP=1000000000;
|
||||||
CREATE TABLE t1 ( a INT UNIQUE );
|
CREATE TABLE t1 ( a INT UNIQUE );
|
||||||
@ -74,9 +88,10 @@ SET FOREIGN_KEY_CHECKS=0;
|
|||||||
INSERT INTO t1 VALUES (1),(1);
|
INSERT INTO t1 VALUES (1),(1);
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
#
|
--echo #
|
||||||
# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
|
--echo # Bug#14553: NULL in WHERE resets LAST_INSERT_ID
|
||||||
#
|
--echo #
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1(a int auto_increment, key(a));
|
create table t1(a int auto_increment, key(a));
|
||||||
@ -92,4 +107,7 @@ connection master;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
# End of 4.1 tests
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 4.1 tests
|
||||||
|
--echo #
|
||||||
|
Reference in New Issue
Block a user