aboutsummaryrefslogtreecommitdiff
path: root/test/minmax.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2004-03-13 14:00:36 +0000
committerdrh <drh@noemail.net>2004-03-13 14:00:36 +0000
commit6e17529e976dfebc5bac88b4a1e0e83b4289637c (patch)
treeaa01648a6e9c1b76d6a41f900450033a622a374f /test/minmax.test
parent1a72d72a7fdf0e5c3131027a8b6e0e9252a3e01e (diff)
downloadsqlite-6e17529e976dfebc5bac88b4a1e0e83b4289637c.tar.gz
sqlite-6e17529e976dfebc5bac88b4a1e0e83b4289637c.zip
Fix the min/max optimizer so that it works when the FROM clause is a
subquery. Ticket #658. (CVS 1293) FossilOrigin-Name: 31c94acc72d318b5dec0fef1485621943add45c8
Diffstat (limited to 'test/minmax.test')
-rw-r--r--test/minmax.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/minmax.test b/test/minmax.test
index 28c2946aa..5517ad99e 100644
--- a/test/minmax.test
+++ b/test/minmax.test
@@ -13,7 +13,7 @@
# aggregate min() and max() functions and which are handled as
# as a special case.
#
-# $Id: minmax.test,v 1.8 2004/02/25 13:47:34 drh Exp $
+# $Id: minmax.test,v 1.9 2004/03/13 14:00:37 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -258,5 +258,22 @@ do_test minmax-8.2 {
}
} {34 1234}
+# Ticket #658: Test the min()/max() optimization when the FROM clause
+# is a subquery.
+#
+do_test minmax-9.1 {
+ execsql {
+ SELECT max(rowid) FROM (
+ SELECT max(rowid) FROM t4 UNION SELECT max(rowid) FROM t5
+ )
+ }
+} {1}
+do_test minmax-9.2 {
+ execsql {
+ SELECT max(rowid) FROM (
+ SELECT max(rowid) FROM t4 EXCEPT SELECT max(rowid) FROM t5
+ )
+ }
+} {{}}
finish_test