From 192678e7bf57eba9710c3000a7d0b6711380d545 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sat, 9 Nov 2013 00:20:07 +0200 Subject: MDEV-5241: Collation incompatibilities with MySQL-5.6 - Character set code & tests from Alexander Barkov - Integration with ALTER TABLE, REPAIR and open_table from Monty The problem was that MySQL 5.6 added some croatian and vitanamese character set collations that are incompatible with MariaDB. The fix is to move the MariaDB conflicting collation numbers out of the region that MySQL is likely to use. mysql_upgrade, REPAIR TABLE or ALTER TABLE will fix the collations. If one tries to access and old incompatible table, one will get the error "Table upgrade required...." After this patch, MariaDB supports all the MySQL character set collations and the old MariaDB croatian collations, which are closer to the latest standard than the MySQL versions. New character sets: ucs2_croatian_mysql561_uca_ci utf8_croatian_mysql561_uca_ci utf16_croatian_mysql561_uca_ci utf32_croatian_mysql561_uca_ci utf8mb4_croatian_mysql561_uca_ci Other things: - Fixed some compiler warnings - mysql_upgrade prints information about repaired tables. - Increased version number VERSION: Increased VERSION number client/mysqlcheck.c: Print repaired table name when using --verbose include/m_ctype.h: Add new MariaDB collation regions that are not likely to conflict with MySQL include/my_base.h: Added flag to detect if table was opened for ALTER TABLE mysql-test/r/ctype_ldml.result: Updated result mysql-test/r/ctype_uca.result: Updated result mysql-test/r/ctype_upgrade.result: Updated result mysql-test/r/ctype_utf16_uca.result: Updated result mysql-test/r/ctype_utf32_uca.result: Updated result mysql-test/r/ctype_utf8mb4_uca.result: Updated result mysql-test/std_data/ctype_upgrade: Test files for testing upgrading of conflicting collations mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result: New collations added mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result: New collations added mysql-test/suite/innodb/r/innodb_ctype_ldml.result: Updated test result mysql-test/suite/innodb/t/innodb_ctype_ldml.test: Updated test result mysql-test/suite/plugins/r/show_all_plugins.result: Updated version number mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result: Updated version number mysql-test/t/ctype_ldml.test: Updated test mysql-test/t/ctype_uca.test: Testing of new collations mysql-test/t/ctype_upgrade.test: Testing of upgrading tables with old collations The test ensures that: - We will get an error if we try to open a table with old collations. - CHECK TABLE will detect that the table needs to be upgraded. - ALTER TABLE and REPAIR will fix the table. - mysql_upgrade works as expected mysql-test/t/ctype_utf16_uca.test: Testing of new collations mysql-test/t/ctype_utf32_uca.test: Testing of new collations mysql-test/t/ctype_utf8mb4_uca.test: Testing of new collations mysys/charset-def.c: Added new character sets mysys/charset.c: Always give an error, if requested, if a character set didn't exist sql/handler.cc: - Added upgrade_collation() to check if collation is compatible with old version - check_collation_compatibility() checks if we are using an old collation from MariaDB 5.5 or MySQL 5.6 - ha_check_for_upgrade() returns HA_ADMIN_NEEDS_ALTER if we have an incompatible collation sql/handler.h: Added new prototypes sql/sql_table.cc: - Mark that tables are opened for ALTER TABLE - If table needs to be upgraded, ensure we are not using online alter table. sql/table.cc: - If we are using an old incompatible collation, change to use the new one and mark table as incompatible. - Give an error if we try to open an incompatible table. sql/table.h: Added error that table needs to be rebuild storage/connect/ha_connect.cc: Fixed compiler warning strings/ctype-uca.c: New character sets --- .../ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYD | Bin 0 -> 21 bytes .../ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYI | Bin 0 -> 1024 bytes .../ctype_upgrade/maria050313_ucs2_croatian_ci_def.frm | Bin 0 -> 8554 bytes .../ctype_upgrade/maria050313_utf8_croatian_ci.MYD | Bin 0 -> 80 bytes .../ctype_upgrade/maria050313_utf8_croatian_ci.MYI | Bin 0 -> 1024 bytes .../ctype_upgrade/maria050313_utf8_croatian_ci.frm | Bin 0 -> 8554 bytes .../ctype_upgrade/maria050533_xxx_croatian_ci.MYD | Bin 0 -> 176 bytes .../ctype_upgrade/maria050533_xxx_croatian_ci.MYI | Bin 0 -> 1024 bytes .../ctype_upgrade/maria050533_xxx_croatian_ci.frm | Bin 0 -> 8650 bytes .../ctype_upgrade/maria100004_xxx_croatian_ci.MYD | Bin 0 -> 176 bytes .../ctype_upgrade/maria100004_xxx_croatian_ci.MYI | Bin 0 -> 1024 bytes .../ctype_upgrade/maria100004_xxx_croatian_ci.frm | Bin 0 -> 679 bytes .../ctype_upgrade/mysql050614_xxx_croatian_ci.MYD | Bin 0 -> 176 bytes .../ctype_upgrade/mysql050614_xxx_croatian_ci.MYI | Bin 0 -> 1024 bytes .../ctype_upgrade/mysql050614_xxx_croatian_ci.frm | Bin 0 -> 8650 bytes 15 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYD create mode 100644 mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYI create mode 100644 mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.frm create mode 100644 mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.MYD create mode 100644 mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.MYI create mode 100644 mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.frm create mode 100644 mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.MYD create mode 100644 mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.MYI create mode 100644 mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.frm create mode 100644 mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.MYD create mode 100644 mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.MYI create mode 100644 mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.frm create mode 100644 mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.MYD create mode 100644 mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.MYI create mode 100644 mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.frm (limited to 'mysql-test/std_data') diff --git a/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYD b/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYD new file mode 100644 index 00000000000..4d8505c8ef4 Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYD differ diff --git a/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYI b/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYI new file mode 100644 index 00000000000..a8992fd55e0 Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.MYI differ diff --git a/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.frm b/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.frm new file mode 100644 index 00000000000..936f485f80e Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050313_ucs2_croatian_ci_def.frm differ diff --git a/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.MYD b/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.MYD new file mode 100644 index 00000000000..1a6557647d1 Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.MYD differ diff --git a/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.MYI b/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.MYI new file mode 100644 index 00000000000..b55b64612dd Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.MYI differ diff --git a/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.frm b/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.frm new file mode 100644 index 00000000000..22645fbec0d Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050313_utf8_croatian_ci.frm differ diff --git a/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.MYD b/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.MYD new file mode 100644 index 00000000000..4b9377d704c Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.MYD differ diff --git a/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.MYI b/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.MYI new file mode 100644 index 00000000000..7d349ed7bb3 Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.MYI differ diff --git a/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.frm b/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.frm new file mode 100644 index 00000000000..759d57f3088 Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria050533_xxx_croatian_ci.frm differ diff --git a/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.MYD b/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.MYD new file mode 100644 index 00000000000..4b9377d704c Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.MYD differ diff --git a/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.MYI b/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.MYI new file mode 100644 index 00000000000..15336f19ec9 Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.MYI differ diff --git a/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.frm b/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.frm new file mode 100644 index 00000000000..adb520df85c Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/maria100004_xxx_croatian_ci.frm differ diff --git a/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.MYD b/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.MYD new file mode 100644 index 00000000000..4b9377d704c Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.MYD differ diff --git a/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.MYI b/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.MYI new file mode 100644 index 00000000000..de1ec112abb Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.MYI differ diff --git a/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.frm b/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.frm new file mode 100644 index 00000000000..d26ba4f7e85 Binary files /dev/null and b/mysql-test/std_data/ctype_upgrade/mysql050614_xxx_croatian_ci.frm differ -- cgit v1.2.1