summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2014-12-10 11:32:52 +0400
committerAlexander Barkov <bar@mariadb.org>2014-12-10 11:32:52 +0400
commit60277b8b3cd49792a59ad460920931f146789d0a (patch)
treed3b2d0ec9eaa2031d37483aa600c5222792b7c1d /sql/sql_yacc.yy
parentacdc383445f71060f459f656fe44bafccdd3f07e (diff)
downloadmariadb-git-60277b8b3cd49792a59ad460920931f146789d0a.tar.gz
MDEV-7287 VIEW: CREATE IF NOT EXISTS
Forgot to do "git add" for a number of files in the previous commit.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index f9e6c9653f5..53cfc3baadc 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2552,6 +2552,7 @@ create:
}
| create_or_replace
{
+ Lex->create_info.set($1);
Lex->create_view_mode= ($1.or_replace() ? VIEW_CREATE_OR_REPLACE :
VIEW_CREATE_NEW);
Lex->create_view_algorithm= DTYPE_ALGORITHM_UNDEFINED;
@@ -2559,6 +2560,7 @@ create:
}
view_or_trigger_or_sp_or_event
{
+ // TODO: remove this when "MDEV-5359 CREATE OR REPLACE..." is done
if ($1.or_replace() && Lex->sql_command != SQLCOM_CREATE_VIEW)
{
my_error(ER_WRONG_USAGE, MYF(0), "OR REPLACE",
@@ -16059,12 +16061,14 @@ view_suid:
;
view_tail:
- view_suid VIEW_SYM table_ident
+ view_suid VIEW_SYM opt_if_not_exists table_ident
{
LEX *lex= thd->lex;
+ if (lex->add_create_options_with_check($3))
+ MYSQL_YYABORT;
lex->sql_command= SQLCOM_CREATE_VIEW;
/* first table in list is target VIEW name */
- if (!lex->select_lex.add_table_to_list(thd, $3, NULL,
+ if (!lex->select_lex.add_table_to_list(thd, $4, NULL,
TL_OPTION_UPDATING,
TL_IGNORE,
MDL_EXCLUSIVE))