Fix for bug #10966: Variance functions return wrong data type.

sql/item_sum.cc:
  Fix for bug #10966: Variance functions return wrong data type.
  Always return Field_double if no grouping.
This commit is contained in:
unknown 2005-11-22 18:29:46 +04:00
commit 4e846a3d27
4 changed files with 26 additions and 4 deletions

View file

@ -1089,3 +1089,17 @@ SUM(a)
6
DROP TABLE t1;
set div_precision_increment= @sav_dpi;
create table t1 select variance(0);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`variance(0)` double(8,4) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 select stddev(0);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`stddev(0)` double(8,4) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;