mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -6296,3 +6296,22 @@ fl_create_iterator(enum handler_iterator_type type,
|
||||
}
|
||||
}
|
||||
#endif /*TRANS_LOG_MGM_EXAMPLE_CODE*/
|
||||
|
||||
|
||||
bool HA_CREATE_INFO::check_conflicting_charset_declarations(CHARSET_INFO *cs)
|
||||
{
|
||||
if ((used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
|
||||
/* DEFAULT vs explicit, or explicit vs DEFAULT */
|
||||
(((default_table_charset == NULL) != (cs == NULL)) ||
|
||||
/* Two different explicit character sets */
|
||||
(default_table_charset && cs &&
|
||||
!my_charset_same(default_table_charset, cs))))
|
||||
{
|
||||
my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
|
||||
"CHARACTER SET ", default_table_charset ?
|
||||
default_table_charset->csname : "DEFAULT",
|
||||
"CHARACTER SET ", cs ? cs->csname : "DEFAULT");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user