mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
sql_yacc.yy:
Produce an error when a field collation and charset are not compatible sql/sql_yacc.yy: Produce an error when a field collation and charset are not compatible
This commit is contained in:
parent
1019053392
commit
08387526d4
1 changed files with 14 additions and 1 deletions
|
@ -1285,7 +1285,20 @@ attribute:
|
|||
| UNIQUE_SYM { Lex->type|= UNIQUE_FLAG; }
|
||||
| UNIQUE_SYM KEY_SYM { Lex->type|= UNIQUE_KEY_FLAG; }
|
||||
| COMMENT_SYM text_literal { Lex->comment= $2; }
|
||||
| COLLATE_SYM collation_name { Lex->charset=$2; };
|
||||
| COLLATE_SYM collation_name
|
||||
{
|
||||
if (Lex->charset && strcmp(Lex->charset->csname,$2->csname))
|
||||
{
|
||||
net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH,
|
||||
$2->name,Lex->charset->csname);
|
||||
YYABORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
Lex->charset=$2;
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
charset_name:
|
||||
|
|
Loading…
Reference in a new issue