Commit 372b26e7 authored by unknown's avatar unknown

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.

parent f4a3b1d9
...@@ -909,9 +909,14 @@ create_table_option: ...@@ -909,9 +909,14 @@ create_table_option:
table_list->next=0; table_list->next=0;
lex->create_info.used_fields|= HA_CREATE_USED_UNION; 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; 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;} | 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: ...@@ -1170,9 +1175,14 @@ charset_name_or_default:
charset_name { $$=$1; } charset_name { $$=$1; }
| DEFAULT { $$=NULL; } ; | DEFAULT { $$=NULL; } ;
opt_default:
/* empty */ {}
| DEFAULT {};
opt_db_default_character_set: opt_db_default_character_set:
/* empty */ { $$=default_charset_info; } /* empty */ { $$=default_charset_info; }
| DEFAULT CHAR_SYM SET charset_name_or_default { $$=$4; }; | opt_default CHAR_SYM SET charset_name_or_default { $$=$4; }
| opt_default CHARSET charset_name_or_default { $$=$3; };
opt_binary: opt_binary:
/* empty */ { Lex->charset=NULL; } /* empty */ { Lex->charset=NULL; }
......
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