mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fix the AVG() and TOTAL() functions (after the SUM() fix of [77d3dcd283595c52])
so that they work with infinitites. Fixes a bug introduced by check-in. [c63e26e705f5e967]. Bug reported by [forum:/forumpost/8960fb40cc|forum post 8960fb40cc]. FossilOrigin-Name: 6df6f17ccb404c648076ccff4200d0eb5437f0e3e82424bf3da5ea682b107bb4
This commit is contained in:
@ -1549,8 +1549,8 @@ do_catchsql_test func-37.120 {
|
||||
# Incorrect handling of infinity by SUM().
|
||||
#
|
||||
do_execsql_test func-38.100 {
|
||||
WITH t1(x) AS (VALUES(9e+999)) SELECT sum(x) FROM t1;
|
||||
WITH t1(x) AS (VALUES(-9e+999)) SELECT sum(x) FROM t1;
|
||||
} {Inf -Inf}
|
||||
WITH t1(x) AS (VALUES(9e+999)) SELECT sum(x), avg(x), total(x) FROM t1;
|
||||
WITH t1(x) AS (VALUES(-9e+999)) SELECT sum(x), avg(x), total(x) FROM t1;
|
||||
} {Inf Inf Inf -Inf -Inf -Inf}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user