mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user