Commit 177522a4 authored by Alexander Barkov's avatar Alexander Barkov

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
parent 92c7521f
......@@ -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);
......
......@@ -45,6 +45,14 @@ INSERT INTO t1 (a) VALUES ('hello!');
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 #
......
......@@ -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)
......
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