summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-02-14 11:11:47 +0100
committerSergei Golubchik <serg@mariadb.org>2017-02-14 20:43:41 +0100
commit6f6d0531dca711f13842cfca761afd073c595f57 (patch)
treeb46a9f617e86bcca3a19d24bb2f8c5f9c31ff182 /sql/item_jsonfunc.h
parente0fa2ce40f03add01bb3d934480e74e3ee64dd6c (diff)
downloadmariadb-git-6f6d0531dca711f13842cfca761afd073c595f57.tar.gz
MDEV-11439 No data type JSON, but CAST(something AS JSON) pretends to work
Use JSON_COMPACT(X) instead of CAST(X AS JSON). Bonus - X is validated to be a valid JSON. Fix a typo in the error message.
Diffstat (limited to 'sql/item_jsonfunc.h')
-rw-r--r--sql/item_jsonfunc.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h
index 0eedfa18be1..535f1bf73a5 100644
--- a/sql/item_jsonfunc.h
+++ b/sql/item_jsonfunc.h
@@ -414,19 +414,6 @@ public:
};
-class Item_json_typecast: public Item_str_func
-{
-public:
- Item_json_typecast(THD *thd, Item *a): Item_str_func(thd, a) {}
- const char *func_name() const { return "cast_as_json"; }
- bool is_json_type() { return true; }
- void fix_length_and_dec();
- String *val_str(String *str);
- Item *get_copy(THD *thd, MEM_ROOT *mem_root)
- { return get_item_copy<Item_json_typecast>(thd, mem_root, this); }
-};
-
-
class Item_func_json_format: public Item_str_func
{
public:
@@ -449,6 +436,8 @@ public:
const char *func_name() const;
void fix_length_and_dec();
String *val_str(String *str);
+ String *val_json(String *str);
+ bool is_json_type() { return true; }
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_json_format>(thd, mem_root, this); }
};