]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix compilation/testing with OMIT_SUBQUERY defined. Ticket #2828. (CVS 4603)
authordanielk1977 <danielk1977@noemail.net>
Mon, 10 Dec 2007 05:03:46 +0000 (05:03 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Mon, 10 Dec 2007 05:03:46 +0000 (05:03 +0000)
FossilOrigin-Name: 0b34a18651764e650faba983be8593992ab2f4a9

12 files changed:
manifest
manifest.uuid
src/expr.c
test/in3.test
test/incrvacuum.test
test/insert5.test
test/select1.test
test/tkt2640.test
test/tkt2686.test
test/vtab1.test
test/where2.test
test/where4.test

index b3f574e4a8b133010a11d5594f6e538dc4b3e831..63e0f6138e410bf27591662c7d57d5fc02e0977a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Better\sresolution\sof\sORDER\sBY\sterms\sin\scompound\squeries.\s\sCandidate\nsolution\sfor\sticket\s#2822.\s\sNeeds\smore\stesting\sand\sdocumentation\nbefore\sgoing\sfinal.\s(CVS\s4602)
-D 2007-12-08T21:10:20
+C Fix\scompilation/testing\swith\sOMIT_SUBQUERY\sdefined.\sTicket\s#2828.\s(CVS\s4603)
+D 2007-12-10T05:03:47
 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
 F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -92,7 +92,7 @@ F src/complete.c 4cf68fd75d60257524cbe74f87351b9848399131
 F src/date.c 49c5a6d2de6c12000905b4d36868b07d3011bbf6
 F src/delete.c 034b87768c4135a22038a86a205f9d2d5f68a143
 F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
-F src/expr.c 8c32309dedd13b8ab220348eb90dc221ee0a5174
+F src/expr.c 7c8e3295ddeb835ed081b8573caaf8c3fd7c9f9c
 F src/func.c a8548fbc55373505c077cfb57baa43c1e48b71d2
 F src/hash.c 45a7005aac044b6c86bd7e49c44bc15d30006d6c
 F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53
@@ -322,10 +322,10 @@ F test/hook.test 3870abead2ee75d2c03585c916256ca8b5584679
 F test/icu.test e6bfae7f625c88fd14df6f540fe835bdfc1e4329
 F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d
 F test/in2.test b1f447f4f0f67e9f83ff931e7e2e30873f9ea055
-F test/in3.test ec1b3a9f478835954a0ecab1facd9198c62459bf
+F test/in3.test e335959db24d71d6cfdff9553c90ce2b56fb978c
 F test/incrblob.test 602dbfa956904d6e58c45635b58850ad0f02d927
 F test/incrblob_err.test 5273097dc7c97f9b7008423a6ffd5c80d21923cb
-F test/incrvacuum.test 985bc94a7ff544db09aec3a0c93c779280da9415
+F test/incrvacuum.test 45ac35d947031526d35fbe70a44f131dedc730b1
 F test/incrvacuum2.test a958e378c193c4012cb3787804d863487f1dfad1
 F test/incrvacuum_ioerr.test cb331403b8dea3c5bae6163861ff25037b0df56a
 F test/index.test e65df12bed94b2903ee89987115e1578687e9266
@@ -335,7 +335,7 @@ F test/insert.test aef273dd1cee84cc92407469e6bd1b3cdcb76908
 F test/insert2.test 5a20e1ace5fa0800b58d28284212290189b49aed
 F test/insert3.test 9a4ef3526fd3cca8b05278020ec3100448b4c677
 F test/insert4.test 6919ddacd79c2cfeb9785b0f84217f9cb14853b5
-F test/insert5.test e8d5ba31283db5b0315ada9774dd99b6e9fe2122
+F test/insert5.test e41e417a4f055c25d6c2b9847c775bf357df2390
 F test/interrupt.test 81555fb0f8179bb2d0dc7151fd75428223f93cf2
 F test/intpkey.test 537669fd535f62632ca64828e435b9e54e8d677f
 F test/io.test 80a7a7f1a2792e037d447b03e8c22ee1f6eaf339
@@ -411,7 +411,7 @@ F test/rowid.test d125991eea1ffdea800d48471afd8fc4acc10b01
 F test/safety.test 4a06934e45d03b8b50ebcd8d174eb0367d2fd851
 F test/schema.test a8b000723375fd42c68d310091bdbd744fde647c
 F test/schema2.test 35e1c9696443d6694c8980c411497c2b5190d32e
-F test/select1.test d091e1c8ad23c9bd6d7d55d2dd16b08e68e16f63
+F test/select1.test 79784038f0e7df66bb420e149c6fb91e61e11fb7
 F test/select2.test f3c2678c3a9f3cf08ec4988a3845bda64be6d9e3
 F test/select3.test 47439f28862489626b483b0c718cfb0562e6f6d5
 F test/select4.test 4192e6c712194d53b4b77f094eb9d880b8d5ac0e
@@ -472,9 +472,9 @@ F test/tkt2339.test 73bd17818924cd2ac442e5fd9916b58565739450
 F test/tkt2391.test ab7a11be7402da8b51a5be603425367aa0684567
 F test/tkt2409.test 20318bf6acd9b834b4420548f277b8e3a7420cd1
 F test/tkt2450.test 77ed94863f2049c1420288ddfea2d41e5e0971d6
-F test/tkt2640.test c513e7992a602a87ef3a2cc9ca1cba4146924e9b
+F test/tkt2640.test 6e81ebd7d986ff1e9ed570c4c92ca0aa2b3a5848
 F test/tkt2643.test 3f3ebb743da00d4fed4fcf6daed92a0e18e57813
-F test/tkt2686.test 8815c3eeae7c8363bd7c2889349ec39e8bc8000d
+F test/tkt2686.test 3022db0eee8ecf501f516557c77ef1c4039399cd
 F test/tkt2767.test 6b02308d553d194f329a469bf5c157fe724738d4
 F test/tkt2817.test 709a2201a5590bf56cb97f6fb168a62282203fd1
 F test/tkt2820.test 017fdee33aaef7abc092beab6088816f1942304b
@@ -499,7 +499,7 @@ F test/vacuum.test cf839fc3ff24d601057319bbb5c700ce9c8e0fb0
 F test/vacuum2.test bbd8412d74e8da5657ac4b43d05097bd6d9d749e
 F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
 F test/view.test 7e15fa1ba3267ddaa9ae96b6daf519f23f95b43e
-F test/vtab1.test 3573ad5045c44e8e2d2b6451122bcf2ee2a4f688
+F test/vtab1.test 9e0d27cf0a9ed38a268334a18c5098047c3b2200
 F test/vtab2.test 94bb3bf691ac10e34cf7dad46b1cf94b861d513c
 F test/vtab3.test f38d6d7d19f08bffdadce4d5b8cba078f8118587
 F test/vtab4.test a9d7104d41a787754a734740d7aa61c807a69f87
@@ -513,9 +513,9 @@ F test/vtab_alter.test b0c0f61a9588b509c2ba20dedc2db04999da6656
 F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
 F test/vtab_shared.test d631d1f820c38c18939d53aab1fc35db5f0a8094
 F test/where.test 5ff4a1bda6352b73354faf1a97706bbfa0d47dfe
-F test/where2.test 9bbf1cc675730954047d663e4c0dc5d4c9669ca4
+F test/where2.test 7012c0ad022a54430dd22c98288d3f4d6599dbcf
 F test/where3.test 0a30fe9808b0fa01c46d0fcf4fac0bf6cf75bb30
-F test/where4.test 1b1cd72d5f205ce34d5a31f3c4918f833e5e6a63
+F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2
 F test/where5.test fdf66f96d29a064b63eb543e28da4dfdccd81ad2
 F test/zeroblob.test 7d1854ea79d048e023e5f2e38106a7e99a17435c
 F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
@@ -597,7 +597,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 4be8e6765bf8bc48747b2542f2ed77066fb9dcb9
-R adfe92f0c9624e9b76a7c1a73370b4bd
-U drh
-Z af9ac541bec9448e79940f97cacc1ce8
+P 62a78d212c53a9cb1759d03134653a75f3a086b6
+R 68268cf2b01556c7a9e0f2599b467528
+U danielk1977
+Z 01b288bc59bf6c1f76e93bf4213ad9d1
index 9daf0608576fe2514aaa49139680e92659e7946e..aa7c3cea807c3e64c9c41d6fd200fbccd0f039e0 100644 (file)
@@ -1 +1 @@
-62a78d212c53a9cb1759d03134653a75f3a086b6
\ No newline at end of file
+0b34a18651764e650faba983be8593992ab2f4a9
\ No newline at end of file
index 39441f4c319a9240ff8373516b1489e98bd366eb..253c587261fd7c7d222a7136282b5829070099a3 100644 (file)
@@ -12,7 +12,7 @@
 ** This file contains routines used for analyzing expressions and
 ** for generating VDBE code that evaluates expressions in SQLite.
 **
-** $Id: expr.c,v 1.317 2007/11/29 17:05:18 danielk1977 Exp $
+** $Id: expr.c,v 1.318 2007/12/10 05:03:47 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -1559,6 +1559,7 @@ struct QueryCoder {
 ** to be unique - either because it is an INTEGER PRIMARY KEY or it
 ** is unique by virtue of a constraint or implicit index.
 */
+#ifndef SQLITE_OMIT_SUBQUERY
 int sqlite3FindInIndex(Parse *pParse, Expr *pX, int mustBeUnique){
   Select *p;
   int eType = 0;
@@ -1659,6 +1660,7 @@ int sqlite3FindInIndex(Parse *pParse, Expr *pX, int mustBeUnique){
   }
   return eType;
 }
+#endif
 
 /*
 ** Generate code for scalar subqueries used as an expression
index ff921728777704f3f39d25f43f9321e680cd4128..2c91e41a5f96ca0fe17db3ac94e2817bd8e68012 100644 (file)
 #
 #     <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.
 #
index e9c5db92fb3a497a147795ddaa729c25b728593b..1bc13b8cbce4dbd56a66f8ce406042abde9cf41e 100644 (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} {
index 45fb25b014a6b173645e482d159530d6c4c23b52..4dd869b2829898c2e36de98c6c5672f2f8e168d6 100644 (file)
 # 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
index 6ed92c73302ce4a6e51a0de0d958c4aaa4318213..aeed6fb3a9fb53466b99b3862839054d94ecebef 100644 (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
 
index d2fa0e60920aa61ab4c60be1deb0471adf41b24e..8ce236dab968f2eefb9b41ad6a0ecac233efe4a7 100644 (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 
 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);
index 70474fdf3a0b3ecda7fee9001e4433a18b5395d6..9f77fd63e5640af863bd3139d7cb3340e254f1da 100644 (file)
 #
 # 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;
index 680fff9c16dd09b3f0739702161b7da9cb86d0e4..667d052d9bc8954637da3b16516b079a485ef9e5 100644 (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 
index bff3ef68f74d6a84a179fa6f4b13ab33b47a14bd..ae7c7a3b272176079a138d4e837bb00f7cb1f21b 100644 (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
index 7abbc1d2e068aade3c07a2de7d67f23242c9ed7d..280eb5ff7fb4703fbe5f36c7cfba3e7731ac8c72 100644 (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