Skip to content

Commit f249b01

Browse files
committed
Merge 10.6 into 10.11
2 parents ce10161 + 526cf61 commit f249b01

17 files changed

Lines changed: 208 additions & 40 deletions

include/json_lib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ enum json_errors {
3030
JE_ESCAPING= -6, /* Error in the escaping. */
3131

3232
JE_DEPTH= -7, /* The limit on the JSON depth was overrun. */
33+
JE_KILLED= -8, /* Killed during processing */
3334
};
3435

3536

mysql-test/main/column_compression.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,3 +3035,19 @@ select * from (select * from t) as t natural join (select * from t) as t1;
30353035
a b
30363036
drop tables t, t4;
30373037
# End of 10.5 tests
3038+
#
3039+
# MDEV-39450: Memory corruption: overlapping memory ranges in `Field_longstr::compress` on UPDATE of compressed column
3040+
#
3041+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
3042+
REPLACE INTO t VALUES ('abcdefghijklm');
3043+
UPDATE t SET c=RIGHT(c,10);
3044+
DROP TABLE t;
3045+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
3046+
REPLACE INTO t VALUES ('abcdefghijklm');
3047+
UPDATE t SET c=SUBSTRING(c,3);
3048+
DROP TABLE t;
3049+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
3050+
REPLACE INTO t VALUES ('abcdefghijklm');
3051+
UPDATE t SET c=MID(c,2,4);
3052+
DROP TABLE t;
3053+
# End of 10.6 tests

mysql-test/main/column_compression.test

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,3 +573,24 @@ select * from (select * from t) as t natural join (select * from t) as t1;
573573
drop tables t, t4;
574574

575575
--echo # End of 10.5 tests
576+
577+
--echo #
578+
--echo # MDEV-39450: Memory corruption: overlapping memory ranges in `Field_longstr::compress` on UPDATE of compressed column
579+
--echo #
580+
581+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
582+
REPLACE INTO t VALUES ('abcdefghijklm');
583+
UPDATE t SET c=RIGHT(c,10);
584+
DROP TABLE t;
585+
586+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
587+
REPLACE INTO t VALUES ('abcdefghijklm');
588+
UPDATE t SET c=SUBSTRING(c,3);
589+
DROP TABLE t;
590+
591+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
592+
REPLACE INTO t VALUES ('abcdefghijklm');
593+
UPDATE t SET c=MID(c,2,4);
594+
DROP TABLE t;
595+
596+
--echo # End of 10.6 tests

mysql-test/main/func_json.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,8 @@ Warning 4042 Syntax error in JSON path in argument 2 to function 'json_extract'
17791779
SELECT JSON_EXISTS(CONCAT('[', REPEAT('[', 4000), 'Y', REPEAT(']', 4000), ', 1]'), '$[100]') as ex;
17801780
ex
17811781
NULL
1782+
Warnings:
1783+
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 1 to function 'json_exists' at position 32
17821784
#
17831785
# MDEV-35548 UBSAN: runtime error: index -1 out of bounds for type 'json_path_step_t[32]'
17841786
# (aka 'struct st_json_path_step_t[32]')
@@ -1794,6 +1796,18 @@ JSON_EXTRACT('0E+0','$')
17941796
SELECT JSON_EXISTS(CONCAT('[', REPEAT('[', 4000), 'Y', REPEAT(']', 4000), ', 1]'), '$[100]') as je;
17951797
je
17961798
NULL
1799+
Warnings:
1800+
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 1 to function 'json_exists' at position 32
1801+
SELECT JSON_EXISTS('[[[[[Y[[[[n[[[[[[[[[[[n[[[Vn]]]]]]]]]]]]]],]]:]]]](', '$[0 to rrrrrRR-1]') as je;
1802+
je
1803+
NULL
1804+
Warnings:
1805+
Warning 4038 Syntax error in JSON text in argument 1 to function 'json_exists' at position 6
1806+
SELECT JSON_EXISTS('[[[[[Y[[[[[[[[[[[[[[[[[[Vn]]]]]]]]]]]]]],]]:]]]](', '$[0 to rrrrRR-1]') as je;
1807+
je
1808+
NULL
1809+
Warnings:
1810+
Warning 4038 Syntax error in JSON text in argument 1 to function 'json_exists' at position 6
17971811
# End of 10.6 tests
17981812
SELECT json_extract(t.j, '$')
17991813
FROM (SELECT json_extract('["a",1]', '$') AS j) AS t;

mysql-test/main/func_json.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,8 @@ SELECT JSON_EXTRACT('{a:true}','$.a')=TRUE;
12481248
SELECT JSON_EXTRACT('0E+0','$');
12491249

12501250
SELECT JSON_EXISTS(CONCAT('[', REPEAT('[', 4000), 'Y', REPEAT(']', 4000), ', 1]'), '$[100]') as je;
1251+
SELECT JSON_EXISTS('[[[[[Y[[[[n[[[[[[[[[[[n[[[Vn]]]]]]]]]]]]]],]]:]]]](', '$[0 to rrrrrRR-1]') as je;
1252+
SELECT JSON_EXISTS('[[[[[Y[[[[[[[[[[[[[[[[[[Vn]]]]]]]]]]]]]],]]:]]]](', '$[0 to rrrrRR-1]') as je;
12511253

12521254
--echo # End of 10.6 tests
12531255

mysql-test/main/func_json_notembedded.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@ select json_insert(@obj, '$.meta', 1);
2020
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
2121
select json_compact(@arr);
2222
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
23+
select json_contains(@obj, '"d"', '$.c');
24+
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
25+
select json_contains_path(@obj, 'one', '$.c');
26+
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
27+
select json_exists(@obj, '$.c');
28+
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
29+
select json_extract(@obj, '$.c');
30+
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
2331
select json_detailed(@arr);
2432
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
33+
select json_keys(@obj, '$.c');
34+
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
2535
select json_loose(@arr);
2636
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
2737
select json_merge(@obj, @arr);
@@ -36,6 +46,8 @@ select json_replace(@obj,'$.foo',1);
3646
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
3747
select json_set(@arr,'$[1000]',1);
3848
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
49+
select ST_AsTEXT(ST_GeomFromGeoJSON(JSON_OBJECT("type", "Point", "coordinates", @arr),2)) as exp;
50+
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
3951
SET debug_dbug= @old_debug;
4052
disconnect u;
4153
connection default;

mysql-test/main/func_json_notembedded.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ select json_array_append(@arr, '$[0]', 1);
2323
select json_array_insert(@arr, '$[0]', 1);
2424
select json_insert(@obj, '$.meta', 1);
2525
select json_compact(@arr);
26+
select json_contains(@obj, '"d"', '$.c');
27+
select json_contains_path(@obj, 'one', '$.c');
28+
select json_exists(@obj, '$.c');
29+
select json_extract(@obj, '$.c');
2630
select json_detailed(@arr);
31+
select json_keys(@obj, '$.c');
2732
select json_loose(@arr);
2833
select json_merge(@obj, @arr);
2934
select json_merge_patch(@obj, @obj);
3035
select json_merge_preserve(@obj, @arr);
3136
select json_remove(@obj,'$.foo');
3237
select json_replace(@obj,'$.foo',1);
3338
select json_set(@arr,'$[1000]',1);
39+
select ST_AsTEXT(ST_GeomFromGeoJSON(JSON_OBJECT("type", "Point", "coordinates", @arr),2)) as exp;
3440
enable_abort_on_error;
3541
SET debug_dbug= @old_debug;
3642
disconnect u;

mysql-test/main/gis-json.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ Warning 4048 Incorrect GeoJSON format specified for st_geomfromgeojson function.
124124
# End of 10.2 tests
125125
#
126126
#
127+
# MDEV-39813 ST_GeomFromGeoJSON does not control recursion depth
128+
#
129+
SELECT ST_GeomFromGeoJSON(
130+
concat(
131+
repeat('{"type":"GeometryCollection","geometries":[', 2000),
132+
'{"type":"Point","coordinates":[0,0]}',
133+
repeat(']}', 2000)
134+
)) as exp;
135+
exp
136+
NULL
137+
Warnings:
138+
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 1 to function 'st_geomfromgeojson' at position 473
139+
# End of 10.6 tests
140+
#
127141
# MDEV-34079: ST_AsGeoJSON returns incorrect value for empty geometry
128142
#
129143
SELECT ST_AsGeoJSON(GeomFromText('GeometryCollection EMPTY'));

mysql-test/main/gis-json.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type": ["POINT"], "coINates": [0,0] }'))
5858
--echo #
5959
--echo # End of 10.2 tests
6060
--echo #
61+
62+
--echo #
63+
--echo # MDEV-39813 ST_GeomFromGeoJSON does not control recursion depth
64+
--echo #
65+
66+
SELECT ST_GeomFromGeoJSON(
67+
concat(
68+
repeat('{"type":"GeometryCollection","geometries":[', 2000),
69+
'{"type":"Point","coordinates":[0,0]}',
70+
repeat(']}', 2000)
71+
)) as exp;
72+
73+
--echo # End of 10.6 tests
74+
6175
--echo #
6276
--echo # MDEV-34079: ST_AsGeoJSON returns incorrect value for empty geometry
6377
--echo #

mysql-test/suite/s3/debug.result

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ drop table if exists t1;
22
#
33
# MDEV-32884 Make s3_debug dynamic
44
#
5+
set @save_s3_debug=@@global.s3_debug;
56
create or replace table t1 (a int, b int, c varchar(1000), key (a), key(c)) engine=aria;
67
insert into t1 select seq, seq+10, repeat(char(65+ mod(seq, 20)),mod(seq,1000)) from seq_1_to_100;
8+
create table t2 as select * from t1;
79
alter table t1 engine=s3;
10+
alter table t2 engine=s3;
811
show create table t1;
912
Table Create Table
1013
t1 CREATE TABLE `t1` (
@@ -17,16 +20,17 @@ t1 CREATE TABLE `t1` (
1720
select count(*) from t1;
1821
count(*)
1922
100
20-
flush table t1;
21-
NOT FOUND /s3_test_/ in mysqld.1.err
23+
flush table t1, t2;
24+
NOT FOUND matches in mysqld.1.err
2225
set @@global.s3_debug=1;
2326
select count(*) from t1;
2427
count(*)
2528
100
2629
set @@global.s3_debug=0;
27-
FOUND 8 /s3_test_/ in mysqld.1.err
28-
select count(*) from t1;
30+
FOUND NUMBER matches in mysqld.1.err
31+
select count(*) from t2;
2932
count(*)
3033
100
31-
drop table t1;
32-
FOUND 8 /s3_test_/ in mysqld.1.err
34+
drop table t1, t2;
35+
NOT FOUND matches in mysqld.1.err
36+
set @@global.s3_debug=@save_s3_debug;

0 commit comments

Comments
 (0)