Debian Codegraph @

mysql-test/suite/innodb/t/innodb-autoinc-44030.test

raw
1 #
2 # 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from
3 # the index (PRIMARY)
4 # This test requires a restart of the server
5 SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
6 CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
7 INSERT INTO t1 VALUES (null);
8 INSERT INTO t1 VALUES (null);
9 ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
10 SELECT * FROM t1;
11 # Restart the server
12 -- source include/restart_mysqld.inc
13 # The MySQL and InnoDB data dictionaries should now be out of sync.
14 # The select should print message to the error log
15 SELECT * FROM t1;
16 # MySQL have made a change (http://lists.mysql.com/commits/75268) that no
17 # longer results in the two data dictionaries being out of sync. If they
18 # revert their changes then this check for ER_AUTOINC_READ_FAILED will need
19 # to be enabled. Also, see http://bugs.mysql.com/bug.php?id=47621.
20 #-- error ER_AUTOINC_READ_FAILED,1467
21 INSERT INTO t1 VALUES(null);
22 # Before WL#5534, the following statement would copy the table,
23 # and effectively set AUTO_INCREMENT to 4, because while copying
24 # it would write values 1,2,3 to the column.
25 # WL#5534 makes this an in-place ALTER, setting AUTO_INCREMENT=3 for real.
26 # However, to keep compatibility with ALGORITHM=COPY MySQL 5.6.11 will
27 # go back to the original behaviour, setting AUTO_INCREMENT to 4.
28 --enable_info
29 ALTER TABLE t1 AUTO_INCREMENT = 3;
30 --disable_info
31 SHOW CREATE TABLE t1;
32 INSERT INTO t1 VALUES(null);
33 INSERT INTO t1 VALUES(null);
34 SELECT * FROM t1;
35 DROP TABLE t1;