1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Built-in aggregate functions (MIN, SUM, AVG, etc) should ignore NULL entires. (CVS 597)

FossilOrigin-Name: 19ae12bef210ae5fe171f10833faa38d640c129f
This commit is contained in:
drh
2002-05-29 23:22:23 +00:00
parent f1756d2a79
commit 739105c72c
6 changed files with 46 additions and 43 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing built-in functions.
#
# $Id: func.test,v 1.11 2002/05/27 01:04:51 drh Exp $
# $Id: func.test,v 1.12 2002/05/29 23:22:23 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -236,5 +236,13 @@ do_test func-7.1 {
execsql {SELECT last_insert_rowid()}
} [db last_insert_rowid]
# Tests for aggregate functions and how they handle NULLs.
#
do_test func-8.1 {
execsql {
SELECT sum(a), count(a), round(avg(a),2), min(a), max(a), count(*) FROM t2;
}
} {68236 3 22745.33 1 67890 5}
finish_test