mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / innodb_plugin / t / innodb-autoinc-44030.test
blob150f6bb4f66adba187363031dafaa98701d5a320
1 -- source include/have_innodb_plugin.inc
2 # embedded server ignores 'delayed', so skip this
3 -- source include/not_embedded.inc
5 --disable_warnings
6 drop table if exists t1;
7 --enable_warnings
10 # 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from
11 # the index (PRIMARY)
12 # This test requires a restart of the server
13 SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
14 CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
15 INSERT INTO t1 VALUES (null);
16 INSERT INTO t1 VALUES (null);
17 ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
18 SELECT * FROM t1;
19 # Restart the server
20 -- source include/restart_mysqld.inc
21 # The MySQL and InnoDB data dictionaries should now be out of sync.
22 # The select should print message to the error log
23 SELECT * FROM t1;
24 # MySQL have made a change (http://lists.mysql.com/commits/75268) that no
25 # longer results in the two data dictionaries being out of sync. If they
26 # revert their changes then this check for ER_AUTOINC_READ_FAILED will need
27 # to be enabled. Also, see http://bugs.mysql.com/bug.php?id=47621.
28 # -- error ER_AUTOINC_READ_FAILED,1467
29 INSERT INTO t1 VALUES(null);
30 ALTER TABLE t1 AUTO_INCREMENT = 3;
31 SHOW CREATE TABLE t1;
32 INSERT INTO t1 VALUES(null);
33 SELECT * FROM t1;
34 DROP TABLE t1;