mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-27990: Incorrect behavior of JSON_OVERLAPS() on warning
Analysis: In case of error while processing json document, we goto error label which eventually return 1 instead of 0. Fix: Return 0 in case of error instead of 1.
This commit is contained in:
@ -1742,9 +1742,14 @@ SELECT JSON_OVERLAPS('[1,2,{"A":B}]');
|
||||
ERROR 42000: Incorrect parameter count in the call to native function 'JSON_OVERLAPS'
|
||||
SELECT JSON_OVERLAPS('','');
|
||||
JSON_OVERLAPS('','')
|
||||
1
|
||||
0
|
||||
Warnings:
|
||||
Warning 4037 Unexpected end of JSON text in argument 1 to function 'json_overlaps'
|
||||
SELECT JSON_OVERLAPS('true','tr');
|
||||
JSON_OVERLAPS('true','tr')
|
||||
0
|
||||
Warnings:
|
||||
Warning 4037 Unexpected end of JSON text in argument 2 to function 'json_overlaps'
|
||||
#
|
||||
# End of 10.9 test
|
||||
#
|
||||
|
@ -1084,6 +1084,7 @@ SELECT JSON_OVERLAPS('[1,2,{"A":B}]', '{"A":B}', '{"C":"string1"}');
|
||||
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
|
||||
SELECT JSON_OVERLAPS('[1,2,{"A":B}]');
|
||||
SELECT JSON_OVERLAPS('','');
|
||||
SELECT JSON_OVERLAPS('true','tr');
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.9 test
|
||||
|
@ -4387,7 +4387,7 @@ error:
|
||||
report_json_error(js, &je, 0);
|
||||
if (ve.s.error)
|
||||
report_json_error(val, &ve, 1);
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Item_func_json_overlaps::fix_length_and_dec()
|
||||
|
Reference in New Issue
Block a user