| 1 |
--let $ROUNDS=20 |
| 2 |
CREATE TABLE articles ( |
| 3 |
id INT UNSIGNED NOT NULL PRIMARY KEY, |
| 4 |
title TEXT |
| 5 |
) ENGINE=InnoDB; |
| 6 |
|
| 7 |
--echo # Seed one row, then double it ROUNDS times. |
| 8 |
INSERT INTO articles(id, title) VALUES (1, 'akuku'); |
| 9 |
|
| 10 |
let $i=0; |
| 11 |
while ($i < $ROUNDS) |
| 12 |
{ |
| 13 |
# Duplicate existing rows into the upper id range. |
| 14 |
# New ids are unique because we offset by current cardinality. |
| 15 |
INSERT INTO articles(id, title) SELECT id + (SELECT MAX(id) FROM articles), title FROM articles; |
| 16 |
inc $i; |
| 17 |
} |
| 18 |
|
| 19 |
--echo # Restart server to isolate allocator high-watermark from prior tests |
| 20 |
--source include/restart_mysqld.inc |
| 21 |
|
| 22 |
ALTER TABLE articles ADD FULLTEXT KEY ft_title(title); |
| 23 |
|
| 24 |
--let $assert_text= Memory used by InnoDB allocator should stay below 5 MiB during FTS index build |
| 25 |
--let $assert_cond= [SELECT high_number_of_bytes_used FROM performance_schema.memory_summary_global_by_event_name WHERE event_name = "memory/innodb/memory"] < 5*1024*1024 |
| 26 |
--source include/assert.inc |
| 27 |
|
| 28 |
DROP TABLE articles; |