diff options
author | unknown <holyfoot@mysql.com> | 2006-03-08 17:16:43 +0400 |
---|---|---|
committer | unknown <holyfoot@mysql.com> | 2006-03-08 17:16:43 +0400 |
commit | d64f011b6dda7a678f9dcfdd6cdbfc534c7aa2a7 (patch) | |
tree | 8b65d6b53332d48de37b6e572e8a29f6417b2eab /mysql-test | |
parent | e0f44ddf82d16ef8a475318299639c8ee1cea2d6 (diff) | |
parent | 703aeac212404005545e2449eb8a7a7cf8f5d709 (diff) | |
download | mariadb-git-d64f011b6dda7a678f9dcfdd6cdbfc534c7aa2a7.tar.gz |
Merge mysql.com:/home/hf/work/mysql-5.0.mrg
into mysql.com:/home/hf/work/mysql-5.1.mrg
sql/item_sum.cc:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/distinct.result | 21 | ||||
-rw-r--r-- | mysql-test/t/distinct.test | 24 |
2 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 00436019f85..a6ad95570f8 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -512,3 +512,24 @@ id IFNULL(dsc, '-') 2 line number two 3 line number three drop table t1; +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +x varchar(20) default NULL, +y decimal(10,0) default NULL, +PRIMARY KEY (ID), +KEY (y) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES +(1,'ba','-1'), +(2,'ba','1150'), +(306,'ba','-1'), +(307,'ba','1150'), +(611,'ba','-1'), +(612,'ba','1150'); +select count(distinct x,y) from t1; +count(distinct x,y) +2 +select count(distinct concat(x,y)) from t1; +count(distinct concat(x,y)) +2 +drop table t1; diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 6483284633f..45bd0c7a51c 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -358,3 +358,27 @@ select distinct id, IFNULL(dsc, '-') from t1; drop table t1; # End of 4.1 tests + + +# +# Bug #15745 ( COUNT(DISTINCT CONCAT(x,y)) returns wrong result) +# +CREATE TABLE t1 ( + ID int(11) NOT NULL auto_increment, + x varchar(20) default NULL, + y decimal(10,0) default NULL, + PRIMARY KEY (ID), + KEY (y) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES +(1,'ba','-1'), +(2,'ba','1150'), +(306,'ba','-1'), +(307,'ba','1150'), +(611,'ba','-1'), +(612,'ba','1150'); + +select count(distinct x,y) from t1; +select count(distinct concat(x,y)) from t1; +drop table t1; |