summaryrefslogtreecommitdiff
path: root/mysys/charset-def.c
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-11-09 00:20:07 +0200
committerMichael Widenius <monty@askmonty.org>2013-11-09 00:20:07 +0200
commit192678e7bf57eba9710c3000a7d0b6711380d545 (patch)
tree53269f3c073b706d74335ded6029724f7fa5d7b9 /mysys/charset-def.c
parent273bcb92c1c126bc9cfa973d925b8e1da1b3c1bb (diff)
downloadmariadb-git-192678e7bf57eba9710c3000a7d0b6711380d545.tar.gz
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
Diffstat (limited to 'mysys/charset-def.c')
-rw-r--r--mysys/charset-def.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index de4d6387a52..938d228b020 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -43,6 +43,7 @@ extern struct charset_info_st my_charset_ucs2_roman_uca_ci;
extern struct charset_info_st my_charset_ucs2_persian_uca_ci;
extern struct charset_info_st my_charset_ucs2_esperanto_uca_ci;
extern struct charset_info_st my_charset_ucs2_hungarian_uca_ci;
+extern struct charset_info_st my_charset_ucs2_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_ucs2_sinhala_uca_ci;
extern struct charset_info_st my_charset_ucs2_croatian_uca_ci;
#endif
@@ -68,6 +69,7 @@ extern struct charset_info_st my_charset_utf32_roman_uca_ci;
extern struct charset_info_st my_charset_utf32_persian_uca_ci;
extern struct charset_info_st my_charset_utf32_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf32_hungarian_uca_ci;
+extern struct charset_info_st my_charset_utf32_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf32_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf32_croatian_uca_ci;
#endif /* HAVE_CHARSET_utf32 */
@@ -93,6 +95,7 @@ extern struct charset_info_st my_charset_utf16_roman_uca_ci;
extern struct charset_info_st my_charset_utf16_persian_uca_ci;
extern struct charset_info_st my_charset_utf16_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf16_hungarian_uca_ci;
+extern struct charset_info_st my_charset_utf16_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf16_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf16_croatian_uca_ci;
#endif /* HAVE_CHARSET_utf16 */
@@ -118,6 +121,7 @@ extern struct charset_info_st my_charset_utf8_roman_uca_ci;
extern struct charset_info_st my_charset_utf8_persian_uca_ci;
extern struct charset_info_st my_charset_utf8_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf8_hungarian_uca_ci;
+extern struct charset_info_st my_charset_utf8_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf8_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf8_croatian_uca_ci;
#ifdef HAVE_UTF8_GENERAL_CS
@@ -145,6 +149,7 @@ extern struct charset_info_st my_charset_utf8mb4_roman_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_persian_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_hungarian_uca_ci;
+extern struct charset_info_st my_charset_utf8mb4_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_croatian_uca_ci;
#endif /* HAVE_CHARSET_utf8mb4 */
@@ -235,6 +240,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_persian_uca_ci);
add_compiled_collation(&my_charset_ucs2_esperanto_uca_ci);
add_compiled_collation(&my_charset_ucs2_hungarian_uca_ci);
+ add_compiled_collation(&my_charset_ucs2_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_ucs2_sinhala_uca_ci);
add_compiled_collation(&my_charset_ucs2_croatian_uca_ci);
#endif
@@ -273,6 +279,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_persian_uca_ci);
add_compiled_collation(&my_charset_utf8_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf8_hungarian_uca_ci);
+ add_compiled_collation(&my_charset_utf8_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf8_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf8_croatian_uca_ci);
#endif
@@ -303,6 +310,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8mb4_persian_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_hungarian_uca_ci);
+ add_compiled_collation(&my_charset_utf8mb4_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_croatian_uca_ci);
#endif /* HAVE_UCA_COLLATIONS */
@@ -335,6 +343,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf16_persian_uca_ci);
add_compiled_collation(&my_charset_utf16_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf16_hungarian_uca_ci);
+ add_compiled_collation(&my_charset_utf16_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf16_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf16_croatian_uca_ci);
#endif /* HAVE_UCA_COLLATIONS */
@@ -365,6 +374,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf32_persian_uca_ci);
add_compiled_collation(&my_charset_utf32_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf32_hungarian_uca_ci);
+ add_compiled_collation(&my_charset_utf32_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf32_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf32_croatian_uca_ci);
#endif /* HAVE_UCA_COLLATIONS */