| 1 |
--source include/big_test.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
--source include/have_innodb_16k.inc |
| 4 |
|
| 5 |
SET GLOBAL innodb_compression_level = 0; |
| 6 |
CREATE TABLE t1 (j1 JSON) ENGINE=InnoDB ROW_FORMAT=compressed; |
| 7 |
SHOW CREATE TABLE t1; |
| 8 |
# must be long enough to force external storage |
| 9 |
# also the length must be so that json_doc last "page" of last stream |
| 10 |
# is short enough to fit on fragment page |
| 11 |
SET @long_str = REPEAT('abcdefghijklmnopqrstuvwxyz1234', 60000); |
| 12 |
# must be long enough to force new version (as opposed to storing diff in the undo log), |
| 13 |
# but must be short enough to not cause complete rewrite of the blob |
| 14 |
SET @medium_str_1 = REPEAT('a', 200); |
| 15 |
SET @medium_str_2 = REPEAT('b', 200); |
| 16 |
SET @json_doc = CONCAT('["', @long_str, '","', @medium_str_1 ,'" ]'); |
| 17 |
|
| 18 |
INSERT INTO t1 (j1) VALUES (@json_doc); |
| 19 |
|
| 20 |
SELECT JSON_EXTRACT(j1, '$[1]') FROM t1; |
| 21 |
|
| 22 |
SET GLOBAL innodb_purge_stop_now = ON; |
| 23 |
|
| 24 |
--disable_query_log |
| 25 |
--let i=0 |
| 26 |
while($i<50){ |
| 27 |
UPDATE t1 SET j1 = JSON_REPLACE(j1, '$[1]', @medium_str_2); |
| 28 |
UPDATE t1 SET j1 = JSON_REPLACE(j1, '$[1]', @medium_str_1); |
| 29 |
--inc $i |
| 30 |
} |
| 31 |
--enable_query_log |
| 32 |
|
| 33 |
SET GLOBAL innodb_purge_run_now = ON; |
| 34 |
|
| 35 |
# Give it a lot of time, so that the internal time limit of wait_innodb_all_purge |
| 36 |
# is much larger than the one provided in ./mtr --testcase-timeout=5 |
| 37 |
--let wait_timeout=3600 |
| 38 |
--source include/wait_innodb_all_purged.inc |
| 39 |
DROP TABLE t1; |
| 40 |
SET GLOBAL innodb_compression_level = default; |
| 41 |
|