Commit b2c81e06 authored by Daniel Black's avatar Daniel Black

MDEV-27955 main.func_json_notembedded test fails on out-of-memory

Uses 500M+ of memory by repeating an 8 byte sequence 62.5M times.

Reduce the number of repeats on string reduced by 100 times.

Tested by applying against the reverted MDEV-24909 code. 1000 times
reduction was too much, but 100 still managed to trigger the bug.
parent 4ef44cc2
......@@ -4,11 +4,11 @@ connect u,localhost,root;
# MDEV-24909 JSON functions don't respect KILL QUERY / max_statement_time limit
#
set group_concat_max_len= 4294967295;
set @obj=concat_ws('','{', repeat('"a":"b",', 125000000/2), '"c":"d"}');
set @arr=concat_ws('','[', repeat('1234567,', 125000000/2), '2345678]');
set @obj=concat_ws('','{', repeat('"a":"b",', 1250000/2), '"c":"d"}');
set @arr=concat_ws('','[', repeat('1234567,', 1250000/2), '2345678]');
select length(@obj), length(@arr);
length(@obj) length(@arr)
500000009 500000009
5000009 5000009
set max_statement_time=0.0001;
select json_array_append(@arr, '$[0]', 1);
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
......
......@@ -9,8 +9,8 @@ connect u,localhost,root;
--echo #
set group_concat_max_len= 4294967295;
set @obj=concat_ws('','{', repeat('"a":"b",', 125000000/2), '"c":"d"}');
set @arr=concat_ws('','[', repeat('1234567,', 125000000/2), '2345678]');
set @obj=concat_ws('','{', repeat('"a":"b",', 1250000/2), '"c":"d"}');
set @arr=concat_ws('','[', repeat('1234567,', 1250000/2), '2345678]');
select length(@obj), length(@arr);
set max_statement_time=0.0001;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment