The following aggregate functions have discrepancies when applied on empty datasets or only-null values.
Steps to reproduce (create empty table since limbo doesn't support where clause yet):
create table empty_table (id INT PRIMARY KEY);
AVG
SQLite:
> select avg(id) from empty_table;
Limbo:
> select avg(id) from empty_table;
thread 'main' panicked at core/vdbe.rs:609:33:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
COUNT
SQLite:
> select count(id) from empty_table;
0
Limbo:
> select count(id) from empty_table;
NULL
The ones below have differences, but I don't know if we want to change or not.
The following aggregate functions have discrepancies when applied on empty datasets or only-null values.
Steps to reproduce (create empty table since limbo doesn't support where clause yet):
create table empty_table (id INT PRIMARY KEY);
AVG
SQLite:
Limbo:
COUNT
SQLite:
Limbo:
The ones below have differences, but I don't know if we want to change or not.
SUM
SQLite:
Limbo:
MIN
SQLite:
Limbo:
MAX
SQLite:
Limbo: