1
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
3
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
4
CREATE INDEX i1 on t1(c2);
6
INSERT INTO t1 (c2) values (0);
11
# 49032: Use the correct function to read the AUTOINC column value
13
DROP TABLE IF EXISTS t1;
14
CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
15
INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
17
#-- source include/restart_mysqld.inc
18
INSERT INTO t1(C2) VALUES ('innodb');
21
CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
22
INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
24
#-- source include/restart_mysqld.inc
25
INSERT INTO t1(C2) VALUES ('innodb');
30
# 47720: REPLACE INTO Autoincrement column with negative values
32
DROP TABLE IF EXISTS t1;
33
CREATE TABLE t1 (c1 INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
34
INSERT INTO t1 SET c1 = 1;
36
INSERT INTO t1 SET c1 = 2;
37
INSERT INTO t1 SET c1 = -1;
39
--error ER_DUP_ENTRY, ER_DUP_ENTRY
40
INSERT INTO t1 SET c1 = -1;
42
REPLACE INTO t1 VALUES (-1);
49
# 49497: Error 1467 (ER_AUTOINC_READ_FAILED) on inserting a negative value
51
DROP TABLE IF EXISTS t1;
52
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
53
INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL);
57
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
58
INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL);
62
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
63
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL);
64
INSERT INTO t1 VALUES (4), (5), (6), (NULL);
68
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
69
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5);
73
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
74
INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL);
80
## 55277: Failing assertion: auto_inc > 0
82
#DROP TABLE IF EXISTS t1;
83
#CREATE TABLE t1(c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
84
#INSERT INTO t1 VALUES (NULL);
85
#INSERT INTO t1 VALUES (18446744073709551615);
87
#-- source include/restart_mysqld.inc
88
#SHOW CREATE TABLE t1;
93
# restore environment to the state it was before this test execution
96
eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;