summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-03-13 16:12:54 +0400
committerAlexander Barkov <bar@mariadb.org>2015-03-13 16:12:54 +0400
commitbc902a2bfc46add0708896c07621e3707f66d95f (patch)
tree5deb81037569c9a1cb32ad6cb988ad7ab86d9d5f /sql/sql_yacc.yy
parent702fdc52fa02c5f20004d169ad48494122d8ffed (diff)
downloadmariadb-git-bc902a2bfc46add0708896c07621e3707f66d95f.tar.gz
MDEV-7387 [PATCH] Alter table xxx CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1 should fail
A contribution from Daniel Black, with minor additional enhancements.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy18
1 files changed, 3 insertions, 15 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index bcc74b4a710..a23a88b7559 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -5803,18 +5803,8 @@ create_table_option:
default_charset:
opt_default charset opt_equal charset_name_or_default
{
- HA_CREATE_INFO *cinfo= &Lex->create_info;
- if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
- cinfo->default_table_charset && $4 &&
- !my_charset_same(cinfo->default_table_charset,$4))
- {
- my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
- "CHARACTER SET ", cinfo->default_table_charset->csname,
- "CHARACTER SET ", $4->csname);
+ if (Lex->create_info.add_table_option_default_charset($4))
MYSQL_YYABORT;
- }
- Lex->create_info.default_table_charset= $4;
- Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
}
;
@@ -7646,10 +7636,8 @@ alter_list_item:
MYSQL_YYABORT;
}
LEX *lex= Lex;
- lex->create_info.table_charset=
- lex->create_info.default_table_charset= $5;
- lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
- HA_CREATE_USED_DEFAULT_CHARSET);
+ if (lex->create_info.add_alter_list_item_convert_to_charset($5))
+ MYSQL_YYABORT;
lex->alter_info.flags|= Alter_info::ALTER_CONVERT;
}
| create_table_options_space_separated