summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2023-02-17 16:20:01 +0400
committerAlexander Barkov <bar@mariadb.com>2023-02-17 17:33:27 +0400
commit7f6b648d7db895c09a6ace3b5ee62a5fb482a8e0 (patch)
tree66e727d8e65166497e68447ba659650d0cd53768 /mysql-test/include
parent345356b868d840554a8572876efc027d3ccd9842 (diff)
downloadmariadb-git-7f6b648d7db895c09a6ace3b5ee62a5fb482a8e0.tar.gz
MDEV-30661 UPPER() returns an empty string for U+0251 in uca1400 collations for utf8
String length growth during upper/lower conversion in Unicode collations depends only on the underlying MY_UNICASE_INFO used in the collation. Maintaining a separate member CHARSET_INFO::caseup_multiply and CHARSET_INFO::casedn_multiply duplicated this information and caused bugs like this (when MY_UNICASE_INFO and case??_multiply when out of sync because of incomplete CHARSET_INFO initialization). Fix: Changing CHARSET_INFO::caseup_multiply and CHARSET_INFO::casedn_multiply from members to virtual functions. The virtual functions in Unicode collations calculate case conversion growth factors from the MY_UNICASE_INFO. This guarantees that the growth factors are always in sync with the MY_UNICASE_INFO.
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/ctype_casefolding.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/include/ctype_casefolding.inc b/mysql-test/include/ctype_casefolding.inc
index 4ee402c95ad..74b2ab7650a 100644
--- a/mysql-test/include/ctype_casefolding.inc
+++ b/mysql-test/include/ctype_casefolding.inc
@@ -13,6 +13,14 @@ INSERT INTO case_folding (code) VALUES
(0x26B),
(0x271),
(0x27D);
+
+INSERT INTO case_folding (code) VALUES
+(0x0049) /* LATIN CAPITAL LETTER I */,
+(0x0069) /* LATIN SMALL LETTER I */,
+(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
+(0x0131) /* LATIN SMALL LETTER DOTLESS I */
+;
+
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
DROP TABLE case_folding;