diff options
author | unknown <osku@127.(none)> | 2005-08-17 11:00:20 +0300 |
---|---|---|
committer | unknown <osku@127.(none)> | 2005-08-17 11:00:20 +0300 |
commit | 18ca696704e299da5dbd3448d3c9b98a2b3e3fc5 (patch) | |
tree | 11d5cb3571d6cc02c145f145c4e8f190b0477cf1 /mysql-test/r/innodb.result | |
parent | ac8d4a4d24ab32373ad8ea798564c7135e2649df (diff) | |
download | mariadb-git-18ca696704e299da5dbd3448d3c9b98a2b3e3fc5.tar.gz |
Fix bug #11946, truncate not always resetting the auto-increment counter
in InnoDB tables.
mysql-test/r/innodb.result:
New tests.
mysql-test/t/innodb.test:
New tests.
sql/ha_innodb.cc:
Add reset_auto_increment.
sql/ha_innodb.h:
Add reset_auto_increment.
sql/handler.h:
Add reset_auto_increment.
sql/sql_delete.cc:
Call handler->reset_auto_increment when needed.
Diffstat (limited to 'mysql-test/r/innodb.result')
-rw-r--r-- | mysql-test/r/innodb.result | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 69620d5d527..b2c78560562 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2483,3 +2483,26 @@ delete t1 from t1,t2 where f1=f3 and f4='cc'; select * from t1; f1 f2 drop table t1,t2; +CREATE TABLE t1 ( +id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +id INTEGER NOT NULL, +FOREIGN KEY (id) REFERENCES t1 (id) +) ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +1 +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +1 +DELETE FROM t1; +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +1 +DROP TABLE t2, t1; |