mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fix for bug #8465 (MIN, MAX return incorrect result)
This commit is contained in:
@@ -842,3 +842,16 @@ col1 count(col1) sum(col1) avg(col1)
|
||||
-5.000000000010 4 -20.000000000040 -5.0000000000100000
|
||||
-5.000000000000 2 -10.000000000000 -5.0000000000000000
|
||||
DROP TABLE t1;
|
||||
create table t1 (col1 decimal(16,12));
|
||||
insert into t1 values (-5.00000000001);
|
||||
insert into t1 values (-5.00000000001);
|
||||
select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
|
||||
col1 sum(col1) max(col1) min(col1)
|
||||
-5.000000000010 -10.000000000020 -5.000000000010 -5.000000000010
|
||||
delete from t1;
|
||||
insert into t1 values (5.00000000001);
|
||||
insert into t1 values (5.00000000001);
|
||||
select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
|
||||
col1 sum(col1) max(col1) min(col1)
|
||||
5.000000000010 10.000000000020 5.000000000010 5.000000000010
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -548,3 +548,16 @@ insert into t1 select * from t1;
|
||||
select col1,count(col1),sum(col1),avg(col1) from t1 group by col1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# BUG#8465 decimal MIN and MAX return incorrect result
|
||||
#
|
||||
|
||||
create table t1 (col1 decimal(16,12));
|
||||
insert into t1 values (-5.00000000001);
|
||||
insert into t1 values (-5.00000000001);
|
||||
select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
|
||||
delete from t1;
|
||||
insert into t1 values (5.00000000001);
|
||||
insert into t1 values (5.00000000001);
|
||||
select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
|
||||
DROP TABLE t1;
|
||||
|
||||
Reference in New Issue
Block a user