diff options
author | unknown <gluh@gluh.mysql.r18.ru> | 2004-12-06 19:01:51 +0300 |
---|---|---|
committer | unknown <gluh@gluh.mysql.r18.ru> | 2004-12-06 19:01:51 +0300 |
commit | e94fc374c52478268e7de22a316e52edd66ce192 (patch) | |
tree | 0fb3ec6d3d587816a067640649ccd182274f0f33 /sql/sql_yacc.yy | |
parent | 77a9eede5d2c4dca4973afd266b0b1218b196d4e (diff) | |
download | mariadb-git-e94fc374c52478268e7de22a316e52edd66ce192.tar.gz |
Syntax extention: 'ALTER DATABASE' without db name (after review)
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 49e567ab54b..e525fb2478a 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -609,7 +609,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %type <simple_string> remember_name remember_end opt_ident opt_db text_or_password - opt_constraint constraint + opt_constraint constraint ident_or_empty %type <string> text_string opt_gconcat_separator @@ -1870,7 +1870,7 @@ alter: } alter_list {} - | ALTER DATABASE ident + | ALTER DATABASE ident_or_empty { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -1879,10 +1879,15 @@ alter: { LEX *lex=Lex; lex->sql_command=SQLCOM_ALTER_DB; - lex->name=$3.str; + lex->name= $3; }; +ident_or_empty: + /* empty */ { $$= 0; } + | ident { $$= $1.str; }; + + alter_list: | DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; } | IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; } |