summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2019-02-13 14:59:34 -0800
committerIgor Babaev <igor@askmonty.org>2019-02-13 14:59:34 -0800
commit7d9f45e0729ea9b2f572cfb4023b28c16ab11145 (patch)
tree040e8f220c289652612c6cda14d277435c25ac49 /sql/sql_lex.cc
parent62fad4e8e964786cd1c8d675f3c071a405a8d187 (diff)
parenta081a998a62eb0663b5691d0b5c0607465f15c0f (diff)
downloadmariadb-git-bb-10.4-mdev17096.tar.gz
Merge branch '10.4' into bb-10.4-mdev17096bb-10.4-mdev17096
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index df4d8d7b94c..f5e37446b58 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -9587,3 +9587,21 @@ bool LEX::sp_proc_stmt_statement_finalize(THD *thd, bool no_lookahead)
lip->get_tok_start());
return LEX::sp_proc_stmt_statement_finalize_buf(thd, qbuf);
}
+
+
+/**
+ Create JSON_VALID(field_name) expression
+*/
+
+Virtual_column_info *make_json_valid_expr(THD *thd, LEX_CSTRING *field_name)
+{
+ Lex_ident_sys_st str;
+ Item *field, *expr;
+ str.set_valid_utf8(field_name);
+ if (unlikely(!(field= thd->lex->create_item_ident_field(thd, NullS, NullS,
+ &str))))
+ return 0;
+ if (unlikely(!(expr= new (thd->mem_root) Item_func_json_valid(thd, field))))
+ return 0;
+ return add_virtual_expression(thd, expr);
+}