mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
10.0-base -> 10.0-monty
This commit is contained in:
33
mysql-test/suite/innodb/r/auto_increment_dup.result
Normal file
33
mysql-test/suite/innodb/r/auto_increment_dup.result
Normal file
@ -0,0 +1,33 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1(
|
||||
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
k INT,
|
||||
c CHAR(1),
|
||||
UNIQUE KEY(k)) ENGINE=InnoDB;
|
||||
#
|
||||
# Connection 1
|
||||
#
|
||||
SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1';
|
||||
affected rows: 0
|
||||
INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
|
||||
#
|
||||
# Connection 2
|
||||
#
|
||||
SET DEBUG_SYNC='start_ha_write_row WAIT_FOR continue2';
|
||||
affected rows: 0
|
||||
SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1';
|
||||
affected rows: 0
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
affected rows: 4
|
||||
info: Records: 3 Duplicates: 1 Warnings: 0
|
||||
SET DEBUG_SYNC='RESET';
|
||||
SELECT * FROM t1 ORDER BY k;
|
||||
id k c
|
||||
1 1 NULL
|
||||
4 2 1
|
||||
2 3 NULL
|
||||
5 4 NULL
|
||||
6 5 NULL
|
||||
DROP TABLE t1;
|
@ -3,11 +3,11 @@ RESET MASTER;
|
||||
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
|
||||
SHOW MASTER STATUS;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 380
|
||||
master-bin.000001 421
|
||||
SHOW STATUS LIKE 'binlog_snapshot_%';
|
||||
Variable_name Value
|
||||
binlog_snapshot_file master-bin.000001
|
||||
binlog_snapshot_position 380
|
||||
binlog_snapshot_position 421
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (0, "");
|
||||
# Connection con1
|
||||
@ -38,10 +38,10 @@ a b
|
||||
SHOW STATUS LIKE 'binlog_snapshot_%';
|
||||
Variable_name Value
|
||||
binlog_snapshot_file master-bin.000001
|
||||
binlog_snapshot_position 904
|
||||
binlog_snapshot_position 945
|
||||
SHOW MASTER STATUS;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 1316
|
||||
master-bin.000001 1357
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
a
|
||||
2
|
||||
@ -60,44 +60,45 @@ a b
|
||||
SHOW STATUS LIKE 'binlog_snapshot_%';
|
||||
Variable_name Value
|
||||
binlog_snapshot_file master-bin.000001
|
||||
binlog_snapshot_position 904
|
||||
binlog_snapshot_position 945
|
||||
SHOW MASTER STATUS;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 245
|
||||
master-bin.000002 326
|
||||
COMMIT;
|
||||
SHOW STATUS LIKE 'binlog_snapshot_%';
|
||||
Variable_name Value
|
||||
binlog_snapshot_file master-bin.000002
|
||||
binlog_snapshot_position 245
|
||||
binlog_snapshot_position 326
|
||||
SHOW MASTER STATUS;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 245
|
||||
master-bin.000002 326
|
||||
SHOW BINLOG EVENTS;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 245 Server ver: #, Binlog ver: #
|
||||
master-bin.000001 245 Query 1 380 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
|
||||
master-bin.000001 380 Query 1 492 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
|
||||
master-bin.000001 492 Query 1 560 BEGIN
|
||||
master-bin.000001 560 Query 1 648 use `test`; INSERT INTO t2 VALUES (2)
|
||||
master-bin.000001 648 Query 1 717 COMMIT
|
||||
master-bin.000001 717 Query 1 785 BEGIN
|
||||
master-bin.000001 785 Query 1 877 use `test`; INSERT INTO t1 VALUES (0, "")
|
||||
master-bin.000001 877 Xid 1 904 COMMIT /* XID */
|
||||
master-bin.000001 904 Query 1 972 BEGIN
|
||||
master-bin.000001 972 Query 1 1060 use `test`; INSERT INTO t2 VALUES (3)
|
||||
master-bin.000001 1060 Query 1 1129 COMMIT
|
||||
master-bin.000001 1129 Query 1 1197 BEGIN
|
||||
master-bin.000001 1197 Query 1 1289 use `test`; INSERT INTO t1 VALUES (4, "")
|
||||
master-bin.000001 1289 Xid 1 1316 COMMIT /* XID */
|
||||
master-bin.000001 1316 Query 1 1384 BEGIN
|
||||
master-bin.000001 1384 Query 1 1476 use `test`; INSERT INTO t1 VALUES (1, "")
|
||||
master-bin.000001 1476 Xid 1 1503 COMMIT /* XID */
|
||||
master-bin.000001 1503 Query 1 1571 BEGIN
|
||||
master-bin.000001 1571 Query 1 1668 use `test`; INSERT INTO t1 VALUES (2, "first")
|
||||
master-bin.000001 1668 Query 1 1766 use `test`; INSERT INTO t1 VALUES (2, "second")
|
||||
master-bin.000001 1766 Xid 1 1793 COMMIT /* XID */
|
||||
master-bin.000001 1793 Query 1 1861 BEGIN
|
||||
master-bin.000001 1861 Query 1 1953 use `test`; INSERT INTO t1 VALUES (3, "")
|
||||
master-bin.000001 1953 Xid 1 1980 COMMIT /* XID */
|
||||
master-bin.000001 1980 Rotate 1 2024 master-bin.000002;pos=4
|
||||
master-bin.000001 4 Format_desc 1 246 Server ver: #, Binlog ver: #
|
||||
master-bin.000001 246 Binlog_checkpoint 1 286 master-bin.000001
|
||||
master-bin.000001 286 Query 1 421 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
|
||||
master-bin.000001 421 Query 1 533 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
|
||||
master-bin.000001 533 Query 1 601 BEGIN
|
||||
master-bin.000001 601 Query 1 689 use `test`; INSERT INTO t2 VALUES (2)
|
||||
master-bin.000001 689 Query 1 758 COMMIT
|
||||
master-bin.000001 758 Query 1 826 BEGIN
|
||||
master-bin.000001 826 Query 1 918 use `test`; INSERT INTO t1 VALUES (0, "")
|
||||
master-bin.000001 918 Xid 1 945 COMMIT /* XID */
|
||||
master-bin.000001 945 Query 1 1013 BEGIN
|
||||
master-bin.000001 1013 Query 1 1101 use `test`; INSERT INTO t2 VALUES (3)
|
||||
master-bin.000001 1101 Query 1 1170 COMMIT
|
||||
master-bin.000001 1170 Query 1 1238 BEGIN
|
||||
master-bin.000001 1238 Query 1 1330 use `test`; INSERT INTO t1 VALUES (4, "")
|
||||
master-bin.000001 1330 Xid 1 1357 COMMIT /* XID */
|
||||
master-bin.000001 1357 Query 1 1425 BEGIN
|
||||
master-bin.000001 1425 Query 1 1517 use `test`; INSERT INTO t1 VALUES (1, "")
|
||||
master-bin.000001 1517 Xid 1 1544 COMMIT /* XID */
|
||||
master-bin.000001 1544 Query 1 1612 BEGIN
|
||||
master-bin.000001 1612 Query 1 1709 use `test`; INSERT INTO t1 VALUES (2, "first")
|
||||
master-bin.000001 1709 Query 1 1807 use `test`; INSERT INTO t1 VALUES (2, "second")
|
||||
master-bin.000001 1807 Xid 1 1834 COMMIT /* XID */
|
||||
master-bin.000001 1834 Query 1 1902 BEGIN
|
||||
master-bin.000001 1902 Query 1 1994 use `test`; INSERT INTO t1 VALUES (3, "")
|
||||
master-bin.000001 1994 Xid 1 2021 COMMIT /* XID */
|
||||
master-bin.000001 2021 Rotate 1 2065 master-bin.000002;pos=4
|
||||
DROP TABLE t1,t2;
|
||||
|
@ -1,3 +1,4 @@
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=3;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (0);
|
||||
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con1_waiting WAIT_FOR con3_queued";
|
||||
@ -30,6 +31,6 @@ a
|
||||
1
|
||||
2
|
||||
3
|
||||
InnoDB: Last MySQL binlog file position 0 906, file name ./master-bin.000001
|
||||
InnoDB: Last MySQL binlog file position 0 947, file name ./master-bin.000001
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
DROP TABLE t1;
|
||||
|
@ -1,3 +1,4 @@
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=3;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (0);
|
||||
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con1_waiting WAIT_FOR con3_queued";
|
||||
@ -31,6 +32,6 @@ a
|
||||
1
|
||||
2
|
||||
3
|
||||
InnoDB: Last MySQL binlog file position 0 906, file name ./master-bin.000001
|
||||
InnoDB: Last MySQL binlog file position 0 947, file name ./master-bin.000001
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
DROP TABLE t1;
|
||||
|
@ -36,7 +36,7 @@ COMMIT;
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
a b c d id
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
delete from t1;
|
||||
SET binlog_format= mixed;
|
||||
@ -58,7 +58,7 @@ a b c d 7
|
||||
a b c d 8
|
||||
a b c d 9
|
||||
a b c d 10
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2
|
||||
delete from t1;
|
||||
@ -81,7 +81,7 @@ a b c d 7
|
||||
a b c d 8
|
||||
a b c d 9
|
||||
a b c d 10
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2
|
||||
delete from t1;
|
||||
@ -104,7 +104,7 @@ a b c d 7
|
||||
a b c d 8
|
||||
a b c d 9
|
||||
a b c d 10
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2
|
||||
delete from t1;
|
||||
@ -117,7 +117,7 @@ COMMIT;
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
a b c d id
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
delete from t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -36,7 +36,7 @@ COMMIT;
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
a b c d id
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
delete from t1;
|
||||
SET binlog_format= mixed;
|
||||
@ -58,7 +58,7 @@ a b c d 7
|
||||
a b c d 8
|
||||
a b c d 9
|
||||
a b c d 10
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2
|
||||
delete from t1;
|
||||
@ -81,7 +81,7 @@ a b c d 7
|
||||
a b c d 8
|
||||
a b c d 9
|
||||
a b c d 10
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2
|
||||
delete from t1;
|
||||
@ -104,7 +104,7 @@ a b c d 7
|
||||
a b c d 8
|
||||
a b c d 9
|
||||
a b c d 10
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2
|
||||
delete from t1;
|
||||
@ -117,7 +117,7 @@ COMMIT;
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
a b c d id
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
delete from t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -2,7 +2,7 @@ drop table if exists t1;
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (9223372036854775807, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
9223372036854775807 NULL
|
||||
@ -10,7 +10,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (127, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
127 NULL
|
||||
@ -18,7 +18,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (255, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
255 NULL
|
||||
@ -26,7 +26,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (32767, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
32767 NULL
|
||||
@ -34,7 +34,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (65535, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
65535 NULL
|
||||
@ -42,7 +42,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (8388607, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
8388607 NULL
|
||||
@ -50,7 +50,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (16777215, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
16777215 NULL
|
||||
@ -58,7 +58,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (2147483647, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
2147483647 NULL
|
||||
@ -66,7 +66,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (4294967295, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
4294967295 NULL
|
||||
@ -74,7 +74,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (9223372036854775807, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
9223372036854775807 NULL
|
||||
@ -366,7 +366,7 @@ c1
|
||||
310
|
||||
400
|
||||
1000
|
||||
1110
|
||||
1010
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
@ -567,7 +567,7 @@ Variable_name Value
|
||||
auto_increment_increment 65535
|
||||
auto_increment_offset 65535
|
||||
INSERT INTO t1 VALUES (NULL),(NULL);
|
||||
ERROR 22003: Out of range value for column 't1' at row 167
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
@ -648,7 +648,7 @@ t2 CREATE TABLE `t2` (
|
||||
`n` int(10) unsigned NOT NULL,
|
||||
`o` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`m`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
@ -858,7 +858,7 @@ PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t2 SELECT c1 FROM t1;
|
||||
Got one of the listed errors
|
||||
INSERT INTO t2 SELECT NULL FROM t1;
|
||||
Got one of the listed errors
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
|
@ -98,8 +98,12 @@ CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(3,1);
|
||||
BEGIN;
|
||||
INSERT IGNORE INTO t1 VALUES(3,14);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
|
||||
BEGIN;
|
||||
INSERT IGNORE INTO t1 VALUES(3,23);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
COMMIT;
|
||||
a b
|
||||
|
@ -816,6 +816,8 @@ id
|
||||
1
|
||||
2
|
||||
insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '1-1' for key 'PRIMARY'
|
||||
commit;
|
||||
select id,id3 from t1;
|
||||
id id3
|
||||
|
@ -58,6 +58,7 @@ col89 float unsigned zerofill DEFAULT NULL,
|
||||
col90 tinyblob
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||
Warnings:
|
||||
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
Note 1291 Column 'col82' has duplicated value '' in ENUM
|
||||
Note 1291 Column 'col82' has duplicated value '' in ENUM
|
||||
INSERT INTO bug52745 SET
|
||||
|
@ -3,6 +3,6 @@ SET GLOBAL innodb_file_per_table=0;
|
||||
create table bug56947(a int not null) engine = innodb;
|
||||
CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB;
|
||||
alter table bug56947 add unique index (a);
|
||||
ERROR HY000: Table 'test.bug56947#1' already exists
|
||||
ERROR 42S01: Table 'test.bug56947#1' already exists
|
||||
drop table `bug56947#1`;
|
||||
drop table bug56947;
|
||||
|
@ -1480,10 +1480,15 @@ k a c
|
||||
1 6 2
|
||||
2 7 NULL
|
||||
insert ignore into t2 values (null,6,1),(10,8,1);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '6' for key 'idx_1'
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
0
|
||||
insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '6' for key 'idx_1'
|
||||
Warning 1062 Duplicate entry '8' for key 'idx_1'
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
11
|
||||
|
51
mysql-test/suite/innodb/t/auto_increment_dup.test
Normal file
51
mysql-test/suite/innodb/t/auto_increment_dup.test
Normal file
@ -0,0 +1,51 @@
|
||||
##########################################################################
|
||||
# LP bug #1035225 / MySQL bug #66301: INSERT ... ON DUPLICATE KEY UPDATE +
|
||||
# innodb_autoinc_lock_mode=1 is broken
|
||||
##########################################################################
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(
|
||||
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
k INT,
|
||||
c CHAR(1),
|
||||
UNIQUE KEY(k)) ENGINE=InnoDB;
|
||||
|
||||
--enable_info
|
||||
|
||||
--connect(con1, localhost, root)
|
||||
--connect(con2, localhost, root)
|
||||
|
||||
--connection con1
|
||||
|
||||
--echo #
|
||||
--echo # Connection 1
|
||||
--echo #
|
||||
SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1';
|
||||
--send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1'
|
||||
|
||||
--connection con2
|
||||
--echo #
|
||||
--echo # Connection 2
|
||||
--echo #
|
||||
SET DEBUG_SYNC='start_ha_write_row WAIT_FOR continue2';
|
||||
SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1';
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
|
||||
--connection con1
|
||||
--reap
|
||||
--disable_info
|
||||
SET DEBUG_SYNC='RESET';
|
||||
SELECT * FROM t1 ORDER BY k;
|
||||
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
|
||||
--connection default
|
||||
|
||||
DROP TABLE t1;
|
@ -17,6 +17,19 @@
|
||||
# Test that we get the correct position when we group commit several
|
||||
# transactions together.
|
||||
|
||||
# What we really want to test here is what happens when a group of
|
||||
# transactions get written only partially to disk inside InnoDB before
|
||||
# the crash. But that is hard to test in mysql-test-run automated
|
||||
# tests. Instead, we use debug_sync to tightly control when each
|
||||
# transaction is written to the redo log. And we set
|
||||
# innodb_flush_log_at_trx_commit=3 so that we can write out
|
||||
# transactions individually - as with
|
||||
# innodb_flush_log_at_trx_commit=1, all commits are written together,
|
||||
# as part of a commit_checkpoint.
|
||||
# (Note that we do not have to restore innodb_flush_log_at_trx_commit, as
|
||||
# we crash the server).
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=3;
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (0);
|
||||
|
||||
|
@ -17,6 +17,19 @@
|
||||
# Test that we get the correct position when we group commit several
|
||||
# transactions together.
|
||||
|
||||
# What we really want to test here is what happens when a group of
|
||||
# transactions get written only partially to disk inside InnoDB before
|
||||
# the crash. But that is hard to test in mysql-test-run automated
|
||||
# tests. Instead, we use debug_sync to tightly control when each
|
||||
# transaction is written to the redo log. And we set
|
||||
# innodb_flush_log_at_trx_commit=3 so that we can write out
|
||||
# transactions individually - as with
|
||||
# innodb_flush_log_at_trx_commit=1, all commits are written together,
|
||||
# as part of a commit_checkpoint.
|
||||
# (Note that we do not have to restore innodb_flush_log_at_trx_commit, as
|
||||
# we crash the server).
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=3;
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (0);
|
||||
|
||||
|
@ -66,7 +66,7 @@ while ($numtests)
|
||||
# table and binlog should be in sync.
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
--replace_column 2 # 5 #
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
|
||||
delete from t1;
|
||||
|
||||
|
@ -66,7 +66,7 @@ while ($numtests)
|
||||
# table and binlog should be in sync.
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
--replace_column 2 # 5 #
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
SHOW BINLOG EVENTS LIMIT 3,1;
|
||||
|
||||
delete from t1;
|
||||
|
||||
|
@ -11,7 +11,7 @@ drop table if exists t1;
|
||||
#
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (9223372036854775807, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@ -22,14 +22,14 @@ DROP TABLE t1;
|
||||
# TINYINT
|
||||
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (127, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (255, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@ -38,14 +38,14 @@ DROP TABLE t1;
|
||||
#
|
||||
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (32767, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (65535, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@ -54,14 +54,14 @@ DROP TABLE t1;
|
||||
#
|
||||
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (8388607, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (16777215, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@ -70,14 +70,14 @@ DROP TABLE t1;
|
||||
#
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (2147483647, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (4294967295, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@ -86,7 +86,7 @@ DROP TABLE t1;
|
||||
#
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (9223372036854775807, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
-- error 167
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@ -349,7 +349,7 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
--error ER_WARN_DATA_OUT_OF_RANGE
|
||||
--error 167
|
||||
INSERT INTO t1 VALUES (NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@ -437,7 +437,7 @@ CREATE TABLE t2(
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t2 SELECT c1 FROM t1;
|
||||
-- error ER_DUP_ENTRY,1467
|
||||
-- error 167
|
||||
INSERT INTO t2 SELECT NULL FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
@ -1,9 +1,9 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
if (`select plugin_auth_version <= "1.1.8-26.0" from information_schema.plugins where plugin_name='innodb'`)
|
||||
if (`select plugin_auth_version <= "1.0.17-13.01" from information_schema.plugins where plugin_name='innodb'`)
|
||||
{
|
||||
--skip Not fixed in XtraDB 1.1.8-26.0 or earlier
|
||||
--skip Not fixed in XtraDB 1.0.17-13.01 or earlier
|
||||
}
|
||||
|
||||
create table t1 (
|
||||
|
Reference in New Issue
Block a user