Skip to content

Commit

Permalink
MDEV-6076: Optimize the test.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Dec 16, 2016
1 parent 8777458 commit cb0ce5c
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 341 deletions.
14 changes: 5 additions & 9 deletions mysql-test/suite/innodb/include/autoinc_persist_alter.inc
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,17 @@ eval SELECT MAX(a) AS `Expect 124` FROM $table;

eval OPTIMIZE TABLE $table;

eval SHOW CREATE TABLE $table;

--source include/restart_mysqld.inc

--echo # We expect the counter to still be 125
eval SHOW CREATE TABLE $table;

eval DELETE FROM $table WHERE a >= 123;

eval CREATE UNIQUE INDEX idx_aa ON $table(a);
eval CREATE TABLE i$table(a INT AUTO_INCREMENT, INDEX(a)) AUTO_INCREMENT=125 ENGINE=InnoDB;
eval CREATE UNIQUE INDEX idx_aa ON i$table(a);

--source include/restart_mysqld.inc

eval INSERT INTO $table VALUES(0), (0);
eval INSERT INTO i$table VALUES(0), (0);

eval SELECT MAX(a) AS `Expect 126` FROM $table;
eval SELECT MAX(a) AS `Expect 126` FROM i$table;

eval DROP TABLE $table;
eval DROP TABLE $table, i$table;
Loading

0 comments on commit cb0ce5c

Please sign in to comment.