mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 17:33:44 +01:00
b2c81e06b0
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.
42 lines
1.8 KiB
Text
42 lines
1.8 KiB
Text
set global max_allowed_packet=1073741824;
|
|
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",', 1250000/2), '"c":"d"}');
|
|
set @arr=concat_ws('','[', repeat('1234567,', 1250000/2), '2345678]');
|
|
select length(@obj), length(@arr);
|
|
length(@obj) length(@arr)
|
|
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)
|
|
select json_array_insert(@arr, '$[0]', 1);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_insert(@obj, '$.meta', 1);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_compact(@arr);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_detailed(@arr);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_loose(@arr);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_merge(@obj, @arr);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_merge_patch(@obj, @obj);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_merge_preserve(@obj, @arr);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_remove(@obj,'$.foo');
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_replace(@obj,'$.foo',1);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
select json_set(@arr,'$[1000]',1);
|
|
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
|
disconnect u;
|
|
connection default;
|
|
set global max_allowed_packet=default;
|
|
#
|
|
# End of 10.6 tests
|
|
#
|