Commit 1a753307 authored by unknown's avatar unknown

Fix syntax to be more clean:

SHOW CREATE DATABASE [WITH IF NOT EXISTS] dbname

parent 74985d13
...@@ -1252,7 +1252,7 @@ static int init_dumping(char *database) ...@@ -1252,7 +1252,7 @@ static int init_dumping(char *database)
MYSQL_ROW row; MYSQL_ROW row;
MYSQL_RES *dbinfo; MYSQL_RES *dbinfo;
sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s",database); sprintf(qbuf,"SHOW CREATE DATABASE WITH IF NOT EXISTS %s",database);
if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock))) if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock)))
{ {
......
...@@ -549,7 +549,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); ...@@ -549,7 +549,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
type int_type real_type order_dir opt_field_spec lock_option type int_type real_type order_dir opt_field_spec lock_option
udf_type if_exists opt_local opt_table_options table_options udf_type if_exists opt_local opt_table_options table_options
table_option opt_if_not_exists opt_var_type opt_var_ident_type table_option opt_if_not_exists opt_var_type opt_var_ident_type
delete_option delete_option opt_with_if_not_exists
%type <ulong_num> %type <ulong_num>
ULONG_NUM raid_types merge_insert_types ULONG_NUM raid_types merge_insert_types
...@@ -878,6 +878,10 @@ opt_if_not_exists: ...@@ -878,6 +878,10 @@ opt_if_not_exists:
/* empty */ { $$= 0; } /* empty */ { $$= 0; }
| IF NOT EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; }; | IF NOT EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; };
opt_with_if_not_exists:
/* empty */ { $$= 0; }
| WITH IF NOT EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; };
opt_create_table_options: opt_create_table_options:
/* empty */ /* empty */
| create_table_options; | create_table_options;
...@@ -3106,7 +3110,7 @@ show_param: ...@@ -3106,7 +3110,7 @@ show_param:
lex->grant_user=$3; lex->grant_user=$3;
lex->grant_user->password.str=NullS; lex->grant_user->password.str=NullS;
} }
| CREATE DATABASE opt_if_not_exists ident | CREATE DATABASE opt_with_if_not_exists ident
{ {
Lex->sql_command=SQLCOM_SHOW_CREATE_DB; Lex->sql_command=SQLCOM_SHOW_CREATE_DB;
Lex->create_info.options=$3; Lex->create_info.options=$3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment