mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-11468 JSON_UNQUOTE returns incorrect results.
Now return the argument's value when error.
This commit is contained in:
@ -277,6 +277,9 @@ drop table t1;
|
|||||||
select json_unquote('"abc"');
|
select json_unquote('"abc"');
|
||||||
json_unquote('"abc"')
|
json_unquote('"abc"')
|
||||||
abc
|
abc
|
||||||
|
select json_unquote('abc');
|
||||||
|
json_unquote('abc')
|
||||||
|
abc
|
||||||
select json_object("a", json_object("b", "abcd"));
|
select json_object("a", json_object("b", "abcd"));
|
||||||
json_object("a", json_object("b", "abcd"))
|
json_object("a", json_object("b", "abcd"))
|
||||||
{"a": {"b": "abcd"}}
|
{"a": {"b": "abcd"}}
|
||||||
|
@ -121,6 +121,7 @@ drop table t1;
|
|||||||
|
|
||||||
|
|
||||||
select json_unquote('"abc"');
|
select json_unquote('"abc"');
|
||||||
|
select json_unquote('abc');
|
||||||
|
|
||||||
select json_object("a", json_object("b", "abcd"));
|
select json_object("a", json_object("b", "abcd"));
|
||||||
select json_object("a", '{"b": "abcd"}');
|
select json_object("a", '{"b": "abcd"}');
|
||||||
|
@ -359,8 +359,8 @@ String *Item_func_json_unquote::val_str(String *str)
|
|||||||
return str;
|
return str;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
null_value= 1;
|
/* We just return the argument's value in the case of error. */
|
||||||
return 0;
|
return js;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user