diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-02-19 17:20:44 +0400 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-02-19 17:20:44 +0400 |
commit | c2e23208ef7ae6b315ca4988e903bff2bc0284d4 (patch) | |
tree | 8d8120d61f551e8a1f07b2653737f3d6d001949c /mysql-test/t/row.test | |
parent | 0c96241b156ef044e8d73a31e98918a721597126 (diff) | |
download | mariadb-git-c2e23208ef7ae6b315ca4988e903bff2bc0284d4.tar.gz |
Bug#37601 Cast Is Not Done On Row Comparison
In case of ROW item each compared pair does not
check if argumet collations can be aggregated and
thus appropiriate item conversion does not happen.
The fix is to add the check and convertion for ROW
pairs.
mysql-test/r/row.result:
test result
mysql-test/t/row.test:
test case
sql/item.cc:
added agg_item_set_converter() function which was a part of
agg_item_charsets() func. The only difference is that
agg_item_set_converter() checks and converts items
using already known collation.
sql/item.h:
added agg_item_set_converter() function
sql/item_cmpfunc.cc:
In case of ROW item each compared pair does not
check if argumet collations can be aggregated and
thus appropiriate item conversion does not happen.
The fix is to add the check and convertion for ROW
pairs.
Diffstat (limited to 'mysql-test/t/row.test')
-rw-r--r-- | mysql-test/t/row.test | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index 1601f7afd0e..fcc4259168b 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -237,3 +237,21 @@ SELECT ROW(a, 1) IN (SELECT SUM(b), 1) FROM t1 GROUP BY a; SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a; DROP TABLE t1; + +# +# Bug#37601 Cast Is Not Done On Row Comparison +# +create table t1 (a varchar(200), + b int unsigned not null primary key auto_increment) +default character set 'utf8'; + +create table t2 (c varchar(200), + d int unsigned not null primary key auto_increment) +default character set 'latin1'; + +insert into t1 (a) values('abc'); +insert into t2 (c) values('abc'); +select * from t1,t2 where (a,b) = (c,d); + +select host,user from mysql.user where (host,user) = ('localhost','test'); +drop table t1,t2; |