aboutsummaryrefslogtreecommitdiff
path: root/test/select3.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2005-09-08 12:57:28 +0000
committerdrh <drh@noemail.net>2005-09-08 12:57:28 +0000
commit97571957a1952c1bff0f46f4a7287020bd1d5efa (patch)
tree6617491ec031eb0d25ffeb17b5dd2aa6a9a78042 /test/select3.test
parenteb796a7c8f582d5e14811c12c504f64b66416ce0 (diff)
downloadsqlite-97571957a1952c1bff0f46f4a7287020bd1d5efa.tar.gz
sqlite-97571957a1952c1bff0f46f4a7287020bd1d5efa.zip
Aggregates with GROUP BY can sometimes return no result rows. (CVS 2674)
FossilOrigin-Name: 0c3e368d4766685b94a44f2c514e2dea806c297c
Diffstat (limited to 'test/select3.test')
-rw-r--r--test/select3.test16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/select3.test b/test/select3.test
index c0bd9b95b..c9a6a9080 100644
--- a/test/select3.test
+++ b/test/select3.test
@@ -12,7 +12,7 @@
# focus of this file is testing aggregate functions and the
# GROUP BY and HAVING clauses of SELECT statements.
#
-# $Id: select3.test,v 1.14 2005/09/08 10:37:01 drh Exp $
+# $Id: select3.test,v 1.15 2005/09/08 12:57:28 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -220,6 +220,20 @@ do_test select3-6.8 {
}
} {5 17 4 9 3 5 2 3 1 2 0 1}
+# Sometimes an aggregate query can return no rows at all.
+#
+do_test select3-7.1 {
+ execsql {
+ CREATE TABLE t2(a,b);
+ INSERT INTO t2 VALUES(1,2);
+ SELECT a, sum(b) FROM t2 WHERE b=5 GROUP BY a;
+ }
+} {}
+do_test select3-7.2 {
+ execsql {
+ SELECT a, sum(b) FROM t2 WHERE b=5;
+ }
+} {{} 0}
finish_test