mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-5241: Collation incompatibilities with MySQL-5.6
A clean-up: removing the code catching collation incompatibilities from handler::check_collation_compatibility(), as the collation IDs are already replaced at this point by TABLE_SHARE::init_from_binary_frm_image.
This commit is contained in:
@ -3534,39 +3534,6 @@ bool handler::get_error_message(int error, String* buf)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Check if a collation has changed number
|
||||
|
||||
@param mysql_version
|
||||
@param current collation number
|
||||
|
||||
@retval new collation number (same as current collation number of no change)
|
||||
*/
|
||||
|
||||
uint upgrade_collation(ulong mysql_version, uint cs_number)
|
||||
{
|
||||
if (mysql_version >= 50300 && mysql_version <= 50399)
|
||||
{
|
||||
switch (cs_number) {
|
||||
case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci
|
||||
case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci
|
||||
}
|
||||
}
|
||||
if ((mysql_version >= 50500 && mysql_version <= 50599) ||
|
||||
(mysql_version >= 100000 && mysql_version <= 100005))
|
||||
{
|
||||
switch (cs_number) {
|
||||
case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci
|
||||
case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci
|
||||
case 214: return MY_PAGE2_COLLATION_ID_UTF32; // utf32_croatian_ci
|
||||
case 215: return MY_PAGE2_COLLATION_ID_UTF16; // utf16_croatian_ci
|
||||
case 245: return MY_PAGE2_COLLATION_ID_UTF8MB4;// utf8mb4_croatian_ci
|
||||
}
|
||||
}
|
||||
return cs_number;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Check for incompatible collation changes.
|
||||
|
||||
@ -3611,25 +3578,6 @@ int handler::check_collation_compatibility()
|
||||
}
|
||||
}
|
||||
|
||||
if (mysql_version < 100006)
|
||||
{
|
||||
/*
|
||||
Check if we are using collations from that has changed numbering.
|
||||
This happend at least between MariaDB 5.5 and MariaDB 10.0 as MySQL
|
||||
added conflicting numbers.
|
||||
*/
|
||||
|
||||
if (table->s->table_charset->number !=
|
||||
upgrade_collation(mysql_version, table->s->table_charset->number))
|
||||
return HA_ADMIN_NEEDS_ALTER;
|
||||
|
||||
for (Field **field= table->field; (*field); field++)
|
||||
{
|
||||
if ((*field)->charset()->number !=
|
||||
upgrade_collation(mysql_version, (*field)->charset()->number))
|
||||
return HA_ADMIN_NEEDS_ALTER;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user