1CREATE TABLE t1(
2id VARCHAR(32) NOT NULL,
3PRIMARY KEY(id)
4) ENGINE=InnoDB;
5CREATE PROCEDURE fill_table(IN number_of_records BIGINT UNSIGNED)
6BEGIN
7DECLARE i BIGINT UNSIGNED DEFAULT 0;
8START TRANSACTION;
9WHILE i < number_of_records DO
10INSERT INTO t1 VALUES(MD5(i));
11SET i = i + 1;
12END WHILE;
13COMMIT;
14END|
15CALL fill_table(32 * 1024);
16CHECKSUM TABLE t1;
17Table	Checksum
18test.t1	67358029
19include/assert.inc [(Fragmented table) The number of disjointed pages is much greater than the number of contiguous pages]
20include/assert.inc [(Fragmented table) Average seek distance for fragmented tables is >= 2]
21ALTER TABLE t1 ENGINE=InnoDB;
22CHECKSUM TABLE t1;
23Table	Checksum
24test.t1	67358029
25include/assert.inc [(Defragmented table) The number of disjointed pages is much less than the number of contiguous pages]
26include/assert.inc [(Defragmented table) Average seek distance for fragmented tables is >= 2]
27include/assert.inc [(data + garbage) in the fragmented table is greater than (data + garbage) in the defragmented one]
28include/assert.inc [(garbage) in the fragmented table is greater than (garbage) in the defragmented one]
29FLUSH STATUS;
30include/assert.inc [All counters have been set to zero]
31DROP PROCEDURE fill_table;
32DROP TABLE t1;
33