diff options
author | unknown <ramil@mysql.com> | 2006-03-06 16:38:35 +0400 |
---|---|---|
committer | unknown <ramil@mysql.com> | 2006-03-06 16:38:35 +0400 |
commit | f372641876e7a560ce661693bfc5d8e62cc5a19d (patch) | |
tree | 5665bf9d1cfd10c122d62ffc42b4876d2a4f15c9 /mysql-test/t/case.test | |
parent | 4391f938922a7f62831481c350ad4a680c64c827 (diff) | |
download | mariadb-git-f372641876e7a560ce661693bfc5d8e62cc5a19d.tar.gz |
Fix for bug #17896: MIN of CASE WHEN returns non-minimum value!
sql/item_cmpfunc.cc:
Fix for bug #17896: MIN of CASE WHEN returns non-minimum value!
- NULL items should not affect the result type.
Diffstat (limited to 'mysql-test/t/case.test')
-rw-r--r-- | mysql-test/t/case.test | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index fbbbce15576..fd1b6e5247f 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -119,4 +119,15 @@ SELECT 'case+union+test' UNION SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END; +# +# Bug #17896: problem with MIN(CASE...) +# + +create table t1(a float, b int default 3); +insert into t1 (a) values (2), (11), (8); +select min(a), min(case when 1=1 then a else NULL end), + min(case when 1!=1 then NULL else a end) +from t1 where b=3 group by b; +drop table t1; + # End of 4.1 tests |