Commit bc546225 authored by Alexander Barkov's avatar Alexander Barkov

Adding collations

utf8mb4_thai_520_w2, ucs2_thai_520_w2, utf16_thai_520_w2, utf32_thai_520_w2
parent c5733e57
...@@ -109,14 +109,19 @@ INSERT INTO t1 VALUES ('๑๐ ลิตร {10 litre}'); ...@@ -109,14 +109,19 @@ INSERT INTO t1 VALUES ('๑๐ ลิตร {10 litre}');
# To avoid problems with unpredictable order or 'AA' and 'aa' # To avoid problems with unpredictable order or 'AA' and 'aa'
ALTER TABLE t1 ORDER BY a; ALTER TABLE t1 ORDER BY a;
SET @backup_character_set_connection=@@character_set_connection;
SET @backup_collation_connection=@@collation_connection;
SET NAMES utf8;
SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)', SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)',
' CHARACTER SET ', @@character_set_connection, ' CHARACTER SET ', @backup_character_set_connection,
' COLLATE ', @@collation_connection, ' COLLATE ', @backup_collation_connection,
' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY' ' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
' , ADD KEY a_id (a, id)'); ' , ADD KEY a_id (a, id)');
PREPARE stmt FROM @stmt; PREPARE stmt FROM @stmt;
EXECUTE stmt; EXECUTE stmt;
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
SET collation_connection=@backup_collation_connection;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--echo # --echo #
......
...@@ -28,12 +28,18 @@ INSERT INTO t1 VALUES ('A'),('À'),('Á'),('Â'),('Ã'),('Ä'),('Å'); ...@@ -28,12 +28,18 @@ INSERT INTO t1 VALUES ('A'),('À'),('Á'),('Â'),('Ã'),('Ä'),('Å');
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)', SET @backup_character_set_connection=@@character_set_connection;
' CHARACTER SET ', @@character_set_connection, SET @backup_collation_connection=@@collation_connection;
' COLLATE ', @@collation_connection);
SET NAMES utf8;
SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin,
' CHARACTER SET ', @backup_character_set_connection,
' COLLATE ', @backup_collation_connection);
PREPARE stmt FROM @stmt; PREPARE stmt FROM @stmt;
EXECUTE stmt; EXECUTE stmt;
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
SET collation_connection=@backup_collation_connection;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -114,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # # ...@@ -114,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # #
ucs2_general_mysql500_ci ucs2 159 # # ucs2_general_mysql500_ci ucs2 159 # #
ucs2_croatian_ci ucs2 640 # # ucs2_croatian_ci ucs2 640 # #
ucs2_myanmar_ci ucs2 641 # # ucs2_myanmar_ci ucs2 641 # #
ucs2_thai_520_w2 ucs2 642 # #
cp866_general_ci cp866 36 Yes # # cp866_general_ci cp866 36 Yes # #
cp866_bin cp866 68 # # cp866_bin cp866 68 # #
keybcs2_general_ci keybcs2 37 Yes # # keybcs2_general_ci keybcs2 37 Yes # #
...@@ -156,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # # ...@@ -156,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # #
utf8mb4_vietnamese_ci utf8mb4 247 # # utf8mb4_vietnamese_ci utf8mb4 247 # #
utf8mb4_croatian_ci utf8mb4 608 # # utf8mb4_croatian_ci utf8mb4 608 # #
utf8mb4_myanmar_ci utf8mb4 609 # # utf8mb4_myanmar_ci utf8mb4 609 # #
utf8mb4_thai_520_w2 utf8mb4 610 # #
cp1251_bulgarian_ci cp1251 14 # # cp1251_bulgarian_ci cp1251 14 # #
cp1251_ukrainian_ci cp1251 23 # # cp1251_ukrainian_ci cp1251 23 # #
cp1251_bin cp1251 50 # # cp1251_bin cp1251 50 # #
...@@ -189,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # # ...@@ -189,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # #
utf16_vietnamese_ci utf16 124 # # utf16_vietnamese_ci utf16 124 # #
utf16_croatian_ci utf16 672 # # utf16_croatian_ci utf16 672 # #
utf16_myanmar_ci utf16 673 # # utf16_myanmar_ci utf16 673 # #
utf16_thai_520_w2 utf16 674 # #
utf16le_general_ci utf16le 56 Yes # # utf16le_general_ci utf16le 56 Yes # #
utf16le_bin utf16le 62 # # utf16le_bin utf16le 62 # #
cp1256_general_ci cp1256 57 Yes # # cp1256_general_ci cp1256 57 Yes # #
...@@ -224,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # # ...@@ -224,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # #
utf32_vietnamese_ci utf32 183 # # utf32_vietnamese_ci utf32 183 # #
utf32_croatian_ci utf32 736 # # utf32_croatian_ci utf32 736 # #
utf32_myanmar_ci utf32 737 # # utf32_myanmar_ci utf32 737 # #
utf32_thai_520_w2 utf32 738 # #
binary binary 63 Yes # # binary binary 63 Yes # #
geostd8_general_ci geostd8 92 Yes # # geostd8_general_ci geostd8 92 Yes # #
geostd8_bin geostd8 93 # # geostd8_bin geostd8 93 # #
......
...@@ -114,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # # ...@@ -114,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # #
ucs2_general_mysql500_ci ucs2 159 # # ucs2_general_mysql500_ci ucs2 159 # #
ucs2_croatian_ci ucs2 640 # # ucs2_croatian_ci ucs2 640 # #
ucs2_myanmar_ci ucs2 641 # # ucs2_myanmar_ci ucs2 641 # #
ucs2_thai_520_w2 ucs2 642 # #
cp866_general_ci cp866 36 Yes # # cp866_general_ci cp866 36 Yes # #
cp866_bin cp866 68 # # cp866_bin cp866 68 # #
keybcs2_general_ci keybcs2 37 Yes # # keybcs2_general_ci keybcs2 37 Yes # #
...@@ -156,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # # ...@@ -156,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # #
utf8mb4_vietnamese_ci utf8mb4 247 # # utf8mb4_vietnamese_ci utf8mb4 247 # #
utf8mb4_croatian_ci utf8mb4 608 # # utf8mb4_croatian_ci utf8mb4 608 # #
utf8mb4_myanmar_ci utf8mb4 609 # # utf8mb4_myanmar_ci utf8mb4 609 # #
utf8mb4_thai_520_w2 utf8mb4 610 # #
cp1251_bulgarian_ci cp1251 14 # # cp1251_bulgarian_ci cp1251 14 # #
cp1251_ukrainian_ci cp1251 23 # # cp1251_ukrainian_ci cp1251 23 # #
cp1251_bin cp1251 50 # # cp1251_bin cp1251 50 # #
...@@ -189,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # # ...@@ -189,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # #
utf16_vietnamese_ci utf16 124 # # utf16_vietnamese_ci utf16 124 # #
utf16_croatian_ci utf16 672 # # utf16_croatian_ci utf16 672 # #
utf16_myanmar_ci utf16 673 # # utf16_myanmar_ci utf16 673 # #
utf16_thai_520_w2 utf16 674 # #
utf16le_general_ci utf16le 56 Yes # # utf16le_general_ci utf16le 56 Yes # #
utf16le_bin utf16le 62 # # utf16le_bin utf16le 62 # #
cp1256_general_ci cp1256 57 Yes # # cp1256_general_ci cp1256 57 Yes # #
...@@ -224,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # # ...@@ -224,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # #
utf32_vietnamese_ci utf32 183 # # utf32_vietnamese_ci utf32 183 # #
utf32_croatian_ci utf32 736 # # utf32_croatian_ci utf32 736 # #
utf32_myanmar_ci utf32 737 # # utf32_myanmar_ci utf32 737 # #
utf32_thai_520_w2 utf32 738 # #
binary binary 63 Yes # # binary binary 63 Yes # #
geostd8_general_ci geostd8 92 Yes # # geostd8_general_ci geostd8 92 Yes # #
geostd8_bin geostd8 93 # # geostd8_bin geostd8 93 # #
......
...@@ -56,6 +56,9 @@ SELECT * FROM v1; ...@@ -56,6 +56,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci;
SELECT * FROM v1; SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_thai_520_w2;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4;
SELECT * FROM v1; SELECT * FROM v1;
...@@ -71,6 +74,9 @@ SELECT * FROM v1; ...@@ -71,6 +74,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci;
SELECT * FROM v1; SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
SELECT * FROM v1; SELECT * FROM v1;
...@@ -86,6 +92,9 @@ SELECT * FROM v1; ...@@ -86,6 +92,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
SELECT * FROM v1; SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16;
SELECT * FROM v1; SELECT * FROM v1;
...@@ -101,6 +110,9 @@ SELECT * FROM v1; ...@@ -101,6 +110,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci;
SELECT * FROM v1; SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_thai_520_w2;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci;
SELECT * FROM v1; SELECT * FROM v1;
...@@ -116,6 +128,9 @@ SELECT * FROM v1; ...@@ -116,6 +128,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci;
SELECT * FROM v1; SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_thai_520_w2;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci;
SELECT * FROM v1; SELECT * FROM v1;
......
...@@ -648,6 +648,11 @@ SET NAMES utf8 COLLATE utf8_thai_520_w2; ...@@ -648,6 +648,11 @@ SET NAMES utf8 COLLATE utf8_thai_520_w2;
--source include/ctype_uca_w2.inc --source include/ctype_uca_w2.inc
--source include/ctype_thai.inc --source include/ctype_thai.inc
SET NAMES utf8;
SET collation_connection=ucs2_thai_520_w2;
--source include/ctype_uca_w2.inc
--source include/ctype_thai.inc
--echo # --echo #
--echo # End of MariaDB-10.1 tests --echo # End of MariaDB-10.1 tests
--echo # --echo #
...@@ -208,3 +208,16 @@ SET collation_connection=utf16_myanmar_ci; ...@@ -208,3 +208,16 @@ SET collation_connection=utf16_myanmar_ci;
--echo # --echo #
--echo # End of MariaDB-10.0 tests --echo # End of MariaDB-10.0 tests
--echo # --echo #
--echo #
--echo # Start of 10.1 tests
--echo #
SET NAMES utf8;
SET collation_connection=utf16_thai_520_w2;
--source include/ctype_uca_w2.inc
--source include/ctype_thai.inc
--echo #
--echo # End of 10.1 tests
--echo #
...@@ -229,3 +229,16 @@ SET collation_connection=utf32_myanmar_ci; ...@@ -229,3 +229,16 @@ SET collation_connection=utf32_myanmar_ci;
--echo # --echo #
--echo # End of MariaDB-10.0 tests --echo # End of MariaDB-10.0 tests
--echo # --echo #
--echo #
--echo # Start of 10.1 tests
--echo #
SET NAMES utf8;
SET collation_connection=utf32_thai_520_w2;
--source include/ctype_uca_w2.inc
--source include/ctype_thai.inc
--echo #
--echo # End of 10.1 tests
--echo #
...@@ -70,3 +70,16 @@ SET NAMES utf8mb4 COLLATE utf8mb4_myanmar_ci; ...@@ -70,3 +70,16 @@ SET NAMES utf8mb4 COLLATE utf8mb4_myanmar_ci;
--echo # --echo #
--echo # End of MariaDB-10.0 tests --echo # End of MariaDB-10.0 tests
--echo # --echo #
--echo #
--echo # Start of 10.1 tests
--echo #
SET NAMES utf8;
SET collation_connection=utf8mb4_thai_520_w2;
--source include/ctype_uca_w2.inc
--source include/ctype_thai.inc
--echo #
--echo # End of 10.1 tests
--echo #
...@@ -49,6 +49,7 @@ extern struct charset_info_st my_charset_ucs2_unicode_520_ci; ...@@ -49,6 +49,7 @@ extern struct charset_info_st my_charset_ucs2_unicode_520_ci;
extern struct charset_info_st my_charset_ucs2_vietnamese_ci; extern struct charset_info_st my_charset_ucs2_vietnamese_ci;
extern struct charset_info_st my_charset_ucs2_croatian_uca_ci; extern struct charset_info_st my_charset_ucs2_croatian_uca_ci;
extern struct charset_info_st my_charset_ucs2_myanmar_uca_ci; extern struct charset_info_st my_charset_ucs2_myanmar_uca_ci;
extern struct charset_info_st my_charset_ucs2_thai_520_w2;
#endif #endif
...@@ -78,6 +79,7 @@ extern struct charset_info_st my_charset_utf32_unicode_520_ci; ...@@ -78,6 +79,7 @@ extern struct charset_info_st my_charset_utf32_unicode_520_ci;
extern struct charset_info_st my_charset_utf32_vietnamese_ci; extern struct charset_info_st my_charset_utf32_vietnamese_ci;
extern struct charset_info_st my_charset_utf32_croatian_uca_ci; extern struct charset_info_st my_charset_utf32_croatian_uca_ci;
extern struct charset_info_st my_charset_utf32_myanmar_uca_ci; extern struct charset_info_st my_charset_utf32_myanmar_uca_ci;
extern struct charset_info_st my_charset_utf32_thai_520_w2;
#endif /* HAVE_CHARSET_utf32 */ #endif /* HAVE_CHARSET_utf32 */
...@@ -107,6 +109,7 @@ extern struct charset_info_st my_charset_utf16_unicode_520_ci; ...@@ -107,6 +109,7 @@ extern struct charset_info_st my_charset_utf16_unicode_520_ci;
extern struct charset_info_st my_charset_utf16_vietnamese_ci; extern struct charset_info_st my_charset_utf16_vietnamese_ci;
extern struct charset_info_st my_charset_utf16_croatian_uca_ci; extern struct charset_info_st my_charset_utf16_croatian_uca_ci;
extern struct charset_info_st my_charset_utf16_myanmar_uca_ci; extern struct charset_info_st my_charset_utf16_myanmar_uca_ci;
extern struct charset_info_st my_charset_utf16_thai_520_w2;
#endif /* HAVE_CHARSET_utf16 */ #endif /* HAVE_CHARSET_utf16 */
...@@ -133,10 +136,10 @@ extern struct charset_info_st my_charset_utf8_hungarian_uca_ci; ...@@ -133,10 +136,10 @@ 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_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf8_sinhala_uca_ci; extern struct charset_info_st my_charset_utf8_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf8_unicode_520_ci; extern struct charset_info_st my_charset_utf8_unicode_520_ci;
extern struct charset_info_st my_charset_utf8_thai_520_w2;
extern struct charset_info_st my_charset_utf8_vietnamese_ci; extern struct charset_info_st my_charset_utf8_vietnamese_ci;
extern struct charset_info_st my_charset_utf8_croatian_uca_ci; extern struct charset_info_st my_charset_utf8_croatian_uca_ci;
extern struct charset_info_st my_charset_utf8_myanmar_uca_ci; extern struct charset_info_st my_charset_utf8_myanmar_uca_ci;
extern struct charset_info_st my_charset_utf8_thai_520_w2;
#ifdef HAVE_UTF8_GENERAL_CS #ifdef HAVE_UTF8_GENERAL_CS
extern struct charset_info_st my_charset_utf8_general_cs; extern struct charset_info_st my_charset_utf8_general_cs;
#endif #endif
...@@ -168,6 +171,7 @@ extern struct charset_info_st my_charset_utf8mb4_unicode_520_ci; ...@@ -168,6 +171,7 @@ extern struct charset_info_st my_charset_utf8mb4_unicode_520_ci;
extern struct charset_info_st my_charset_utf8mb4_vietnamese_ci; extern struct charset_info_st my_charset_utf8mb4_vietnamese_ci;
extern struct charset_info_st my_charset_utf8mb4_croatian_uca_ci; extern struct charset_info_st my_charset_utf8mb4_croatian_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci; extern struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_thai_520_w2;
#endif /* HAVE_CHARSET_utf8mb4 */ #endif /* HAVE_CHARSET_utf8mb4 */
#endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_UCA_COLLATIONS */
...@@ -262,6 +266,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -262,6 +266,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_vietnamese_ci); add_compiled_collation(&my_charset_ucs2_vietnamese_ci);
add_compiled_collation(&my_charset_ucs2_croatian_uca_ci); add_compiled_collation(&my_charset_ucs2_croatian_uca_ci);
add_compiled_collation(&my_charset_ucs2_myanmar_uca_ci); add_compiled_collation(&my_charset_ucs2_myanmar_uca_ci);
add_compiled_collation(&my_charset_ucs2_thai_520_w2);
#endif #endif
#endif #endif
...@@ -301,10 +306,10 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -301,10 +306,10 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_croatian_mysql561_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_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf8_unicode_520_ci); add_compiled_collation(&my_charset_utf8_unicode_520_ci);
add_compiled_collation(&my_charset_utf8_thai_520_w2);
add_compiled_collation(&my_charset_utf8_vietnamese_ci); add_compiled_collation(&my_charset_utf8_vietnamese_ci);
add_compiled_collation(&my_charset_utf8_croatian_uca_ci); add_compiled_collation(&my_charset_utf8_croatian_uca_ci);
add_compiled_collation(&my_charset_utf8_myanmar_uca_ci); add_compiled_collation(&my_charset_utf8_myanmar_uca_ci);
add_compiled_collation(&my_charset_utf8_thai_520_w2);
#endif #endif
#endif /* HAVE_CHARSET_utf8 */ #endif /* HAVE_CHARSET_utf8 */
...@@ -339,6 +344,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -339,6 +344,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8mb4_vietnamese_ci); add_compiled_collation(&my_charset_utf8mb4_vietnamese_ci);
add_compiled_collation(&my_charset_utf8mb4_croatian_uca_ci); add_compiled_collation(&my_charset_utf8mb4_croatian_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_myanmar_uca_ci); add_compiled_collation(&my_charset_utf8mb4_myanmar_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_thai_520_w2);
#endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_UCA_COLLATIONS */
#endif /* HAVE_CHARSET_utf8mb4 */ #endif /* HAVE_CHARSET_utf8mb4 */
...@@ -375,6 +381,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -375,6 +381,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf16_vietnamese_ci); add_compiled_collation(&my_charset_utf16_vietnamese_ci);
add_compiled_collation(&my_charset_utf16_croatian_uca_ci); add_compiled_collation(&my_charset_utf16_croatian_uca_ci);
add_compiled_collation(&my_charset_utf16_myanmar_uca_ci); add_compiled_collation(&my_charset_utf16_myanmar_uca_ci);
add_compiled_collation(&my_charset_utf16_thai_520_w2);
#endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_UCA_COLLATIONS */
#endif /* HAVE_CHARSET_utf16 */ #endif /* HAVE_CHARSET_utf16 */
...@@ -409,6 +416,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -409,6 +416,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf32_vietnamese_ci); add_compiled_collation(&my_charset_utf32_vietnamese_ci);
add_compiled_collation(&my_charset_utf32_croatian_uca_ci); add_compiled_collation(&my_charset_utf32_croatian_uca_ci);
add_compiled_collation(&my_charset_utf32_myanmar_uca_ci); add_compiled_collation(&my_charset_utf32_myanmar_uca_ci);
add_compiled_collation(&my_charset_utf32_thai_520_w2);
#endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_UCA_COLLATIONS */
#endif /* HAVE_CHARSET_utf32 */ #endif /* HAVE_CHARSET_utf32 */
......
...@@ -34167,6 +34167,23 @@ static size_t my_strnxfrmlen_any_uca_multilevel(CHARSET_INFO *cs, size_t len) ...@@ -34167,6 +34167,23 @@ static size_t my_strnxfrmlen_any_uca_multilevel(CHARSET_INFO *cs, size_t len)
return my_strnxfrmlen_any_uca(cs, len) * cs->levels_for_order; return my_strnxfrmlen_any_uca(cs, len) * cs->levels_for_order;
} }
MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel=
{
my_coll_init_uca_multilevel,
my_strnncoll_any_uca_multilevel,
my_strnncollsp_any_uca_multilevel,
my_strnxfrm_any_uca_multilevel,
my_strnxfrmlen_any_uca_multilevel,
my_like_range_generic,
my_wildcmp_uca,
NULL,
my_instr_mb,
my_hash_sort_any_uca,
my_propagate_complex
};
#ifdef HAVE_CHARSET_ucs2 #ifdef HAVE_CHARSET_ucs2
/* /*
UCS2 optimized CHARSET_INFO compatible wrappers. UCS2 optimized CHARSET_INFO compatible wrappers.
...@@ -35000,6 +35017,38 @@ struct charset_info_st my_charset_ucs2_myanmar_uca_ci= ...@@ -35000,6 +35017,38 @@ struct charset_info_st my_charset_ucs2_myanmar_uca_ci=
}; };
struct charset_info_st my_charset_ucs2_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UCS2+2,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* flags */
"ucs2", /* csname */
"ucs2_thai_520_w2", /* name */
"", /* comment */
"", /* tailoring */
NULL, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_unicase_unicode520,/* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
1, /* caseup_multiply */
1, /* casedn_multiply */
2, /* mbminlen */
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
2, /* levels_for_order */
&my_charset_ucs2_handler,
&my_collation_any_uca_handler_multilevel
};
struct charset_info_st my_charset_ucs2_unicode_520_ci= struct charset_info_st my_charset_ucs2_unicode_520_ci=
{ {
150,0,0, /* number */ 150,0,0, /* number */
...@@ -35085,21 +35134,6 @@ MY_COLLATION_HANDLER my_collation_any_uca_handler = ...@@ -35085,21 +35134,6 @@ MY_COLLATION_HANDLER my_collation_any_uca_handler =
my_propagate_complex my_propagate_complex
}; };
MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel=
{
my_coll_init_uca_multilevel, /* init */
my_strnncoll_any_uca_multilevel,
my_strnncollsp_any_uca_multilevel,
my_strnxfrm_any_uca_multilevel,
my_strnxfrmlen_any_uca_multilevel,
my_like_range_mb,
my_wildcmp_uca,
NULL,
my_instr_mb,
my_hash_sort_any_uca,
my_propagate_complex
};
/* /*
We consider bytes with code more than 127 as a letter. We consider bytes with code more than 127 as a letter.
This garantees that word boundaries work fine with regular This garantees that word boundaries work fine with regular
...@@ -35941,7 +35975,7 @@ struct charset_info_st my_charset_utf8_thai_520_w2= ...@@ -35941,7 +35975,7 @@ struct charset_info_st my_charset_utf8_thai_520_w2=
MY_PAGE2_COLLATION_ID_UTF8+2,0,0, /* number */ MY_PAGE2_COLLATION_ID_UTF8+2,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
MY_UTF8MB3, /* csname */ MY_UTF8MB3, /* csname */
MY_UTF8MB3 "_thai_520_w2",/* name */ MY_UTF8MB3 "_thai_520_w2",/* name */
"", /* comment */ "", /* comment */
"", /* tailoring */ "", /* tailoring */
ctype_utf8, /* ctype */ ctype_utf8, /* ctype */
...@@ -36782,6 +36816,37 @@ struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci= ...@@ -36782,6 +36816,37 @@ struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci=
&my_collation_any_uca_handler &my_collation_any_uca_handler
}; };
struct charset_info_st my_charset_utf8mb4_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UTF8MB4+2,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* flags */
MY_UTF8MB4, /* csname */
MY_UTF8MB4 "_thai_520_w2", /* name */
"", /* comment */
"", /* tailoring */
ctype_utf8, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_unicase_unicode520,/* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
1, /* caseup_multiply */
1, /* casedn_multiply */
1, /* mbminlen */
4, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
2, /* levels_for_order */
&my_charset_utf8mb4_handler,
&my_collation_any_uca_handler_multilevel
};
struct charset_info_st my_charset_utf8mb4_unicode_520_ci= struct charset_info_st my_charset_utf8mb4_unicode_520_ci=
{ {
...@@ -37645,6 +37710,39 @@ struct charset_info_st my_charset_utf32_myanmar_uca_ci= ...@@ -37645,6 +37710,39 @@ struct charset_info_st my_charset_utf32_myanmar_uca_ci=
}; };
struct charset_info_st my_charset_utf32_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UTF32+2,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
"utf32", /* csname */
"utf32_thai_520_w2",/* name */
"", /* comment */
"", /* tailoring */
NULL, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_unicase_unicode520,/* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
1, /* caseup_multiply */
1, /* casedn_multiply */
4, /* mbminlen */
4, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
2, /* levels_for_order */
&my_charset_utf32_handler,
&my_collation_any_uca_handler_multilevel
};
struct charset_info_st my_charset_utf32_unicode_520_ci= struct charset_info_st my_charset_utf32_unicode_520_ci=
{ {
182,0,0, /* number */ 182,0,0, /* number */
...@@ -38510,6 +38608,39 @@ struct charset_info_st my_charset_utf16_myanmar_uca_ci= ...@@ -38510,6 +38608,39 @@ struct charset_info_st my_charset_utf16_myanmar_uca_ci=
}; };
struct charset_info_st my_charset_utf16_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UTF16+2,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
"utf16", /* cs name */
"utf16_thai_520_w2",/* name */
"", /* comment */
"", /* tailoring */
NULL, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_unicase_unicode520,/* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
1, /* caseup_multiply */
1, /* casedn_multiply */
2, /* mbminlen */
4, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
2, /* levels_for_order */
&my_charset_utf16_handler,
&my_collation_any_uca_handler_multilevel
};
struct charset_info_st my_charset_utf16_unicode_520_ci= struct charset_info_st my_charset_utf16_unicode_520_ci=
{ {
123,0,0, /* number */ 123,0,0, /* number */
...@@ -5447,6 +5447,38 @@ static uint my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)), ...@@ -5447,6 +5447,38 @@ static uint my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)),
} }
/*
TODO-10.2: join this with pad_max_char() in ctype-mb.c
*/
static void
my_fill_utf8_mb(CHARSET_INFO *cs, char *str, size_t length, int fill)
{
char *end= str + length;
char buf[10];
char buflen= cs->cset->native_to_mb(cs, (my_wc_t) fill, (uchar*) buf,
(uchar*) buf + sizeof(buf));
DBUG_ASSERT(buflen > 0);
for ( ; str + buflen <= end ; )
{
memcpy(str, buf, buflen);
str+= buflen;
}
for ( ; str < end; )
*str++= ' ';
}
static void
my_fill_utf8(CHARSET_INFO *cs, char *str, size_t length, int fill)
{
if (fill < 0x80)
my_fill_8bit(cs, str, length, fill);
else
my_fill_utf8_mb(cs, str, length, fill);
}
static MY_COLLATION_HANDLER my_collation_utf8_general_ci_handler = static MY_COLLATION_HANDLER my_collation_utf8_general_ci_handler =
{ {
NULL, /* init */ NULL, /* init */
...@@ -5514,7 +5546,7 @@ MY_CHARSET_HANDLER my_charset_utf8_handler= ...@@ -5514,7 +5546,7 @@ MY_CHARSET_HANDLER my_charset_utf8_handler=
my_snprintf_8bit, my_snprintf_8bit,
my_long10_to_str_8bit, my_long10_to_str_8bit,
my_longlong10_to_str_8bit, my_longlong10_to_str_8bit,
my_fill_8bit, my_fill_utf8,
my_strntol_8bit, my_strntol_8bit,
my_strntoul_8bit, my_strntoul_8bit,
my_strntoll_8bit, my_strntoll_8bit,
...@@ -7869,7 +7901,7 @@ MY_CHARSET_HANDLER my_charset_utf8mb4_handler= ...@@ -7869,7 +7901,7 @@ MY_CHARSET_HANDLER my_charset_utf8mb4_handler=
my_snprintf_8bit, my_snprintf_8bit,
my_long10_to_str_8bit, my_long10_to_str_8bit,
my_longlong10_to_str_8bit, my_longlong10_to_str_8bit,
my_fill_8bit, my_fill_utf8,
my_strntol_8bit, my_strntol_8bit,
my_strntoul_8bit, my_strntoul_8bit,
my_strntoll_8bit, my_strntoll_8bit,
......
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