summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.h
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2017-02-06 06:47:48 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2017-02-06 06:47:48 +0400
commitabf7582112645ef8decc549eb662a07072b5cd32 (patch)
tree1082c1f2c8e32120cee647e0cd0374bd67c37b37 /sql/item_jsonfunc.h
parente51b015fc354ec40c8430d4f4ea6346bc9a8e07b (diff)
downloadmariadb-git-abf7582112645ef8decc549eb662a07072b5cd32.tar.gz
MDEV-11557 port MySQL-5.7 JSON tests to MariaDB.
Fixes for issues found.
Diffstat (limited to 'sql/item_jsonfunc.h')
-rw-r--r--sql/item_jsonfunc.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h
index 2ce94985a00..941123041d2 100644
--- a/sql/item_jsonfunc.h
+++ b/sql/item_jsonfunc.h
@@ -427,4 +427,30 @@ public:
};
+class Item_func_json_format: public Item_str_func
+{
+public:
+ enum formats
+ {
+ NONE,
+ COMPACT,
+ LOOSE,
+ DETAILED
+ };
+protected:
+ formats fmt;
+ String tmp_js;
+public:
+ Item_func_json_format(THD *thd, Item *js, formats format):
+ Item_str_func(thd, js), fmt(format) {}
+ Item_func_json_format(THD *thd, Item *js, Item *tabsize):
+ Item_str_func(thd, js, tabsize), fmt(DETAILED) {}
+ const char *func_name() const;
+ void fix_length_and_dec();
+ String *val_str(String *str);
+ Item *get_copy(THD *thd, MEM_ROOT *mem_root)
+ { return get_item_copy<Item_func_json_format>(thd, mem_root, this); }
+};
+
+
#endif /* ITEM_JSONFUNC_INCLUDED */