1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

A fix. (Bug #3376: AVG(constant) returns constant if no rows in result set)

This commit is contained in:
ram@gw.mysql.r18.ru
2004-04-09 19:07:39 +05:00
parent 8219d4ef88
commit c8937dbcb7
3 changed files with 14 additions and 0 deletions

View File

@ -256,3 +256,8 @@ bit_and(col) bit_or(col)
18446744073709551614 18446744073709551614
18446744073709551615 18446744073709551615
drop table t1;
create table t1 (a int);
select avg(2) from t1;
avg(2)
NULL
drop table t1;

View File

@ -155,3 +155,11 @@ insert into t1 values (-1), (-2), (-3);
select bit_and(col), bit_or(col) from t1;
select SQL_BIG_RESULT bit_and(col), bit_or(col) from t1 group by col;
drop table t1;
#
# Bug #3376: avg() and an empty table
#
create table t1 (a int);
select avg(2) from t1;
drop table t1;