summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_jsonfunc.h')
-rw-r--r--sql/item_jsonfunc.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h
index 60600108320..6cdd8851663 100644
--- a/sql/item_jsonfunc.h
+++ b/sql/item_jsonfunc.h
@@ -24,7 +24,7 @@
#include "item_cmpfunc.h" // Item_bool_func
#include "item_strfunc.h" // Item_str_func
#include "item_sum.h"
-
+#include "sql_type_json.h"
class json_path_with_flags
{
@@ -139,12 +139,9 @@ public:
:Item_str_func(thd, a, b) { }
Item_json_func(THD *thd, List<Item> &list)
:Item_str_func(thd, list) { }
- bool is_json_type() override { return true; }
- void make_send_field(THD *thd, Send_field *tmp_field) override
+ const Type_handler *type_handler() const override
{
- Item_str_func::make_send_field(thd, tmp_field);
- static const Lex_cstring fmt(STRING_WITH_LEN("json"));
- tmp_field->set_format_name(fmt);
+ return Type_handler_json_common::json_type_handler(max_length);
}
};
@@ -657,7 +654,10 @@ public:
}
Item_func_json_arrayagg(THD *thd, Item_func_json_arrayagg *item) :
Item_func_group_concat(thd, item) {}
- bool is_json_type() override { return true; }
+ const Type_handler *type_handler() const override
+ {
+ return Type_handler_json_common::json_type_handler_sum(this);
+ }
LEX_CSTRING func_name_cstring() const override
{
@@ -686,7 +686,6 @@ public:
}
Item_func_json_objectagg(THD *thd, Item_func_json_objectagg *item);
- bool is_json_type() override { return true; }
void cleanup() override;
enum Sumfunctype sum_func () const override { return JSON_OBJECTAGG_FUNC;}
@@ -697,9 +696,7 @@ public:
}
const Type_handler *type_handler() const override
{
- if (too_big_for_varchar())
- return &type_handler_blob;
- return &type_handler_varchar;
+ return Type_handler_json_common::json_type_handler_sum(this);
}
void clear() override;
bool add() override;
@@ -725,5 +722,6 @@ public:
{ return get_item_copy<Item_func_json_objectagg>(thd, this); }
};
+extern bool is_json_type(const Item *item);
#endif /* ITEM_JSONFUNC_INCLUDED */