diff options
author | bar@mysql.com/bar.myoffice.izhnet.ru <> | 2007-10-08 12:46:38 +0500 |
---|---|---|
committer | bar@mysql.com/bar.myoffice.izhnet.ru <> | 2007-10-08 12:46:38 +0500 |
commit | 2224e030a9cedab39222abe50c50c9851dc74816 (patch) | |
tree | 225dbb68221432e7e6565aea32d461f2ea523dc1 /mysql-test/include | |
parent | 4c01449b8464468a4be6ad03767e01e35991b038 (diff) | |
download | mariadb-git-2224e030a9cedab39222abe50c50c9851dc74816.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.
Diffstat (limited to 'mysql-test/include')
-rw-r--r-- | mysql-test/include/ctype_common.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc index 202c508a9c9..b9bd7869967 100644 --- a/mysql-test/include/ctype_common.inc +++ b/mysql-test/include/ctype_common.inc @@ -13,6 +13,8 @@ SET @safe_character_set_server= @@character_set_server; SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; SET character_set_server= @test_character_set; SET collation_server= @test_collation; CREATE DATABASE d1; @@ -51,8 +53,22 @@ SELECT c1 as want1result from t1 where c1 like 'locatio%'; SELECT c1 as want1result from t1 where c1 like 'location%'; DROP TABLE t1; +# +# Bug#27580 SPACE() function collation bug? +# +set names utf8; +create table t1 ( + name varchar(10), + level smallint unsigned); +show create table t1; +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +drop table t1; + DROP DATABASE d1; # Restore settings USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; |