1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-24538: JSON_LENGTH does not return error upon wrong number of parameters

This commit is contained in:
Weijun Huang
2023-02-12 16:40:40 +01:00
committed by Daniel Black
parent cacea31687
commit a80eb9832e
3 changed files with 21 additions and 0 deletions

View File

@ -665,6 +665,7 @@ SELECT 1 + JSON_VALUE('{"nulltest": null}', '$.nulltest');
SELECT NULL;
SELECT JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a');
--echo #
--echo # End of 10.3 tests
--echo #
@ -816,6 +817,14 @@ select JSON_PRETTY(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t20
select JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t200;
drop table t200;
--echo #
--echo # MDEV-24538: JSON_LENGTH does not return error upon wrong number of parameters
--echo #
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo');
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
SELECT JSON_LENGTH();
--echo #
--echo # End of 10.4 tests
--echo #