diff options
author | bar@mysql.com <> | 2005-11-21 17:26:31 +0400 |
---|---|---|
committer | bar@mysql.com <> | 2005-11-21 17:26:31 +0400 |
commit | 2f72e05903426b5b2e4fcfe1192d41495120e8fc (patch) | |
tree | 05c91bc3d02c0f22aab0913b8e7228667bb5ff38 /mysql-test | |
parent | 133c00beb4f17b96e9e6cf77d870726de61958e4 (diff) | |
download | mariadb-git-2f72e05903426b5b2e4fcfe1192d41495120e8fc.tar.gz |
Bug#10446 Illegal mix of collations:
item_strfunc.h, item_strfunc.cc, item.cc:
Try to convert a const item into destination
character set. If conversion happens without
data loss, then cache the converted value
and return it during val_str().
Otherwise, if conversion loses data, return
Illeral mix of collations error, as it happened
previously.
ctype_recoding.result, ctype_recoding.test:
Fixing tests accordingly.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ctype_recoding.result | 9 | ||||
-rw-r--r-- | mysql-test/t/ctype_recoding.test | 11 |
2 files changed, 17 insertions, 3 deletions
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index 1c75988fd21..0b5c6f8974c 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -181,11 +181,18 @@ select * from t1 where a=_koi8r'×ÁÓÑ'; a ×ÁÓÑ select * from t1 where a=concat(_koi8r'×ÁÓÑ'); -ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '=' +a +×ÁÓÑ select * from t1 where a=_latin1'×ÁÓÑ'; ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' drop table t1; set names latin1; +create table t1 (a char(10) character set utf8 collate utf8_bin); +insert into t1 values (' xxx'); +select * from t1 where a=lpad('xxx',10,' '); +a + xxx +drop table t1; set names koi8r; create table t1 (c1 char(10) character set cp1251); insert into t1 values ('ß'); diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 9949ef88da4..5648cea7fd3 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -144,8 +144,7 @@ create table t1 (a char(10) character set cp1251); insert into t1 values (_koi8r'×ÁÓÑ'); # this is possible: select * from t1 where a=_koi8r'×ÁÓÑ'; -# this is not possible, because we have a function, not just a constant: ---error 1267 +# this is possible, because we have a function with constant arguments: select * from t1 where a=concat(_koi8r'×ÁÓÑ'); # this is not posible, cannot convert _latin1'×ÁÓÑ' into cp1251: --error 1267 @@ -154,6 +153,14 @@ drop table t1; set names latin1; # +# Bug#10446 Illegal mix of collations +# +create table t1 (a char(10) character set utf8 collate utf8_bin); +insert into t1 values (' xxx'); +select * from t1 where a=lpad('xxx',10,' '); +drop table t1; + +# # Check more automatic conversion # set names koi8r; |