From f5b5f9b97211e772b49d37dbde0bec9a2bd2eef9 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 8 Jun 2015 17:42:57 +0000 Subject: [PATCH 1/7] Fix typo in comment. No changes to code. FossilOrigin-Name: e49c291735e613e384f6da044ef865dd274cabc8 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/printf.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 107500a732..899c066981 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Split\sout\ssome\ssource\scode\sinto\snew\sfiles:\swherecode.c,\swhereexpr.c,\sand\ntreeview.c.\s\sOther\sminor\srefactoring\schanges. -D 2015-06-08T17:40:30.804 +C Fix\stypo\sin\scomment.\s\sNo\schanges\sto\scode. +D 2015-06-08T17:42:57.317 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in a7b384855b72378fd860425b128ea5f75296e9d6 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -246,7 +246,7 @@ F src/pcache1.c 69d137620a305f814398bd29a0c998038c0695e9 F src/pragma.c c1f4d012ea9f6b1ce52d341b2cd0ad72d560afd7 F src/pragma.h b8632d7cdda7b25323fa580e3e558a4f0d4502cc F src/prepare.c 82e5db1013846a819f198336fed72c44c974e7b1 -F src/printf.c 9889e8826f8e2bd8c2718d7d3faa761bef8eac79 +F src/printf.c db11b5960105ee661dcac690f2ae6276e49bf251 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c 84c571794e3ee5806274d95158a4c0177c6c4708 F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e @@ -1285,7 +1285,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 283bf0b64da7acc5aa5812fc659954965002d409 c32ce54ca46a4be4373983be6fd44b1f3a0250d1 -R b8b4fb0f1a8beaad9f2b2c3f4237ea7b -U drh -Z 5b9788fbc214053ba5053f4dafcfebef +P 50f336818c8509d8b8bde282e9399d2b2b5ea70a +R 960d1cfe6672a4659b85889f9d77d89d +U mistachkin +Z 915f959f38ed01d6c5f7a7f0fd181c25 diff --git a/manifest.uuid b/manifest.uuid index 6f08cec969..3649605487 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -50f336818c8509d8b8bde282e9399d2b2b5ea70a \ No newline at end of file +e49c291735e613e384f6da044ef865dd274cabc8 \ No newline at end of file diff --git a/src/printf.c b/src/printf.c index ebdf44518f..72b9497d7b 100644 --- a/src/printf.c +++ b/src/printf.c @@ -7,7 +7,7 @@ ** This file contains code for a set of "printf"-like routines. These ** routines format strings much like the printf() from the standard C ** library, though the implementation here has enhancements to support -** SQLlite. +** SQLite. */ #include "sqliteInt.h" From 4f20cd402b5ba0aa7cccd76fda51ad71d1f8367b Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 8 Jun 2015 18:05:54 +0000 Subject: [PATCH 2/7] Avoid passing constraints that are unusable due to LEFT or CROSS joins to virtual table xBestIndex() methods. FossilOrigin-Name: 80ee56dda7db3860f8be5f6968c8745138f8453f --- ext/rtree/rtreeC.test | 83 +++++++++++++++++++++++++++++++++++++++++++ manifest | 19 +++++----- manifest.uuid | 2 +- src/where.c | 69 +++++++++++++++++++++++++++-------- 4 files changed, 150 insertions(+), 23 deletions(-) diff --git a/ext/rtree/rtreeC.test b/ext/rtree/rtreeC.test index 94db05a4d1..9a64df51d5 100644 --- a/ext/rtree/rtreeC.test +++ b/ext/rtree/rtreeC.test @@ -269,5 +269,88 @@ ifcapable rtree { db close } +#-------------------------------------------------------------------- +# Test that queries featuring LEFT or CROSS JOINS are handled correctly. +# Handled correctly in this case means: +# +# * Terms with prereqs that appear to the left of a LEFT JOIN against +# the virtual table are always available to xBestIndex. +# +# * Terms with prereqs that appear to the right of a LEFT JOIN against +# the virtual table are never available to xBestIndex. +# +# And the same behaviour for CROSS joins. +# +reset_db +do_execsql_test 7.0 { + CREATE TABLE xdir(x1); + CREATE TABLE ydir(y1); + CREATE VIRTUAL TABLE rt USING rtree_i32(id, xmin, xmax, ymin, ymax); + + INSERT INTO xdir VALUES(5); + INSERT INTO ydir VALUES(10); + + INSERT INTO rt VALUES(1, 2, 7, 12, 14); -- Not a hit + INSERT INTO rt VALUES(2, 2, 7, 8, 12); -- A hit! + INSERT INTO rt VALUES(3, 7, 11, 8, 12); -- Not a hit! + INSERT INTO rt VALUES(4, 5, 5, 10, 10); -- A hit! + +} + +proc do_eqp_execsql_test {tn sql res} { + set query "EXPLAIN QUERY PLAN $sql ; $sql " + uplevel [list do_execsql_test $tn $query $res] +} + +do_eqp_execsql_test 7.1 { + SELECT id FROM xdir, rt, ydir + ON (y1 BETWEEN ymin AND ymax) + WHERE (x1 BETWEEN xmin AND xmax); +} { + 0 0 0 {SCAN TABLE xdir} + 0 1 2 {SCAN TABLE ydir} + 0 2 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:B2D3B0D1} + 2 4 +} + +do_eqp_execsql_test 7.2 { + SELECT * FROM xdir, rt LEFT JOIN ydir + ON (y1 BETWEEN ymin AND ymax) + WHERE (x1 BETWEEN xmin AND xmax); +} { + 0 0 0 {SCAN TABLE xdir} + 0 1 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:B0D1} + 0 2 2 {SCAN TABLE ydir} + + 5 1 2 7 12 14 {} + 5 2 2 7 8 12 10 + 5 4 5 5 10 10 10 +} + +do_eqp_execsql_test 7.3 { + SELECT id FROM xdir, rt CROSS JOIN ydir + ON (y1 BETWEEN ymin AND ymax) + WHERE (x1 BETWEEN xmin AND xmax); +} { + 0 0 0 {SCAN TABLE xdir} + 0 1 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:B0D1} + 0 2 2 {SCAN TABLE ydir} + 2 4 +} + +do_eqp_execsql_test 7.4 { + SELECT id FROM rt, xdir CROSS JOIN ydir + ON (y1 BETWEEN ymin AND ymax) + WHERE (x1 BETWEEN xmin AND xmax); +} { + 0 0 1 {SCAN TABLE xdir} + 0 1 0 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:B0D1} + 0 2 2 {SCAN TABLE ydir} + 2 4 +} + +finish_test + + finish_test diff --git a/manifest b/manifest index 899c066981..fb3c09a77c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stypo\sin\scomment.\s\sNo\schanges\sto\scode. -D 2015-06-08T17:42:57.317 +C Avoid\spassing\sconstraints\sthat\sare\sunusable\sdue\sto\sLEFT\sor\sCROSS\sjoins\sto\svirtual\stable\sxBestIndex()\smethods. +D 2015-06-08T18:05:54.638 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in a7b384855b72378fd860425b128ea5f75296e9d6 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -156,7 +156,7 @@ F ext/rtree/rtree8.test db79c812f9e4a11f9b1f3f9934007884610a713a F ext/rtree/rtree9.test b5eb13849545dfd271a54ff16784cb00d8792aea F ext/rtree/rtreeA.test ace05e729a36e342d40cf94e9efc7b4723d9dcdf F ext/rtree/rtreeB.test c85f9ce78766c4e68b8b89fbf2979ee9cfa82b4e -F ext/rtree/rtreeC.test df158dcc81f1a43ce7eef361af03c48ec91f1e06 +F ext/rtree/rtreeC.test 90aaaffe2fd4f0dcd12289cad5515f6d41f45ffd F ext/rtree/rtreeD.test 636630357638f5983701550b37f0f5867130d2ca F ext/rtree/rtreeE.test 45a147a64a76306172819562309681d8e90f94bb F ext/rtree/rtreeF.test 66deb9fd1611c7ca2e374adba63debdc2dbb12b4 @@ -327,7 +327,7 @@ F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb F src/wal.c ce2cb2d06faab54d1bce3e739bec79e063dd9113 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 -F src/where.c a328fcc3342044992644b6a11bf301593b8dafb4 +F src/where.c 38b2c4bea9e7a76f882d49c2808e0907e29e2a6d F src/whereInt.h 5f87e3c4b0551747d119730dfebddd3c54f04047 F src/wherecode.c 0669481cabaf5caf934b6bb825df15bc57f60d40 F src/whereexpr.c 9ce1c9cfedbf80c93c7d899497025ec8256ce652 @@ -1285,7 +1285,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 50f336818c8509d8b8bde282e9399d2b2b5ea70a -R 960d1cfe6672a4659b85889f9d77d89d -U mistachkin -Z 915f959f38ed01d6c5f7a7f0fd181c25 +P e49c291735e613e384f6da044ef865dd274cabc8 +R 861f3c87e22a2bd19cbd1623c84fcecb +T *branch * vtab-left-join +T *sym-vtab-left-join * +T -sym-trunk * +U dan +Z 3d7670af603531efb0f4fc0b8b662b61 diff --git a/manifest.uuid b/manifest.uuid index 3649605487..2e337e3eb9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e49c291735e613e384f6da044ef865dd274cabc8 \ No newline at end of file +80ee56dda7db3860f8be5f6968c8745138f8453f \ No newline at end of file diff --git a/src/where.c b/src/where.c index 5c5022c9f6..738c5dbdc4 100644 --- a/src/where.c +++ b/src/where.c @@ -757,6 +757,7 @@ end_auto_index_create: static sqlite3_index_info *allocateIndexInfo( Parse *pParse, WhereClause *pWC, + Bitmask mUnusable, /* Ignore terms with these prereqs */ struct SrcList_item *pSrc, ExprList *pOrderBy ){ @@ -773,6 +774,7 @@ static sqlite3_index_info *allocateIndexInfo( ** to this virtual table */ for(i=nTerm=0, pTerm=pWC->a; inTerm; i++, pTerm++){ if( pTerm->leftCursor != pSrc->iCursor ) continue; + if( pTerm->prereqRight & mUnusable ) continue; assert( IsPowerOfTwo(pTerm->eOperator & ~WO_EQUIV) ); testcase( pTerm->eOperator & WO_IN ); testcase( pTerm->eOperator & WO_ISNULL ); @@ -827,6 +829,7 @@ static sqlite3_index_info *allocateIndexInfo( for(i=j=0, pTerm=pWC->a; inTerm; i++, pTerm++){ u8 op; if( pTerm->leftCursor != pSrc->iCursor ) continue; + if( pTerm->prereqRight & mUnusable ) continue; assert( IsPowerOfTwo(pTerm->eOperator & ~WO_EQUIV) ); testcase( pTerm->eOperator & WO_IN ); testcase( pTerm->eOperator & WO_IS ); @@ -2666,10 +2669,32 @@ static int whereLoopAddBtree( /* ** Add all WhereLoop objects for a table of the join identified by ** pBuilder->pNew->iTab. That table is guaranteed to be a virtual table. +** +** If there are no LEFT or CROSS JOIN joins in the query, both mExtra and +** mUnusable are set to 0. Otherwise, mExtra is a mask of all FROM clause +** entries that occur before the virtual table in the FROM clause and are +** separated from it by at least one LEFT or CROSS JOIN. Similarly, the +** mUnusable mask contains all FROM clause entries that occur after the +** virtual table and are separated from it by at least one LEFT or +** CROSS JOIN. +** +** For example, if the query were: +** +** ... FROM t1, t2 LEFT JOIN t3, t4, vt CROSS JOIN t5, t6; +** +** then mExtra corresponds to (t1, t2) and mUnusable to (t5, t6). +** +** All the tables in mExtra must be scanned before the current virtual +** table. So any terms for which all prerequisites are satisfied by +** mExtra may be specified as "usable" in all calls to xBestIndex. +** Conversely, all tables in mUnusable must be scanned after the current +** virtual table, so any terms for which the prerequisites overlap with +** mUnusable should always be configured as "not-usable" for xBestIndex. */ static int whereLoopAddVirtual( WhereLoopBuilder *pBuilder, /* WHERE clause information */ - Bitmask mExtra + Bitmask mExtra, /* Tables that must be scanned before this one */ + Bitmask mUnusable /* Tables that must be scanned after this one */ ){ WhereInfo *pWInfo; /* WHERE analysis context */ Parse *pParse; /* The parsing context */ @@ -2690,6 +2715,7 @@ static int whereLoopAddVirtual( WhereLoop *pNew; int rc = SQLITE_OK; + assert( (mExtra & mUnusable)==0 ); pWInfo = pBuilder->pWInfo; pParse = pWInfo->pParse; db = pParse->db; @@ -2698,7 +2724,7 @@ static int whereLoopAddVirtual( pSrc = &pWInfo->pTabList->a[pNew->iTab]; pTab = pSrc->pTab; assert( IsVirtual(pTab) ); - pIdxInfo = allocateIndexInfo(pParse, pWC, pSrc, pBuilder->pOrderBy); + pIdxInfo = allocateIndexInfo(pParse, pWC, mUnusable, pSrc,pBuilder->pOrderBy); if( pIdxInfo==0 ) return SQLITE_NOMEM; pNew->prereq = 0; pNew->rSetup = 0; @@ -2728,7 +2754,7 @@ static int whereLoopAddVirtual( if( (pTerm->eOperator & WO_IN)!=0 ){ seenIn = 1; } - if( pTerm->prereqRight!=0 ){ + if( (pTerm->prereqRight & ~mExtra)!=0 ){ seenVar = 1; }else if( (pTerm->eOperator & WO_IN)==0 ){ pIdxCons->usable = 1; @@ -2736,7 +2762,7 @@ static int whereLoopAddVirtual( break; case 1: /* Constants with IN operators */ assert( seenIn ); - pIdxCons->usable = (pTerm->prereqRight==0); + pIdxCons->usable = (pTerm->prereqRight & ~mExtra)==0; break; case 2: /* Variables without IN */ assert( seenVar ); @@ -2835,7 +2861,11 @@ whereLoopAddVtab_exit: ** Add WhereLoop entries to handle OR terms. This works for either ** btrees or virtual tables. */ -static int whereLoopAddOr(WhereLoopBuilder *pBuilder, Bitmask mExtra){ +static int whereLoopAddOr( + WhereLoopBuilder *pBuilder, + Bitmask mExtra, + Bitmask mUnusable +){ WhereInfo *pWInfo = pBuilder->pWInfo; WhereClause *pWC; WhereLoop *pNew; @@ -2894,14 +2924,14 @@ static int whereLoopAddOr(WhereLoopBuilder *pBuilder, Bitmask mExtra){ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pItem->pTab) ){ - rc = whereLoopAddVirtual(&sSubBuild, mExtra); + rc = whereLoopAddVirtual(&sSubBuild, mExtra, mUnusable); }else #endif { rc = whereLoopAddBtree(&sSubBuild, mExtra); } if( rc==SQLITE_OK ){ - rc = whereLoopAddOr(&sSubBuild, mExtra); + rc = whereLoopAddOr(&sSubBuild, mExtra, mUnusable); } assert( rc==SQLITE_OK || sCur.n==0 ); if( sCur.n==0 ){ @@ -2963,33 +2993,44 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ int iTab; SrcList *pTabList = pWInfo->pTabList; struct SrcList_item *pItem; + struct SrcList_item *pEnd = &pTabList->a[pWInfo->nLevel]; sqlite3 *db = pWInfo->pParse->db; - int nTabList = pWInfo->nLevel; int rc = SQLITE_OK; - u8 priorJoinType = 0; WhereLoop *pNew; + pNew = pBuilder->pNew; + whereLoopInit(pNew); + /* Loop over the tables in the join, from left to right */ pNew = pBuilder->pNew; whereLoopInit(pNew); - for(iTab=0, pItem=pTabList->a; iTaba; pItemiTab = iTab; pNew->maskSelf = sqlite3WhereGetMask(&pWInfo->sMaskSet, pItem->iCursor); - if( ((pItem->jointype|priorJoinType) & (JT_LEFT|JT_CROSS))!=0 ){ + if( (pItem->jointype & (JT_LEFT|JT_CROSS))!=0 ){ + /* This condition is true when pItem is the FROM clause term on the + ** right-hand-side of a LEFT or CROSS JOIN. */ mExtra = mPrior; } - priorJoinType = pItem->jointype; if( IsVirtual(pItem->pTab) ){ - rc = whereLoopAddVirtual(pBuilder, mExtra); + struct SrcList_item *p; + for(p=&pItem[1]; pjointype & (JT_LEFT|JT_CROSS)) ){ + mUnusable |= sqlite3WhereGetMask(&pWInfo->sMaskSet, p->iCursor); + } + } + rc = whereLoopAddVirtual(pBuilder, mExtra, mUnusable); }else{ rc = whereLoopAddBtree(pBuilder, mExtra); } if( rc==SQLITE_OK ){ - rc = whereLoopAddOr(pBuilder, mExtra); + rc = whereLoopAddOr(pBuilder, mExtra, mUnusable); } mPrior |= pNew->maskSelf; if( rc || db->mallocFailed ) break; } + whereLoopClear(db, pNew); return rc; } From 35175bf7ab1b4aa3e91119d7d8dde8292f891129 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 8 Jun 2015 18:48:29 +0000 Subject: [PATCH 3/7] If a query contains "FROM t1 LEFT JOIN t2, t3, t4", ensure that tables t3 and t4 are not scanned before t2. The trunk already does this. FossilOrigin-Name: 0d9edfab9fb61322620f188b48ae2a1798a07581 --- manifest | 17 +++++++---------- manifest.uuid | 2 +- src/where.c | 4 +++- test/join.test | 26 ++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index fb3c09a77c..6b7f8b83ec 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Avoid\spassing\sconstraints\sthat\sare\sunusable\sdue\sto\sLEFT\sor\sCROSS\sjoins\sto\svirtual\stable\sxBestIndex()\smethods. -D 2015-06-08T18:05:54.638 +C If\sa\squery\scontains\s"FROM\st1\sLEFT\sJOIN\st2,\st3,\st4",\sensure\sthat\stables\st3\sand\st4\sare\snot\sscanned\sbefore\st2.\sThe\strunk\salready\sdoes\sthis. +D 2015-06-08T18:48:29.533 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in a7b384855b72378fd860425b128ea5f75296e9d6 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -327,7 +327,7 @@ F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb F src/wal.c ce2cb2d06faab54d1bce3e739bec79e063dd9113 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 -F src/where.c 38b2c4bea9e7a76f882d49c2808e0907e29e2a6d +F src/where.c d98dd9461feb44daabfa0fe64831970bc0daacf2 F src/whereInt.h 5f87e3c4b0551747d119730dfebddd3c54f04047 F src/wherecode.c 0669481cabaf5caf934b6bb825df15bc57f60d40 F src/whereexpr.c 9ce1c9cfedbf80c93c7d899497025ec8256ce652 @@ -709,7 +709,7 @@ F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c F test/ioerr5.test 2edfa4fb0f896f733071303b42224df8bedd9da4 F test/ioerr6.test a395a6ab144b26a9e3e21059a1ab6a7149cca65b -F test/join.test 52d4d49f86d0cf46926672878c4eaf0da399104a +F test/join.test f9d4a28dec81c6e9dc21b73518e024d73b5ebf57 F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324 F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0 F test/join4.test 1a352e4e267114444c29266ce79e941af5885916 @@ -1285,10 +1285,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e49c291735e613e384f6da044ef865dd274cabc8 -R 861f3c87e22a2bd19cbd1623c84fcecb -T *branch * vtab-left-join -T *sym-vtab-left-join * -T -sym-trunk * +P 80ee56dda7db3860f8be5f6968c8745138f8453f +R dd22f5dd58533915c3eebee09006a2ae U dan -Z 3d7670af603531efb0f4fc0b8b662b61 +Z 7d33e5ba0e6b939fee95e64c7940bec7 diff --git a/manifest.uuid b/manifest.uuid index 2e337e3eb9..150167c0c5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -80ee56dda7db3860f8be5f6968c8745138f8453f \ No newline at end of file +0d9edfab9fb61322620f188b48ae2a1798a07581 \ No newline at end of file diff --git a/src/where.c b/src/where.c index 738c5dbdc4..41ff393cde 100644 --- a/src/where.c +++ b/src/where.c @@ -2997,6 +2997,7 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ sqlite3 *db = pWInfo->pParse->db; int rc = SQLITE_OK; WhereLoop *pNew; + u8 priorJointype = 0; pNew = pBuilder->pNew; whereLoopInit(pNew); @@ -3008,11 +3009,12 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ Bitmask mUnusable = 0; pNew->iTab = iTab; pNew->maskSelf = sqlite3WhereGetMask(&pWInfo->sMaskSet, pItem->iCursor); - if( (pItem->jointype & (JT_LEFT|JT_CROSS))!=0 ){ + if( ((pItem->jointype|priorJointype) & (JT_LEFT|JT_CROSS))!=0 ){ /* This condition is true when pItem is the FROM clause term on the ** right-hand-side of a LEFT or CROSS JOIN. */ mExtra = mPrior; } + priorJointype = pItem->jointype; if( IsVirtual(pItem->pTab) ){ struct SrcList_item *p; for(p=&pItem[1]; p Date: Mon, 8 Jun 2015 19:15:50 +0000 Subject: [PATCH 4/7] Add the valgrindfuzz target to unix makefile. FossilOrigin-Name: e62aed01f1a6dbc12d6e21386c1671eb640b8d49 --- Makefile.in | 8 +++++--- main.mk | 6 ++++-- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1b7c7f9dc5..ded1687d34 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1004,9 +1004,12 @@ fulltestonly: $(TESTPROGS) ./testfixture$(TEXE) $(TOP)/test/full.test # Fuzz testing -fuzztest: fuzzcheck$(TEXE) +fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) ./fuzzcheck$(TEXE) $(FUZZDATA) +valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) + valgrind ./fuzzcheck$(TEXE) --cell-size-check --quiet $(FUZZDATA) + # This is the common case. Run many tests but not those that take # a really long time. # @@ -1016,8 +1019,7 @@ test: $(TESTPROGS) fuzztest # Run a test using valgrind. This can take a really long time # because valgrind is so much slower than a native machine. # -valgrindtest: $(TESTPROGS) fuzzcheck$(TEXE) - valgrind -v ./fuzzcheck$(TEXE) --cell-size-check --quiet $(FUZZDATA) +valgrindtest: $(TESTPROGS) valgrindfuzz OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind # A very fast test that checks basic sanity. The name comes from diff --git a/main.mk b/main.mk index 22fc700a75..b76972a9ed 100644 --- a/main.mk +++ b/main.mk @@ -682,14 +682,16 @@ queryplantest: testfixture$(EXE) sqlite3$(EXE) fuzztest: fuzzcheck$(EXE) $(FUZZDATA) ./fuzzcheck$(EXE) $(FUZZDATA) +valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) + valgrind ./fuzzcheck$(EXE) --cell-size-check --quiet $(FUZZDATA) + test: $(TESTPROGS) fuzztest ./testfixture$(EXE) $(TOP)/test/veryquick.test # Run a test using valgrind. This can take a really long time # because valgrind is so much slower than a native machine. # -valgrindtest: $(TESTPROGS) fuzzcheck$(EXE) $(FUZZDATA) - valgrind -v ./fuzzcheck$(EXE) --cell-size-check --quiet $(FUZZDATA) +valgrindtest: $(TESTPROGS) valgrindfuzz OMIT_MISUSE=1 valgrind -v ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind # A very fast test that checks basic sanity. The name comes from diff --git a/manifest b/manifest index 899c066981..379ae835a6 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Fix\stypo\sin\scomment.\s\sNo\schanges\sto\scode. -D 2015-06-08T17:42:57.317 +C Add\sthe\svalgrindfuzz\starget\sto\sunix\smakefile. +D 2015-06-08T19:15:50.266 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in a7b384855b72378fd860425b128ea5f75296e9d6 +F Makefile.in 580e006530fab67ccd34926ce2eda66d326af60f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc 5438dc167466f51349ab0c4497aef547d0c9352c F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 @@ -171,7 +171,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 -F main.mk dc931768b88e4417bc2f8b2d45dba385ad29f727 +F main.mk 033741a45df95c577814914b13d182a0b6c7dc89 F mkopcodec.awk c2ff431854d702cdd2d779c9c0d1f58fa16fa4ea F mkopcodeh.awk d5e22023b5238985bb54a72d33e0ac71fe4f8a32 F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 @@ -1285,7 +1285,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 50f336818c8509d8b8bde282e9399d2b2b5ea70a -R 960d1cfe6672a4659b85889f9d77d89d -U mistachkin -Z 915f959f38ed01d6c5f7a7f0fd181c25 +P e49c291735e613e384f6da044ef865dd274cabc8 +R 038506d4cfda1e2a7849e18cec45efaf +U drh +Z dac87b83585efac2cb7ce09058568bbf diff --git a/manifest.uuid b/manifest.uuid index 3649605487..45549e71bb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e49c291735e613e384f6da044ef865dd274cabc8 \ No newline at end of file +e62aed01f1a6dbc12d6e21386c1671eb640b8d49 \ No newline at end of file From 4430b40934f9a5bb4a217123faddf0359e767b5e Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 9 Jun 2015 10:58:51 +0000 Subject: [PATCH 5/7] Remove some repeated lines of source code. Probably introduced by careless cut'n'pasting. FossilOrigin-Name: a34cd71c8aafaece04a2332a127e9b8e99c1403c --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/where.c | 3 --- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 6b7f8b83ec..a11cdef71e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C If\sa\squery\scontains\s"FROM\st1\sLEFT\sJOIN\st2,\st3,\st4",\sensure\sthat\stables\st3\sand\st4\sare\snot\sscanned\sbefore\st2.\sThe\strunk\salready\sdoes\sthis. -D 2015-06-08T18:48:29.533 +C Remove\ssome\srepeated\slines\sof\ssource\scode.\sProbably\sintroduced\sby\scareless\scut'n'pasting. +D 2015-06-09T10:58:51.586 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in a7b384855b72378fd860425b128ea5f75296e9d6 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -327,7 +327,7 @@ F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb F src/wal.c ce2cb2d06faab54d1bce3e739bec79e063dd9113 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 -F src/where.c d98dd9461feb44daabfa0fe64831970bc0daacf2 +F src/where.c 95c0fbfff7aef890b5da7293f6d85cd9a5f99af8 F src/whereInt.h 5f87e3c4b0551747d119730dfebddd3c54f04047 F src/wherecode.c 0669481cabaf5caf934b6bb825df15bc57f60d40 F src/whereexpr.c 9ce1c9cfedbf80c93c7d899497025ec8256ce652 @@ -1285,7 +1285,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 80ee56dda7db3860f8be5f6968c8745138f8453f -R dd22f5dd58533915c3eebee09006a2ae +P 0d9edfab9fb61322620f188b48ae2a1798a07581 +R 95c7a86e3c55ce5e80eb0382016d2fb7 U dan -Z 7d33e5ba0e6b939fee95e64c7940bec7 +Z e08af2de2874802b3cdcc1dde01f104f diff --git a/manifest.uuid b/manifest.uuid index 150167c0c5..e98d7dc3b7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0d9edfab9fb61322620f188b48ae2a1798a07581 \ No newline at end of file +a34cd71c8aafaece04a2332a127e9b8e99c1403c \ No newline at end of file diff --git a/src/where.c b/src/where.c index 41ff393cde..e32d176eac 100644 --- a/src/where.c +++ b/src/where.c @@ -2999,9 +2999,6 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ WhereLoop *pNew; u8 priorJointype = 0; - pNew = pBuilder->pNew; - whereLoopInit(pNew); - /* Loop over the tables in the join, from left to right */ pNew = pBuilder->pNew; whereLoopInit(pNew); From 17c0823bdaeadde5c68d4e1c9d9a0ddeb1f6a581 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 9 Jun 2015 15:58:28 +0000 Subject: [PATCH 6/7] Add the --output=$file and --verbose=(0|1|file) options to tester.tcl. FossilOrigin-Name: f7b2c70362f10ee0347c1d2318918ffefa53243d --- manifest | 14 ++-- manifest.uuid | 2 +- test/tester.tcl | 200 ++++++++++++++++++++++++++++++++++++------------ 3 files changed, 158 insertions(+), 58 deletions(-) diff --git a/manifest b/manifest index 379ae835a6..5c3fac5012 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\svalgrindfuzz\starget\sto\sunix\smakefile. -D 2015-06-08T19:15:50.266 +C Add\sthe\s--output=$file\sand\s--verbose=(0|1|file)\soptions\sto\stester.tcl. +D 2015-06-09T15:58:28.618 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 580e006530fab67ccd34926ce2eda66d326af60f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -949,7 +949,7 @@ F test/tclsqlite.test 7fb866443c7deceed22b63948ccd6f76b52ad054 F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30 F test/temptrigger.test 8ec228b0db5d7ebc4ee9b458fc28cb9e7873f5e1 -F test/tester.tcl c18dbf42f4b0c1fb889b0efeb8a59d5143dd9828 +F test/tester.tcl ca396a3f867c1bd3603400ca8f17bbffd87985b7 F test/thread001.test 9f22fd3525a307ff42a326b6bc7b0465be1745a5 F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58 F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7 @@ -1285,7 +1285,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e49c291735e613e384f6da044ef865dd274cabc8 -R 038506d4cfda1e2a7849e18cec45efaf -U drh -Z dac87b83585efac2cb7ce09058568bbf +P e62aed01f1a6dbc12d6e21386c1671eb640b8d49 +R f55cc3f41ca69cff9ff874d367e120de +U dan +Z 528ec808c863ae4b55820f5f3962de4a diff --git a/manifest.uuid b/manifest.uuid index 45549e71bb..0bf4f52403 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e62aed01f1a6dbc12d6e21386c1671eb640b8d49 \ No newline at end of file +f7b2c70362f10ee0347c1d2318918ffefa53243d \ No newline at end of file diff --git a/test/tester.tcl b/test/tester.tcl index 794ea4a406..a83054fbe7 100644 --- a/test/tester.tcl +++ b/test/tester.tcl @@ -81,6 +81,12 @@ # permutation # presql # +# Command to test whether or not --verbose=1 was specified on the command +# line (returns 0 for not-verbose, 1 for verbose and 2 for "verbose in the +# output file only"). +# +# verbose +# # Set the precision of FP arithmatic used by the interpreter. And # configure SQLite to take database file locks on the page that begins @@ -388,6 +394,9 @@ if {[info exists cmdlinearg]==0} { # --file-retry-delay=N # --start=[$permutation:]$testfile # --match=$pattern + # --verbose=$val + # --output=$filename + # --help # set cmdlinearg(soft-heap-limit) 0 set cmdlinearg(maxerror) 1000 @@ -399,6 +408,8 @@ if {[info exists cmdlinearg]==0} { set cmdlinearg(file-retry-delay) 0 set cmdlinearg(start) "" set cmdlinearg(match) "" + set cmdlinearg(verbose) "" + set cmdlinearg(output) "" set leftover [list] foreach a $argv { @@ -457,6 +468,22 @@ if {[info exists cmdlinearg]==0} { set ::G(match) $cmdlinearg(match) if {$::G(match) == ""} {unset ::G(match)} } + + {^-+output=.+$} { + foreach {dummy cmdlinearg(output)} [split $a =] break + if {$cmdlinearg(verbose)==""} { + set cmdlinearg(verbose) 2 + } + } + {^-+verbose=.+$} { + foreach {dummy cmdlinearg(verbose)} [split $a =] break + if {$cmdlinearg(verbose)=="file"} { + set cmdlinearg(verbose) 2 + } elseif {[string is boolean -strict $cmdlinearg(verbose)]==0} { + error "option --verbose= must be set to a boolean or to \"file\"" + } + } + default { lappend leftover $a } @@ -484,6 +511,16 @@ if {[info exists cmdlinearg]==0} { if {$cmdlinearg(malloctrace)} { sqlite3_memdebug_backtrace $cmdlinearg(backtrace) } + + if {$cmdlinearg(output)!=""} { + puts "Copying output to file $cmdlinearg(output)" + set ::G(output_fd) [open $cmdlinearg(output) w] + fconfigure $::G(output_fd) -buffering line + } + + if {$cmdlinearg(verbose)==""} { + set cmdlinearg(verbose) 1 + } } # Update the soft-heap-limit each time this script is run. In that @@ -554,7 +591,7 @@ proc fail_test {name} { set nFail [set_test_counter errors] if {$nFail>=$::cmdlinearg(maxerror)} { - puts "*** Giving up..." + output2 "*** Giving up..." finalize_testing } } @@ -562,7 +599,7 @@ proc fail_test {name} { # Remember a warning message to be displayed at the conclusion of all testing # proc warning {msg {append 1}} { - puts "Warning: $msg" + output2 "Warning: $msg" set warnList [set_test_counter warn_list] if {$append} { lappend warnList $msg @@ -577,6 +614,61 @@ proc incr_ntest {} { set_test_counter count [expr [set_test_counter count] + 1] } +# Return true if --verbose=1 was specified on the command line. Otherwise, +# return false. +# +proc verbose {} { + return $::cmdlinearg(verbose) +} + +# Use the following commands instead of [puts] for test output within +# this file. Test scripts can still use regular [puts], which is directed +# to stdout and, if one is open, the --output file. +# +# output1: output that should be printed if --verbose=1 was specified. +# output2: output that should be printed unconditionally. +# output2_if_no_verbose: output that should be printed only if --verbose=0. +# +proc output1 {args} { + set v [verbose] + if {$v==1} { + uplevel output2 $args + } elseif {$v==2} { + uplevel puts [lrange $args 0 end-1] $::G(output_fd) [lrange $args end end] + } +} +proc output2 {args} { + set nArg [llength $args] + uplevel puts $args +} +proc output2_if_no_verbose {args} { + set v [verbose] + if {$v==0} { + uplevel output2 $args + } elseif {$v==2} { + uplevel puts [lrange $args 0 end-1] stdout [lrange $args end end] + } +} + +# Override the [puts] command so that if no channel is explicitly +# specified the string is written to both stdout and to the file +# specified by "--output=", if any. +# +proc puts_override {args} { + set nArg [llength $args] + if {$nArg==1 || ($nArg==2 && [string first [lindex $args 0] -nonewline]==0)} { + uplevel puts_original $args + if {[info exists ::G(output_fd)]} { + uplevel puts [lrange $args 0 end-1] $::G(output_fd) [lrange $args end end] + } + } else { + # A channel was explicitly specified. + uplevel puts_original $args + } +} +rename puts puts_original +proc puts {args} { uplevel puts_override $args } + # Invoke the do_test procedure to run a single test # @@ -604,12 +696,13 @@ proc do_test {name cmd expected} { } incr_ntest - puts -nonewline $name... + output1 -nonewline $name... flush stdout if {![info exists ::G(match)] || [string match $::G(match) $name]} { if {[catch {uplevel #0 "$cmd;\n"} result]} { - puts "\nError: $result" + output2_if_no_verbose -nonewline $name... + output2 "\nError: $result" fail_test $name } else { if {[regexp {^~?/.*/$} $expected]} { @@ -653,14 +746,15 @@ proc do_test {name cmd expected} { # if {![info exists ::testprefix] || $::testprefix eq ""} { # error "no test prefix" # } - puts "\nExpected: \[$expected\]\n Got: \[$result\]" + output2_if_no_verbose -nonewline $name... + output2 "\nExpected: \[$expected\]\n Got: \[$result\]" fail_test $name } else { - puts " Ok" + output1 " Ok" } } } else { - puts " Omitted" + output1 " Omitted" omit_test $name "pattern mismatch" 0 } flush stdout @@ -837,7 +931,7 @@ proc delete_all_data {} { # Return the number of microseconds per statement. # proc speed_trial {name numstmt units sql} { - puts -nonewline [format {%-21.21s } $name...] + output2 -nonewline [format {%-21.21s } $name...] flush stdout set speed [time {sqlite3_exec_nr db $sql}] set tm [lindex $speed 0] @@ -847,13 +941,13 @@ proc speed_trial {name numstmt units sql} { set rate [format %20.5f [expr {1000000.0*$numstmt/$tm}]] } set u2 $units/s - puts [format {%12d uS %s %s} $tm $rate $u2] + output2 [format {%12d uS %s %s} $tm $rate $u2] global total_time set total_time [expr {$total_time+$tm}] lappend ::speed_trial_times $name $tm } proc speed_trial_tcl {name numstmt units script} { - puts -nonewline [format {%-21.21s } $name...] + output2 -nonewline [format {%-21.21s } $name...] flush stdout set speed [time {eval $script}] set tm [lindex $speed 0] @@ -863,7 +957,7 @@ proc speed_trial_tcl {name numstmt units script} { set rate [format %20.5f [expr {1000000.0*$numstmt/$tm}]] } set u2 $units/s - puts [format {%12d uS %s %s} $tm $rate $u2] + output2 [format {%12d uS %s %s} $tm $rate $u2] global total_time set total_time [expr {$total_time+$tm}] lappend ::speed_trial_times $name $tm @@ -875,19 +969,19 @@ proc speed_trial_init {name} { sqlite3 versdb :memory: set vers [versdb one {SELECT sqlite_source_id()}] versdb close - puts "SQLite $vers" + output2 "SQLite $vers" } proc speed_trial_summary {name} { global total_time - puts [format {%-21.21s %12d uS TOTAL} $name $total_time] + output2 [format {%-21.21s %12d uS TOTAL} $name $total_time] if { 0 } { sqlite3 versdb :memory: set vers [lindex [versdb one {SELECT sqlite_source_id()}] 0] versdb close - puts "CREATE TABLE IF NOT EXISTS time(version, script, test, us);" + output2 "CREATE TABLE IF NOT EXISTS time(version, script, test, us);" foreach {test us} $::speed_trial_times { - puts "INSERT INTO time VALUES('$vers', '$name', '$test', $us);" + output2 "INSERT INTO time VALUES('$vers', '$name', '$test', $us);" } } } @@ -931,75 +1025,75 @@ proc finalize_testing {} { } } if {$nKnown>0} { - puts "[expr {$nErr-$nKnown}] new errors and $nKnown known errors\ + output2 "[expr {$nErr-$nKnown}] new errors and $nKnown known errors\ out of $nTest tests" } else { - puts "$nErr errors out of $nTest tests" + output2 "$nErr errors out of $nTest tests" } if {$nErr>$nKnown} { - puts -nonewline "Failures on these tests:" + output2 -nonewline "Failures on these tests:" foreach x [set_test_counter fail_list] { - if {![info exists known_error($x)]} {puts -nonewline " $x"} + if {![info exists known_error($x)]} {output2 -nonewline " $x"} } - puts "" + output2 "" } foreach warning [set_test_counter warn_list] { - puts "Warning: $warning" + output2 "Warning: $warning" } run_thread_tests 1 if {[llength $omitList]>0} { - puts "Omitted test cases:" + output2 "Omitted test cases:" set prec {} foreach {rec} [lsort $omitList] { if {$rec==$prec} continue set prec $rec - puts [format { %-12s %s} [lindex $rec 0] [lindex $rec 1]] + output2 [format { %-12s %s} [lindex $rec 0] [lindex $rec 1]] } } if {$nErr>0 && ![working_64bit_int]} { - puts "******************************************************************" - puts "N.B.: The version of TCL that you used to build this test harness" - puts "is defective in that it does not support 64-bit integers. Some or" - puts "all of the test failures above might be a result from this defect" - puts "in your TCL build." - puts "******************************************************************" + output2 "******************************************************************" + output2 "N.B.: The version of TCL that you used to build this test harness" + output2 "is defective in that it does not support 64-bit integers. Some or" + output2 "all of the test failures above might be a result from this defect" + output2 "in your TCL build." + output2 "******************************************************************" } if {$::cmdlinearg(binarylog)} { vfslog finalize binarylog } if {$sqlite_open_file_count} { - puts "$sqlite_open_file_count files were left open" + output2 "$sqlite_open_file_count files were left open" incr nErr } if {[lindex [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] 1]>0 || [sqlite3_memory_used]>0} { - puts "Unfreed memory: [sqlite3_memory_used] bytes in\ + output2 "Unfreed memory: [sqlite3_memory_used] bytes in\ [lindex [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] 1] allocations" incr nErr ifcapable memdebug||mem5||(mem3&&debug) { - puts "Writing unfreed memory log to \"./memleak.txt\"" + output2 "Writing unfreed memory log to \"./memleak.txt\"" sqlite3_memdebug_dump ./memleak.txt } } else { - puts "All memory allocations freed - no leaks" + output2 "All memory allocations freed - no leaks" ifcapable memdebug||mem5 { sqlite3_memdebug_dump ./memusage.txt } } show_memstats - puts "Maximum memory usage: [sqlite3_memory_highwater 1] bytes" - puts "Current memory usage: [sqlite3_memory_highwater] bytes" + output2 "Maximum memory usage: [sqlite3_memory_highwater 1] bytes" + output2 "Current memory usage: [sqlite3_memory_highwater] bytes" if {[info commands sqlite3_memdebug_malloc_count] ne ""} { - puts "Number of malloc() : [sqlite3_memdebug_malloc_count] calls" + output2 "Number of malloc() : [sqlite3_memdebug_malloc_count] calls" } if {$::cmdlinearg(malloctrace)} { - puts "Writing mallocs.sql..." + output2 "Writing mallocs.sql..." memdebug_log_sql sqlite3_memdebug_log stop sqlite3_memdebug_log clear if {[sqlite3_memory_used]>0} { - puts "Writing leaks.sql..." + output2 "Writing leaks.sql..." sqlite3_memdebug_log sync memdebug_log_sql leaks.sql } @@ -1020,30 +1114,30 @@ proc show_memstats {} { set y [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] set val [format {now %10d max %10d max-size %10d} \ [lindex $x 1] [lindex $x 2] [lindex $y 2]] - puts "Memory used: $val" + output1 "Memory used: $val" set x [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] set val [format {now %10d max %10d} [lindex $x 1] [lindex $x 2]] - puts "Allocation count: $val" + output1 "Allocation count: $val" set x [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] set y [sqlite3_status SQLITE_STATUS_PAGECACHE_SIZE 0] set val [format {now %10d max %10d max-size %10d} \ [lindex $x 1] [lindex $x 2] [lindex $y 2]] - puts "Page-cache used: $val" + output1 "Page-cache used: $val" set x [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] set val [format {now %10d max %10d} [lindex $x 1] [lindex $x 2]] - puts "Page-cache overflow: $val" + output1 "Page-cache overflow: $val" set x [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] set val [format {now %10d max %10d} [lindex $x 1] [lindex $x 2]] - puts "Scratch memory used: $val" + output1 "Scratch memory used: $val" set x [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] set y [sqlite3_status SQLITE_STATUS_SCRATCH_SIZE 0] set val [format {now %10d max %10d max-size %10d} \ [lindex $x 1] [lindex $x 2] [lindex $y 2]] - puts "Scratch overflow: $val" + output1 "Scratch overflow: $val" ifcapable yytrackmaxstackdepth { set x [sqlite3_status SQLITE_STATUS_PARSER_STACK 0] set val [format { max %10d} [lindex $x 2]] - puts "Parser stack depth: $val" + output2 "Parser stack depth: $val" } } @@ -1058,7 +1152,7 @@ proc execsql_timed {sql {db db}} { set x [uplevel [list $db eval $sql]] } 1] set tm [lindex $tm 0] - puts -nonewline " ([expr {$tm*0.001}]ms) " + output1 -nonewline " ([expr {$tm*0.001}]ms) " set x } @@ -1595,9 +1689,9 @@ proc do_ioerr_test {testname args} { set nowcksum [cksum] set res [expr {$nowcksum==$::checksum || $nowcksum==$::goodcksum}] if {$res==0} { - puts "now=$nowcksum" - puts "the=$::checksum" - puts "fwd=$::goodcksum" + output2 "now=$nowcksum" + output2 "the=$::checksum" + output2 "fwd=$::goodcksum" } set res } 1 @@ -1821,6 +1915,12 @@ proc slave_test_script {script} { interp eval tinterp [list set $var $value] } + # If output is being copied into a file, share the file-descriptor with + # the interpreter. + if {[info exists ::G(output_fd)]} { + interp share {} $::G(output_fd) tinterp + } + # The alias used to access the global test counters. tinterp alias set_test_counter set_test_counter @@ -1889,7 +1989,7 @@ proc slave_test_file {zFile} { # Add some info to the output. # - puts "Time: $tail $ms ms" + output2 "Time: $tail $ms ms" show_memstats } From 905da63a82e789d2f5decd74fff707488886287a Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 10 Jun 2015 18:53:09 +0000 Subject: [PATCH 7/7] "test" targets on all makefiles use --verbose=file --output=test-out.txt. Add the new "quicktest" target to all makefiles - designed to run in under three minutes. The --quick option on releasetest.tcl now uses quicktest. FossilOrigin-Name: 6ddef2ad35ceb5822fc14c65bc7c6a2662edb63c --- Makefile.in | 23 ++++++++++++++++------- Makefile.msc | 23 +++++++++++++++++------ main.mk | 28 +++++++++++++++++++++------- manifest | 27 ++++++++++++++------------- manifest.uuid | 2 +- test/analyzer1.test | 5 +++++ test/extraquick.test | 16 ++++++++++++++++ test/permutations.test | 17 ++++++++++++++--- test/releasetest.tcl | 7 +++++-- test/sqldiff1.test | 5 +++++ 10 files changed, 114 insertions(+), 39 deletions(-) create mode 100644 test/extraquick.test diff --git a/Makefile.in b/Makefile.in index ded1687d34..8952866dc6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -535,6 +535,10 @@ FUZZDATA = \ $(TOP)/test/fuzzdata2.db \ $(TOP)/test/fuzzdata3.db +# Standard options to testfixture +# +TESTOPTS = --verbose=file --output=test-out.txt + # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. # @@ -993,11 +997,11 @@ testfixture$(TEXE): $(TESTFIXTURE_SRC) # A very detailed test running most or all test cases fulltest: $(TESTPROGS) fuzztest - ./testfixture$(TEXE) $(TOP)/test/all.test + ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS) # Really really long testing soaktest: $(TESTPROGS) - ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 + ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS) # Do extra testing but not everything. fulltestonly: $(TESTPROGS) @@ -1010,24 +1014,29 @@ fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) valgrind ./fuzzcheck$(TEXE) --cell-size-check --quiet $(FUZZDATA) -# This is the common case. Run many tests but not those that take -# a really long time. +# Minimal testing that runs in less than 3 minutes +# +quicktest: ./testfixture$(TEXE) + ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS) + +# This is the common case. Run many tests that do not take too long, +# including fuzzcheck, sqlite3_analyzer, and sqldiff tests. # test: $(TESTPROGS) fuzztest - ./testfixture$(TEXE) $(TOP)/test/veryquick.test + ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS) # Run a test using valgrind. This can take a really long time # because valgrind is so much slower than a native machine. # valgrindtest: $(TESTPROGS) valgrindfuzz - OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind + OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS) # A very fast test that checks basic sanity. The name comes from # the 60s-era electronics testing: "Turn it on and see if smoke # comes out." # smoketest: $(TESTPROGS) fuzzcheck$(TEXE) - ./testfixture$(TEXE) $(TOP)/test/main.test + ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS) sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl echo "#define TCLSH 2" > $@ diff --git a/Makefile.msc b/Makefile.msc index c3272de0de..f29f66cce3 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -1203,6 +1203,9 @@ FUZZDATA = \ $(TOP)\test\fuzzdata2.db \ $(TOP)\test\fuzzdata3.db +# Standard options to testfixture +# +TESTOPTS = --verbose=file --output=test-out.txt # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. @@ -1677,28 +1680,36 @@ testfixture.exe: $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR) /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) extensiontest: testfixture.exe testloadext.dll - .\testfixture.exe $(TOP)\test\loadext.test + .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS) fulltest: $(TESTPROGS) fuzztest - .\testfixture.exe $(TOP)\test\all.test + .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS) soaktest: $(TESTPROGS) - .\testfixture.exe $(TOP)\test\all.test -soak=1 + .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS) fulltestonly: $(TESTPROGS) fuzztest .\testfixture.exe $(TOP)\test\full.test queryplantest: testfixture.exe sqlite3.exe - .\testfixture.exe $(TOP)\test\permutations.test queryplanner + .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS) fuzztest: fuzzcheck.exe .\fuzzcheck.exe $(FUZZDATA) +# Minimal testing that runs in less than 3 minutes (on a fast machine) +# +quicktest: .\testfixture.exe + .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS) + +# This is the common case. Run many tests that do not take too long, +# including fuzzcheck, sqlite3_analyzer, and sqldiff tests. +# test: $(TESTPROGS) fuzztest - .\testfixture.exe $(TOP)\test\veryquick.test + .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS) smoketest: $(TESTPROGS) - .\testfixture.exe $(TOP)\test\main.test + .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS) sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl echo #define TCLSH 2 > $@ diff --git a/main.mk b/main.mk index b76972a9ed..3131386f3a 100644 --- a/main.mk +++ b/main.mk @@ -416,6 +416,10 @@ FUZZDATA = \ $(TOP)/test/fuzzdata2.db \ $(TOP)/test/fuzzdata3.db +# Standard options to testfixture +# +TESTOPTS = --verbose=file --output=test-out.txt + # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. # @@ -668,16 +672,16 @@ fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) fulltest: $(TESTPROGS) fuzztest - ./testfixture$(EXE) $(TOP)/test/all.test + ./testfixture$(EXE) $(TOP)/test/all.test $(TESTOPTS) soaktest: $(TESTPROGS) - ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 + ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS) fulltestonly: $(TESTPROGS) fuzztest - ./testfixture$(EXE) $(TOP)/test/full.test + ./testfixture$(EXE) $(TOP)/test/full.test $(TESTOPTS) queryplantest: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner + ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner $(TESTOPTS) fuzztest: fuzzcheck$(EXE) $(FUZZDATA) ./fuzzcheck$(EXE) $(FUZZDATA) @@ -685,21 +689,31 @@ fuzztest: fuzzcheck$(EXE) $(FUZZDATA) valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) valgrind ./fuzzcheck$(EXE) --cell-size-check --quiet $(FUZZDATA) +# A very quick test using only testfixture and omitting all the slower +# tests. Designed to run in under 3 minutes on a workstation. +# +quicktest: ./testfixture$(EXE) + ./testfixture$(EXE) $(TOP)/test/extraquick.test $(TESTOPTS) + +# The default test case. Runs most of the faster standard TCL tests, +# and fuzz tests, and sqlite3_analyzer and sqldiff tests. +# test: $(TESTPROGS) fuzztest - ./testfixture$(EXE) $(TOP)/test/veryquick.test + ./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS) # Run a test using valgrind. This can take a really long time # because valgrind is so much slower than a native machine. # valgrindtest: $(TESTPROGS) valgrindfuzz - OMIT_MISUSE=1 valgrind -v ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind + OMIT_MISUSE=1 valgrind -v \ + ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS) # A very fast test that checks basic sanity. The name comes from # the 60s-era electronics testing: "Turn it on and see if smoke # comes out." # smoketest: $(TESTPROGS) fuzzcheck$(EXE) - ./testfixture$(EXE) $(TOP)/test/main.test + ./testfixture$(EXE) $(TOP)/test/main.test $(TESTOPTS) # The next two rules are used to support the "threadtest" target. Building # threadtest runs a few thread-safety tests that are implemented in C. This diff --git a/manifest b/manifest index 5da0c00dd9..a38aca8867 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Avoid\spassing\sconstraints\sthat\sare\sunusable\sdue\sto\sLEFT\sor\sCROSS\sjoins\sto\svirtual\stable\sxBestIndex()\smethods. -D 2015-06-10T14:27:40.648 +C "test"\stargets\son\sall\smakefiles\suse\s--verbose=file\s--output=test-out.txt.\nAdd\sthe\snew\s"quicktest"\starget\sto\sall\smakefiles\s-\sdesigned\sto\srun\sin\sunder\nthree\sminutes.\s\sThe\s--quick\soption\son\sreleasetest.tcl\snow\suses\squicktest. +D 2015-06-10T18:53:09.696 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 580e006530fab67ccd34926ce2eda66d326af60f +F Makefile.in 1063c58075b7400d93326b0eb332b48a54f53025 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 5438dc167466f51349ab0c4497aef547d0c9352c +F Makefile.msc 5a8418c81f736dfa953c809af1a48398017b3610 F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 F VERSION ce0ae95abd7121c534f6917c1c8f2b70d9acd4db @@ -171,7 +171,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 -F main.mk 033741a45df95c577814914b13d182a0b6c7dc89 +F main.mk 68f86c21505d6b66765a13c193f00a53dde6a212 F mkopcodec.awk c2ff431854d702cdd2d779c9c0d1f58fa16fa4ea F mkopcodeh.awk d5e22023b5238985bb54a72d33e0ac71fe4f8a32 F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 @@ -357,7 +357,7 @@ F test/analyzeC.test 555a6cc388b9818b6eda6df816f01ce0a75d3a93 F test/analyzeD.test 08f9d0bee4e118a66fff3a32d02dbe0ee0a2b594 F test/analyzeE.test 8684e8ac5722fb97c251887ad97e5d496a98af1d F test/analyzeF.test 7ccd7a04f7d3061bde1a8a4dacc4792edccf6bf2 -F test/analyzer1.test e3bccac3be49382050464952998a631bf51e3ce1 +F test/analyzer1.test 498e2ff4b62740c2751c3a2f8b744fe26689fae9 F test/async.test 1d0e056ba1bb9729283a0f22718d3a25e82c277b F test/async2.test c0a9bd20816d7d6a2ceca7b8c03d3d69c28ffb8b F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7 @@ -526,6 +526,7 @@ F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7 F test/exists.test 8f7b27b61c2fbe5822f0a1f899c715d14e416e30 F test/expr.test 79c3e7502d9e571553b85f0ecc8ff2ac7d0e4931 F test/extension01.test 00d13cec817f331a687a243e0e5a2d87b0e358c9 +F test/extraquick.test cb254400bd42bfb777ff675356aabf3287978f79 F test/fallocate.test 3e979af17dfa7e5e9dda5eba1a696c04fa9d47f7 F test/filectrl.test 14fa712e42c4cb791e09dfd58a6a03efb47ef13a F test/filefmt.test cb34663f126cbc2d358af552dcaf5c72769b0146 @@ -824,7 +825,7 @@ F test/pagesize.test 5769fc62d8c890a83a503f67d47508dfdc543305 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff -F test/permutations.test 32e2b82e0dfbe5c6b6b38a5c1f4cac194298ad4e +F test/permutations.test 6b0f339a4d5f00041555a986dde8fbe8f54c25bc F test/pragma.test be7195f0aa72bdb8a512133e9640ac40f15b57a2 F test/pragma2.test f624a496a95ee878e81e59961eade66d5c00c028 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c @@ -843,7 +844,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8 F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 3e906a8bbd047b8e1f035984fbdc96df4caaea47 +F test/releasetest.tcl 2aaffa548a8f8d10053b20bcf68a1b5a01081e51 F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -929,7 +930,7 @@ F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b F test/speedtest1.c 9f1b745c24886cced3f70ffc666300152a39013c F test/spellfix.test 24f676831acddd2f4056a598fd731a72c6311f49 -F test/sqldiff1.test e5ecfe95b3a2ff6380f0db6ea8bec246b675e122 +F test/sqldiff1.test 8f6bc7c6a5b3585d350d779c6078869ba402f8f5 F test/sqllimits1.test e05786eaed7950ff6a2d00031d001d8a26131e68 F test/stat.test 8de91498c99f5298b303f70f1d1f3b9557af91bf F test/statfault.test f525a7bf633e50afd027700e9a486090684b1ac1 @@ -1285,7 +1286,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f7b2c70362f10ee0347c1d2318918ffefa53243d a34cd71c8aafaece04a2332a127e9b8e99c1403c -R 83db81ff2fb6c9dcf1dbb41c52657424 -U dan -Z 293899bbe176179f6b2abcd42b5d0831 +P 7b446771cadedafbe8924ad0658adc2597816dc7 +R e13907780a1cb22e147b44d8ea4a5351 +U drh +Z 0da5f15a574d2a2ef40a9dda668b3442 diff --git a/manifest.uuid b/manifest.uuid index ca59bdd454..3037113ee1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7b446771cadedafbe8924ad0658adc2597816dc7 \ No newline at end of file +6ddef2ad35ceb5822fc14c65bc7c6a2662edb63c \ No newline at end of file diff --git a/test/analyzer1.test b/test/analyzer1.test index 7da564ea2b..ac46704fba 100644 --- a/test/analyzer1.test +++ b/test/analyzer1.test @@ -24,6 +24,11 @@ if {$tcl_platform(platform)=="windows"} { } else { set PROG "./sqlite3_analyzer" } +if {![file exe $PROG]} { + puts "analyzer1 cannot run because $PROG is not available" + finish_test + return +} db close forcedelete test.db test.db-journal test.db-wal sqlite3 db test.db diff --git a/test/extraquick.test b/test/extraquick.test new file mode 100644 index 0000000000..f453564e7f --- /dev/null +++ b/test/extraquick.test @@ -0,0 +1,16 @@ +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# This file runs most of the tests run by veryquick.test except for those +# that take a long time. +# + +set testdir [file dirname $argv0] +source $testdir/permutations.test + +run_test_suite extraquick + +finish_test diff --git a/test/permutations.test b/test/permutations.test index 4b3ac6481b..01779ff50f 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -96,7 +96,7 @@ if {$::tcl_platform(platform)!="unix"} { set alltests [test_set $alltests -exclude { all.test async.test quick.test veryquick.test memleak.test permutations.test soak.test fts3.test - mallocAll.test rtree.test full.test + mallocAll.test rtree.test full.test extraquick.test }] set allquicktests [test_set $alltests -exclude { @@ -146,11 +146,22 @@ if {[info exists ::env(TEST_FAILURE)]} { lappend ::testsuitelist xxx test_suite "veryquick" -prefix "" -description { - "Very" quick test suite. Runs in less than 5 minutes on a workstation. + "Very" quick test suite. Runs in minutes on a workstation. This test suite is the same as the "quick" tests, except that some files that test malloc and IO errors are omitted. } -files [ - test_set $allquicktests -exclude *malloc* *ioerr* *fault* + test_set $allquicktests -exclude *malloc* *ioerr* *fault* *bigfile* +] + +test_suite "extraquick" -prefix "" -description { + "Extra" quick test suite. Runs in a few minutes on a workstation. + This test suite is the same as the "veryquick" tests, except that + slower tests are omitted. +} -files [ + test_set $allquicktests -exclude *malloc* *ioerr* *fault* *bigfile* \ + wal3.test fts4merge* sort2.test mmap1.test walcrash* \ + percentile.test where8m.test walcksum.test savepoint3.test \ + fuzzer1.test fuzzer3.test fts3expr3.test ] test_suite "mmap" -prefix "mm-" -description { diff --git a/test/releasetest.tcl b/test/releasetest.tcl index a120ddf336..6e475c9d29 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -547,7 +547,10 @@ proc process_options {argv} { puts " --srcdir $::SRCDIR" puts " --platform [list $platform]" puts " --config [list $config]" - if {$::QUICK} {puts " --quick"} + if {$::QUICK} { + if {$::QUICK==1} {puts " --quick"} + if {$::QUICK==2} {puts " --veryquick"} + } if {$::MSVC} {puts " --msvc"} if {$::BUILDONLY} {puts " --buildonly"} if {$::DRYRUN} {puts " --dryrun"} @@ -645,7 +648,7 @@ proc main {argv} { } if {$target ne "checksymbols"} { switch -- $::QUICK { - 1 {set target test} + 1 {set target quicktest} 2 {set target smoketest} } if {$::BUILDONLY} { diff --git a/test/sqldiff1.test b/test/sqldiff1.test index 723b7a5e13..3201fb3654 100644 --- a/test/sqldiff1.test +++ b/test/sqldiff1.test @@ -19,6 +19,11 @@ if {$tcl_platform(platform)=="windows"} { } else { set PROG "./sqldiff" } +if {![file exe $PROG]} { + puts "sqldiff cannot run because $PROG is not available" + finish_test + return +} db close forcedelete test.db test2.db sqlite3 db test.db