summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-01 00:30:58 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-01 00:30:58 +0400
commit6857cb57fe7090f131b272f31485b7a478a0b324 (patch)
tree44cd80409ab7d173b7263c55d3f37ddc8b6914ab /sql/item_jsonfunc.h
parentaa582dedcbd22182e06355b94d1de4fc62f71910 (diff)
downloadmariadb-git-6857cb57fe7090f131b272f31485b7a478a0b324.tar.gz
MDEV-13967 Parameter data type control for Item_long_func
- Implementing stricter data type control for Item_long_func descendants - Cleanup: renaming Type_handler::can_return_str_ascii() to can_return_text() (a better name).
Diffstat (limited to 'sql/item_jsonfunc.h')
-rw-r--r--sql/item_jsonfunc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h
index 7da72dc7f89..77e7588be25 100644
--- a/sql/item_jsonfunc.h
+++ b/sql/item_jsonfunc.h
@@ -295,6 +295,12 @@ public:
class Item_func_json_length: public Item_long_func
{
+ bool check_arguments() const
+ {
+ return args[0]->check_type_can_return_text(func_name()) ||
+ (arg_count > 1 &&
+ args[1]->check_type_general_purpose_string(func_name()));
+ }
protected:
json_path_with_flags path;
String tmp_js;
@@ -312,6 +318,8 @@ public:
class Item_func_json_depth: public Item_long_func
{
+ bool check_arguments() const
+ { return args[0]->check_type_can_return_text(func_name()); }
protected:
String tmp_js;
public: