From bde82a86f476891a541709d11a51bfc85edfca8e Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Fri, 17 Oct 2008 17:45:17 +0500 Subject: [PATCH] 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 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index a988c34b7ca..d82b2dd967e 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -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,15 +2779,18 @@ int handler::check_collation_compatibility() continue; Field *field= table->field[key_part->fieldnr - 1]; uint cs_number= field->charset()->number; - 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 */ - cs_number == 20 || /* latin7_estonian_cs - bug #29461 */ - 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 */ + 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 */ + cs_number == 20 || /* latin7_estonian_cs - bug #29461 */ + 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 */ + (mysql_version < 50124 && + (cs_number == 33 || /* utf8_general_ci - bug #27877 */ + cs_number == 35))) /* ucs2_general_ci - bug #27877 */ return HA_ADMIN_NEEDS_UPGRADE; } }