summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2014-12-10 13:41:14 +0400
committerAlexander Barkov <bar@mariadb.org>2014-12-10 13:41:14 +0400
commit822eb6ca3da3e1e93d4cf4845f3123fa4762e8cc (patch)
tree8b6a32be44147e4d9fd5aad462649015ffaf8da5 /sql/sql_yacc.yy
parent14cfb0acb83b3c9a4a1ae424f80a7bff1a8058b2 (diff)
downloadmariadb-git-822eb6ca3da3e1e93d4cf4845f3123fa4762e8cc.tar.gz
MDEV-7285 SERVER: CREATE OR REPLACE and CREATE IF NOT EXISTS
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy17
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 53cfc3baadc..927de37f2f1 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2584,18 +2584,21 @@ create:
{
Lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE;
}
- | CREATE server_def
- {
- Lex->sql_command= SQLCOM_CREATE_SERVER;
- }
+ | create_or_replace { Lex->set_command(SQLCOM_CREATE_SERVER, $1); }
+ server_def
+ { }
;
server_def:
- SERVER_SYM ident_or_text
- { Lex->server_options.reset($2); }
+ SERVER_SYM opt_if_not_exists ident_or_text
+ {
+ if (Lex->add_create_options_with_check($2))
+ MYSQL_YYABORT;
+ Lex->server_options.reset($3);
+ }
FOREIGN DATA_SYM WRAPPER_SYM ident_or_text
OPTIONS_SYM '(' server_options_list ')'
- { Lex->server_options.scheme= $7; }
+ { Lex->server_options.scheme= $8; }
;
server_options_list: