diff options
author | Alexander Barkov <bar@mysql.com> | 2010-03-22 16:27:59 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mysql.com> | 2010-03-22 16:27:59 +0400 |
commit | 19617d110c19d023cdc7572ce5b3624fdd2c2a9f (patch) | |
tree | aadb3f09efcb545b30b736b497f16da7b06c172a | |
parent | 8b28dec709d934a46a58469fb4d10de7f428e4ae (diff) | |
download | mariadb-git-19617d110c19d023cdc7572ce5b3624fdd2c2a9f.tar.gz |
Bug #51976 LDML collations issue
Problem: caseup_multiply and casedn_multiply members
were not initialized for a dynamic collation, so
UPPER() and LOWER() functions returned empty strings.
Fix: initializing the members properly.
Adding tests:
mysql-test/r/ctype_ldml.result
mysql-test/t/ctype_ldml.test
Applying the fix:
mysys/charset.c
-rw-r--r-- | mysql-test/r/ctype_ldml.result | 9 | ||||
-rw-r--r-- | mysql-test/t/ctype_ldml.test | 8 | ||||
-rw-r--r-- | mysys/charset.c | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result index d5585dcfad9..aa9fb478217 100644 --- a/mysql-test/r/ctype_ldml.result +++ b/mysql-test/r/ctype_ldml.result @@ -49,6 +49,15 @@ SELECT * FROM t1 WHERE LOWER(a)=LOWER('N'); a DROP TABLE t1; # +# Bug#51976 LDML collations issue (cyrillic example) +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci); +INSERT INTO t1 (a) VALUES ('Hello'); +SELECT a, UPPER(a), LOWER(a) FROM t1; +a UPPER(a) LOWER(a) +Hello HELLO hello +DROP TABLE t1; +# # Bug#43827 Server closes connections and restarts # CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci); diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test index 0395de273de..9ab458ba516 100644 --- a/mysql-test/t/ctype_ldml.test +++ b/mysql-test/t/ctype_ldml.test @@ -46,6 +46,14 @@ SELECT * FROM t1 WHERE LOWER(a)=LOWER('N'); DROP TABLE t1; --echo # +--echo # Bug#51976 LDML collations issue (cyrillic example) +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci); +INSERT INTO t1 (a) VALUES ('Hello'); +SELECT a, UPPER(a), LOWER(a) FROM t1; +DROP TABLE t1; + +--echo # --echo # Bug#43827 Server closes connections and restarts --echo # # Crash happened with a user-defined utf8 collation, diff --git a/mysys/charset.c b/mysys/charset.c index 9678febc9ba..f15c445adde 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -245,6 +245,8 @@ static int add_collation(CHARSET_INFO *cs) if (cs_copy_data(all_charsets[cs->number],cs)) return MY_XML_ERROR; + newcs->caseup_multiply= newcs->casedn_multiply= 1; + if (!strcmp(cs->csname,"ucs2") ) { #if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS) |