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:
unknown 2003-03-02 14:47:56 +04:00
parent 1019053392
commit 08387526d4

View file

@ -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: