Skip to content

Commit b2c81e0

Browse files
committed
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.
1 parent 4ef44cc commit b2c81e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mysql-test/main/func_json_notembedded.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ connect u,localhost,root;
44
# MDEV-24909 JSON functions don't respect KILL QUERY / max_statement_time limit
55
#
66
set group_concat_max_len= 4294967295;
7-
set @obj=concat_ws('','{', repeat('"a":"b",', 125000000/2), '"c":"d"}');
8-
set @arr=concat_ws('','[', repeat('1234567,', 125000000/2), '2345678]');
7+
set @obj=concat_ws('','{', repeat('"a":"b",', 1250000/2), '"c":"d"}');
8+
set @arr=concat_ws('','[', repeat('1234567,', 1250000/2), '2345678]');
99
select length(@obj), length(@arr);
1010
length(@obj) length(@arr)
11-
500000009 500000009
11+
5000009 5000009
1212
set max_statement_time=0.0001;
1313
select json_array_append(@arr, '$[0]', 1);
1414
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)

mysql-test/main/func_json_notembedded.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ connect u,localhost,root;
99
--echo #
1010
set group_concat_max_len= 4294967295;
1111

12-
set @obj=concat_ws('','{', repeat('"a":"b",', 125000000/2), '"c":"d"}');
13-
set @arr=concat_ws('','[', repeat('1234567,', 125000000/2), '2345678]');
12+
set @obj=concat_ws('','{', repeat('"a":"b",', 1250000/2), '"c":"d"}');
13+
set @arr=concat_ws('','[', repeat('1234567,', 1250000/2), '2345678]');
1414
select length(@obj), length(@arr);
1515

1616
set max_statement_time=0.0001;

0 commit comments

Comments
 (0)