diff options
author | unknown <bar@mysql.com/bar.myoffice.izhnet.ru> | 2007-10-08 12:46:38 +0500 |
---|---|---|
committer | unknown <bar@mysql.com/bar.myoffice.izhnet.ru> | 2007-10-08 12:46:38 +0500 |
commit | 272bb6b5856a7f033e6826ba5a96b1ca52aabb12 (patch) | |
tree | 225dbb68221432e7e6565aea32d461f2ea523dc1 /sql/item_create.cc | |
parent | 5aba177bf6fd532386dcaf15e25ed7e9b1a44702 (diff) | |
download | mariadb-git-272bb6b5856a7f033e6826ba5a96b1ca52aabb12.tar.gz |
Bug#27580 SPACE() function collation bug?
Problem: when character_set_connection=utf8,
mixing SPACE() with a non-Unicode column (e.g. for concat)
produced "illegal mix of collations" error.
Fix: Item_string() corresponding to space character
is now created using "ASCII" repertoire. Previously
it was incorrectly created using "UNICODE" repertoure, which
didn't allow to convert results of SPACE() to a non-Unicode
character set.
mysql-test/include/ctype_common.inc:
- Adding test for bug#27580
- Restoring previous values of character_set_client and character_set_results,
because ctype_common.inc now changes them when doing "set names utf8"
in the test for bug#27580
mysql-test/r/ctype_big5.result:
Adding test
mysql-test/r/ctype_cp1250_ch.result:
Adding test
mysql-test/r/ctype_euckr.result:
Adding test
mysql-test/r/ctype_gb2312.result:
Adding test
mysql-test/r/ctype_gbk.result:
Adding test
mysql-test/r/ctype_uca.result:
Adding test
mysql-test/r/ctype_ucs.result:
Adding test
mysql-test/t/ctype_cp1250_ch.test:
Adding test
mysql-test/t/ctype_ucs.test:
Adding test
sql/item_create.cc:
Item for SQL function SPACE() is now created with ASCII repertoire,
to allow automatic conversion from UTF8 to column's character
set e.g. for CONCAT().
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 561613032bc..60a17c21521 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -361,13 +361,13 @@ Item *create_func_space(Item *a) if (cs->mbminlen > 1) { uint dummy_errors; - sp= new Item_string("",0,cs); + sp= new Item_string("", 0, cs, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); if (sp) sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); } else { - sp= new Item_string(" ",1,cs); + sp= new Item_string(" ", 1, cs, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); } return sp ? new Item_func_repeat(sp, a) : 0; } |