Skip to content

Commit cb0ce5c

Browse files
committed
MDEV-6076: Optimize the test.
Remove unnecessary restarts by testing multiple tables across a restart. This change almost halves the execution time. Some further restarts could be removed with additional effort.
1 parent 8777458 commit cb0ce5c

File tree

3 files changed

+129
-341
lines changed

3 files changed

+129
-341
lines changed

mysql-test/suite/innodb/include/autoinc_persist_alter.inc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,17 @@ eval SELECT MAX(a) AS `Expect 124` FROM $table;
4141

4242
eval OPTIMIZE TABLE $table;
4343

44-
eval SHOW CREATE TABLE $table;
45-
46-
--source include/restart_mysqld.inc
47-
48-
--echo # We expect the counter to still be 125
49-
eval SHOW CREATE TABLE $table;
50-
5144
eval DELETE FROM $table WHERE a >= 123;
5245

53-
eval CREATE UNIQUE INDEX idx_aa ON $table(a);
46+
eval CREATE TABLE i$table(a INT AUTO_INCREMENT, INDEX(a)) AUTO_INCREMENT=125 ENGINE=InnoDB;
47+
eval CREATE UNIQUE INDEX idx_aa ON i$table(a);
5448

5549
--source include/restart_mysqld.inc
5650

5751
eval INSERT INTO $table VALUES(0), (0);
52+
eval INSERT INTO i$table VALUES(0), (0);
5853

5954
eval SELECT MAX(a) AS `Expect 126` FROM $table;
55+
eval SELECT MAX(a) AS `Expect 126` FROM i$table;
6056

61-
eval DROP TABLE $table;
57+
eval DROP TABLE $table, i$table;

0 commit comments

Comments
 (0)