Commit 3c40f8ba authored by Rucha Deodhar's avatar Rucha Deodhar

MDEV-31402: SIGSEGV in json_get_path_next | Item_func_json_extract::read_json

parent e1825e39
...@@ -1690,5 +1690,12 @@ select json_arrayagg('ä'), json_objectagg(1, 'ä'); ...@@ -1690,5 +1690,12 @@ select json_arrayagg('ä'), json_objectagg(1, 'ä');
json_arrayagg('ä') json_objectagg(1, 'ä') json_arrayagg('ä') json_objectagg(1, 'ä')
["ä"] {"1":"ä"} ["ä"] {"1":"ä"}
# #
# MDEV-31402: SIGSEGV in json_get_path_next | Item_func_json_extract::read_json
#
CREATE TABLE t (id CHAR AS (JSON_COMPACT (JSON_EXTRACT(doc,"$._id"))) UNIQUE KEY,doc JSON,CONSTRAINT notnu CHECK (id IS NOT NULL));
INSERT INTO t (doc) VALUES ('{ "_id" : { "$oid" : "0ca0b0f0" },"a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" :0} ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }');
ERROR 22001: Data too long for column 'id' at row 1
DROP TABLE t;
#
# End of 10.5 tests # End of 10.5 tests
# #
...@@ -1115,6 +1115,16 @@ set names latin1; ...@@ -1115,6 +1115,16 @@ set names latin1;
select json_arrayagg('ä'), json_objectagg(1, 'ä'); select json_arrayagg('ä'), json_objectagg(1, 'ä');
--enable_service_connection --enable_service_connection
--echo #
--echo # MDEV-31402: SIGSEGV in json_get_path_next | Item_func_json_extract::read_json
--echo #
CREATE TABLE t (id CHAR AS (JSON_COMPACT (JSON_EXTRACT(doc,"$._id"))) UNIQUE KEY,doc JSON,CONSTRAINT notnu CHECK (id IS NOT NULL));
--error ER_DATA_TOO_LONG
INSERT INTO t (doc) VALUES ('{ "_id" : { "$oid" : "0ca0b0f0" },"a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" :0} ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }');
DROP TABLE t;
--echo # --echo #
--echo # End of 10.5 tests --echo # End of 10.5 tests
--echo # --echo #
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