diff options
author | unknown <bar@bar.mysql.r18.ru> | 2002-10-24 14:22:42 +0500 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2002-10-24 14:22:42 +0500 |
commit | 372b26e7786dcc812bc5fd2e8541d8c58201ea5b (patch) | |
tree | 3b543c0a250301e061f83ff2df91a4f0d356fbc0 | |
parent | f4a3b1d90357f4db8a966210d84177542e635a2f (diff) | |
download | mariadb-git-372b26e7786dcc812bc5fd2e8541d8c58201ea5b.tar.gz |
In database/table charset the keyword DEFAULT is now optional,
and CHARSET is now the same with CHARACTER SET:
CREATE DATABASE name
[DEFAULT] {CHAR SET | CHARACTER SET | CHARSET} csname
CREATE TABLE (...) [DEFAULT] {CHARSET | CHARACTER SET | CHAR SET} [=] csname
To Paul and Arjen:
However this should be recommended in db option to conform SQL99:
CREATE DATABASE dbname DEFAULT CHARACTER SET csname
In table option there is no SQL99 recommended syntax as far as
table charset is MySQL extension.
-rw-r--r-- | sql/sql_yacc.yy | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 42584ed7440..f5b8c6e4b24 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -909,9 +909,14 @@ create_table_option: table_list->next=0; lex->create_info.used_fields|= HA_CREATE_USED_UNION; } - | CHARSET o_eq charset_name_or_default + | opt_default CHARSET o_eq charset_name_or_default { - Lex->create_info.table_charset= $3; + Lex->create_info.table_charset= $4; + Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET; + } + | opt_default CHAR_SYM SET o_eq charset_name_or_default + { + Lex->create_info.table_charset= $5; Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET; } | INSERT_METHOD o_eq merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;} @@ -1170,9 +1175,14 @@ charset_name_or_default: charset_name { $$=$1; } | DEFAULT { $$=NULL; } ; +opt_default: + /* empty */ {} + | DEFAULT {}; + opt_db_default_character_set: - /* empty */ { $$=default_charset_info; } - | DEFAULT CHAR_SYM SET charset_name_or_default { $$=$4; }; + /* empty */ { $$=default_charset_info; } + | opt_default CHAR_SYM SET charset_name_or_default { $$=$4; } + | opt_default CHARSET charset_name_or_default { $$=$3; }; opt_binary: /* empty */ { Lex->charset=NULL; } |