summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2016-12-05 00:15:08 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2016-12-05 01:03:31 +0400
commit5454500562947bf369f7b984df888e2fd6eb4210 (patch)
tree4714bd681f344db11ed5150625479d10156b89a8 /sql/item_create.cc
parentc89c514ed32cc63b005078adced10750e26565c2 (diff)
downloadmariadb-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.cc6
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;