From f372641876e7a560ce661693bfc5d8e62cc5a19d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Mar 2006 16:38:35 +0400 Subject: 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. --- mysql-test/r/case.result | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/r/case.result') diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index fb0bc19a67e..a5495d0fc3e 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -169,3 +169,11 @@ SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END; case+union+test case+union+test nobug +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; +min(a) min(case when 1=1 then a else NULL end) min(case when 1!=1 then NULL else a end) +2 2 2 +drop table t1; -- cgit v1.2.1