diff options
Diffstat (limited to 'sql/item_jsonfunc.h')
-rw-r--r-- | sql/item_jsonfunc.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index b352391c083..17ffe943938 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -493,9 +493,14 @@ class Item_func_json_length: public Item_long_func { bool check_arguments() const override { - return args[0]->check_type_can_return_text(func_name_cstring()) || - (arg_count > 1 && - args[1]->check_type_general_purpose_string(func_name_cstring())); + const LEX_CSTRING name= func_name_cstring(); + if (arg_count == 0 || arg_count > 2) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + return true; + } + return args[0]->check_type_can_return_text(name) || + (arg_count > 1 && args[1]->check_type_general_purpose_string(name)); } protected: json_path_with_flags path; |