mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 02:30:06 +01:00
Charset related synax changes, now these things work in parser:
CREATE DATABASE name DEFAULT CHARACTER SET charsetname; CREATE DATABASE name (fieldname CHAR(n) CHARACTER SET charsetname); Changes affect query parsing ONLY and do not have other effect yet. sql/sql_lex.h: Charset related synax changes sql/sql_yacc.yy: Charset related synax changes
This commit is contained in:
parent
8bee96ab0a
commit
3f50440f30
2 changed files with 27 additions and 3 deletions
|
@ -189,6 +189,7 @@ typedef struct st_lex {
|
|||
bool drop_primary,drop_if_exists,local_file;
|
||||
bool in_comment,ignore_space,verbose,simple_alter, option_type, derived_tables;
|
||||
uint slave_thd_opt;
|
||||
CHARSET_INFO *charset;
|
||||
} LEX;
|
||||
|
||||
|
||||
|
|
|
@ -777,7 +777,7 @@ create:
|
|||
lex->key_list.push_back(new Key($2,$5,$4.str,lex->col_list));
|
||||
lex->col_list.empty();
|
||||
}
|
||||
| CREATE DATABASE opt_if_not_exists ident
|
||||
| CREATE DATABASE opt_if_not_exists ident default_charset
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
lex->sql_command=SQLCOM_CREATE_DB;
|
||||
|
@ -1095,8 +1095,31 @@ attribute:
|
|||
| UNIQUE_SYM KEY_SYM { Lex->type|= UNIQUE_KEY_FLAG; }
|
||||
|
||||
opt_binary:
|
||||
/* empty */ {}
|
||||
| BINARY { Lex->type|=BINARY_FLAG; }
|
||||
/* empty */ { Lex->charset=default_charset_info; }
|
||||
| BINARY { Lex->type|=BINARY_FLAG; Lex->charset=default_charset_info; }
|
||||
| CHAR_SYM SET ident
|
||||
{
|
||||
CHARSET_INFO *cs=get_charset_by_name($3.str,MYF(MY_WME));
|
||||
if (!cs)
|
||||
{
|
||||
net_printf(¤t_thd->net,ER_UNKNOWN_CHARACTER_SET,$3);
|
||||
YYABORT;
|
||||
}
|
||||
Lex->charset=cs;
|
||||
}
|
||||
|
||||
default_charset:
|
||||
/* empty */ { Lex->charset-default_charset_info; }
|
||||
| DEFAULT CHAR_SYM SET ident
|
||||
{
|
||||
CHARSET_INFO *cs=get_charset_by_name($4.str,MYF(MY_WME));
|
||||
if (!cs)
|
||||
{
|
||||
net_printf(¤t_thd->net,ER_UNKNOWN_CHARACTER_SET,$4);
|
||||
YYABORT;
|
||||
}
|
||||
Lex->charset=cs;
|
||||
}
|
||||
|
||||
references:
|
||||
REFERENCES table_ident opt_on_delete {}
|
||||
|
|
Loading…
Add table
Reference in a new issue