diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2016-12-05 00:15:08 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2016-12-05 01:03:31 +0400 |
commit | 5454500562947bf369f7b984df888e2fd6eb4210 (patch) | |
tree | 4714bd681f344db11ed5150625479d10156b89a8 /sql/item_create.cc | |
parent | c89c514ed32cc63b005078adced10750e26565c2 (diff) | |
download | mariadb-git-5454500562947bf369f7b984df888e2fd6eb4210.tar.gz |
MDEV-11452 JSON_CONTAINS accepts wrong number of arguments.
Create_func_json_contains::create_native fixed.
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index ac906b93c78..ceb3c1cbbce 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -5218,13 +5218,13 @@ Create_func_json_contains::create_native(THD *thd, LEX_STRING name, if (item_list != NULL) arg_count= item_list->elements; - if (arg_count < 2 /* json_doc, val, [path]...*/) + if (arg_count == 2 || arg_count == 3/* json_doc, val, [path] */) { - my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + func= new (thd->mem_root) Item_func_json_contains(thd, *item_list); } else { - func= new (thd->mem_root) Item_func_json_contains(thd, *item_list); + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); } return func; |