mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
a fix (Bug #3435: STDDEV|VARIANCE(constant) returns constant if no rows)
This commit is contained in:
@ -648,3 +648,11 @@ select a from t1 having a=1;
|
||||
a
|
||||
1
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
select variance(2) from t1;
|
||||
variance(2)
|
||||
NULL
|
||||
select stddev(2) from t1;
|
||||
stddev(2)
|
||||
NULL
|
||||
drop table t1;
|
||||
|
@ -387,3 +387,12 @@ insert into t1 values (1);
|
||||
select max(a) as b from t1 having b=1;
|
||||
select a from t1 having a=1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #3435: variance(const), stddev(const) and an empty table
|
||||
#
|
||||
|
||||
create table t1 (a int);
|
||||
select variance(2) from t1;
|
||||
select stddev(2) from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user