Fix compilation/testing with OMIT_SUBQUERY defined. Ticket #2828. (CVS 4603)

FossilOrigin-Name: 0b34a18651764e650faba983be8593992ab2f4a9
This commit is contained in:
danielk1977
2007-12-10 05:03:46 +00:00
parent 4c77431448
commit 284f4aca32
12 changed files with 81 additions and 36 deletions
+6 -1
View File
@@ -13,11 +13,16 @@
#
# <value> IN (SELECT <column> FROM <table>)
#
# $Id: in3.test,v 1.1 2007/11/29 17:05:18 danielk1977 Exp $
# $Id: in3.test,v 1.2 2007/12/10 05:03:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !subquery {
finish_test
return
}
# Return the number of OpenEphemeral instructions used in the
# implementation of the sql statement passed as a an argument.
#
+6 -1
View File
@@ -14,7 +14,7 @@
# Note: There are also some tests for incremental vacuum and IO
# errors in incrvacuum_ioerr.test.
#
# $Id: incrvacuum.test,v 1.14 2007/09/01 10:01:13 danielk1977 Exp $
# $Id: incrvacuum.test,v 1.15 2007/12/10 05:03:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -298,6 +298,11 @@ set TestScriptList [list {
}
]
# If this build omit's subqueries, step 2 in the above list will not
# work. Replace it with "" in this case.
#
ifcapable !subquery { lset TestScriptList 2 "" }
# Compare the contents of databases $A and $B.
#
proc compare_dbs {A B tname} {
+6 -1
View File
@@ -12,11 +12,16 @@
# The tests in this file ensure that a temporary table is used
# when required by an "INSERT INTO ... SELECT ..." statement.
#
# $Id: insert5.test,v 1.1 2007/11/23 15:02:19 drh Exp $
# $Id: insert5.test,v 1.2 2007/12/10 05:03:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !subquery {
finish_test
return
}
# Return true if the compilation of the sql passed as an argument
# includes the opcode OpenEphemeral. An "INSERT INTO ... SELECT"
# statement includes such an opcode if a temp-table is used
+3 -1
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the SELECT statement.
#
# $Id: select1.test,v 1.55 2007/12/08 21:10:20 drh Exp $
# $Id: select1.test,v 1.56 2007/12/10 05:03:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -523,6 +523,7 @@ do_test select1-6.11 {
} {1 {ORDER BY term number 1 does not match any result column}}
# Ticket #2296
ifcapable subquery {
do_test select1-6.20 {
execsql {
CREATE TABLE t6(a TEXT, b TEXT);
@@ -558,6 +559,7 @@ do_test select1-6.23 {
ORDER BY a;
}
} {b d}
}
} ;#ifcapable compound
+6 -1
View File
@@ -11,7 +11,7 @@
#
# This file is to test that ticket #2640 has been fixed.
#
# $Id: tkt2640.test,v 1.1 2007/09/12 15:41:01 drh Exp $
# $Id: tkt2640.test,v 1.2 2007/12/10 05:03:48 danielk1977 Exp $
#
# The problem in ticket #2640 was that the query optimizer was
@@ -28,6 +28,11 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !subquery {
finish_test
return
}
do_test tkt2640-1.1 {
execsql {
CREATE TABLE persons(person_id, name);
+6 -1
View File
@@ -11,12 +11,17 @@
#
# This file is to test that ticket #2686 has been fixed.
#
# $Id: tkt2686.test,v 1.1 2007/10/04 18:52:15 drh Exp $
# $Id: tkt2686.test,v 1.2 2007/12/10 05:03:48 danielk1977 Exp $
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !subquery {
finish_test
return
}
db eval {
PRAGMA page_size=1024;
PRAGMA max_page_count=50;
+4 -1
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is creating and dropping virtual tables.
#
# $Id: vtab1.test,v 1.48 2007/11/05 05:12:53 danielk1977 Exp $
# $Id: vtab1.test,v 1.49 2007/12/10 05:03:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -430,6 +430,8 @@ do_test vtab1-3.13 {
set echo_module
} [list xBestIndex {SELECT rowid, * FROM 'treal'} \
xFilter {SELECT rowid, * FROM 'treal'}]
ifcapable subquery {
# The echo module uses a subquery internally to implement the MATCH operator.
do_test vtab1-3.14 {
set echo_module ""
execsql {
@@ -443,6 +445,7 @@ do_test vtab1-3.15 {
xFilter \
{SELECT rowid, * FROM 'treal' WHERE b LIKE (SELECT '%'||?||'%')} \
string ]
}; #ifcapable subquery
#----------------------------------------------------------------------
# Test case vtab1-3 test table scans and the echo module's
+20 -10
View File
@@ -12,7 +12,7 @@
# focus of this file is testing the use of indices in WHERE clauses
# based on recent changes to the optimizer.
#
# $Id: where2.test,v 1.12 2007/09/12 17:01:45 danielk1977 Exp $
# $Id: where2.test,v 1.13 2007/12/10 05:03:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -328,7 +328,12 @@ do_test where2-6.11.4 {
SELECT * FROM t2249b CROSS JOIN t2249a WHERE a='hello' OR b=a;
}
} {123 0123 nosort t2249b {} t2249a {}}
ifcapable explain {
ifcapable explain&&subquery {
# These tests are not run if subquery support is not included in the
# build. This is because these tests test the "a = 1 OR a = 2" to
# "a IN (1, 2)" optimisation transformation, which is not enabled if
# subqueries and the IN operator is not available.
#
do_test where2-6.12 {
# In this case, the +b disables the affinity conflict and allows
# the OR optimization to be used again. The result is now an empty
@@ -345,8 +350,6 @@ ifcapable explain {
SELECT * FROM t2249b CROSS JOIN t2249a WHERE a='hello' OR +b=a;
}
} {nosort t2249b {} {} sqlite_autoindex_t2249a_1}
}
ifcapable explain {
do_test where2-6.12.3 {
# In this case, the +b disables the affinity conflict and allows
# the OR optimization to be used again. The result is now an empty
@@ -371,7 +374,12 @@ do_test where2-6.20 {
SELECT * FROM t2249a x CROSS JOIN t2249a y WHERE x.a=y.a
}
} {0123 0123 nosort x {} {} sqlite_autoindex_t2249a_1}
ifcapable explain {
ifcapable explain&&subquery {
# These tests are not run if subquery support is not included in the
# build. This is because these tests test the "a = 1 OR a = 2" to
# "a IN (1, 2)" optimisation transformation, which is not enabled if
# subqueries and the IN operator is not available.
#
do_test where2-6.21 {
queryplan {
SELECT * FROM t2249a x CROSS JOIN t2249a y WHERE x.a=y.a OR y.a='hello'
@@ -604,11 +612,13 @@ ifcapable or_opt&&tclvar {
SELECT count(*) FROM t10;
}
} 1000
do_test where2-9.2 {
count {
SELECT * FROM t10 WHERE a=1 AND (b=2 OR b=3)
}
} {1 2 2 1 3 3 7}
ifcapable subquery {
do_test where2-9.2 {
count {
SELECT * FROM t10 WHERE a=1 AND (b=2 OR b=3)
}
} {1 2 2 1 3 3 7}
}
}
finish_test
+4 -1
View File
@@ -15,7 +15,7 @@
# that IS NULL phrases are correctly optimized. But you can never
# have too many tests, so some other tests are thrown in as well.
#
# $Id: where4.test,v 1.5 2007/09/12 17:01:45 danielk1977 Exp $
# $Id: where4.test,v 1.6 2007/12/10 05:03:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -181,6 +181,7 @@ do_test where4-4.4 {
# Ticket #2273. Problems with IN operators and NULLs.
#
ifcapable subquery {
do_test where4-5.1 {
execsql {
CREATE TABLE t4(x,y,z,PRIMARY KEY(x,y));
@@ -267,4 +268,6 @@ do_test where4-7.2 {
}
} {{}}
}; #ifcapable subquery
finish_test