Commit bba814d0 authored by Ramil Kalimullin's avatar Ramil Kalimullin

Fix for bug #40053: 'check table .. for upgrade' doesn't detect

collation change made in 5.1.24-rc

Problem: 'CHECK TABLE ... FOR UPGRADE' did not check for 
incompatible collation changes made in MySQL 5.1.24-rc.

Fix: add the check.


sql/handler.cc:
    - check for incompatible collation changes made in 5.1.24-rc:
  bug #27877:
    utf8_general_ci
    ucs2_general_ci
parent 0c20c0f1
......@@ -2765,7 +2765,7 @@ int handler::check_collation_compatibility()
{
ulong mysql_version= table->s->mysql_version;
if (mysql_version < 50048)
if (mysql_version < 50124)
{
KEY *key= table->key_info;
KEY *key_end= key + table->s->keys;
......@@ -2779,7 +2779,7 @@ int handler::check_collation_compatibility()
continue;
Field *field= table->field[key_part->fieldnr - 1];
uint cs_number= field->charset()->number;
if (mysql_version < 50048 &&
if ((mysql_version < 50048 &&
(cs_number == 11 || /* ascii_general_ci - bug #29499, bug #27562 */
cs_number == 41 || /* latin7_general_ci - bug #29461 */
cs_number == 42 || /* latin7_general_cs - bug #29461 */
......@@ -2787,7 +2787,10 @@ int handler::check_collation_compatibility()
cs_number == 21 || /* latin2_hungarian_ci - bug #29461 */
cs_number == 22 || /* koi8u_general_ci - bug #29461 */
cs_number == 23 || /* cp1251_ukrainian_ci - bug #29461 */
cs_number == 26)) /* cp1250_general_ci - bug #29461 */
cs_number == 26)) || /* cp1250_general_ci - bug #29461 */
(mysql_version < 50124 &&
(cs_number == 33 || /* utf8_general_ci - bug #27877 */
cs_number == 35))) /* ucs2_general_ci - bug #27877 */
return HA_ADMIN_NEEDS_UPGRADE;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment