mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge osalerma@bk-internal.mysql.com:/home/bk/mysql-5.0
into 127.(none):/home/osku/mysql-5.0
This commit is contained in:
@ -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;
|
||||
|
@ -1404,3 +1404,31 @@ insert into t1 values ('aa','bb'),('aa','cc');
|
||||
delete t1 from t1,t2 where f1=f3 and f4='cc';
|
||||
select * from t1;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Test that the slow TRUNCATE implementation resets autoincrement columns
|
||||
# (bug #11946)
|
||||
#
|
||||
|
||||
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;
|
||||
TRUNCATE t1;
|
||||
INSERT INTO t1 (id) VALUES (NULL);
|
||||
SELECT * FROM t1;
|
||||
|
||||
# continued from above; test that doing a slow TRUNCATE on a table with 0
|
||||
# rows resets autoincrement columns
|
||||
DELETE FROM t1;
|
||||
TRUNCATE t1;
|
||||
INSERT INTO t1 (id) VALUES (NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t2, t1;
|
||||
|
Reference in New Issue
Block a user