diff --git a/Makefile.in b/Makefile.in index 2c91b8252d..4dfe381af4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -345,8 +345,8 @@ SRC += \ $(TOP)/ext/rtree/rtree.h \ $(TOP)/ext/rtree/rtree.c SRC += \ - $(TOP)/ext/ota/sqlite3ota.h \ - $(TOP)/ext/ota/sqlite3ota.c + $(TOP)/ext/rbu/sqlite3rbu.h \ + $(TOP)/ext/rbu/sqlite3rbu.c # Generated source code files @@ -404,7 +404,7 @@ TESTSRC = \ $(TOP)/src/test_wsd.c \ $(TOP)/ext/fts3/fts3_term.c \ $(TOP)/ext/fts3/fts3_test.c \ - $(TOP)/ext/ota/test_ota.c + $(TOP)/ext/rbu/test_rbu.c # Statically linked extensions # @@ -1039,15 +1039,18 @@ soaktest: $(TESTPROGS) ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS) # Do extra testing but not everything. -fulltestonly: $(TESTPROGS) +fulltestonly: $(TESTPROGS) fuzztest ./testfixture$(TEXE) $(TOP)/test/full.test # Fuzz testing fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) ./fuzzcheck$(TEXE) $(FUZZDATA) +fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA) + ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA) + valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) - valgrind ./fuzzcheck$(TEXE) --cell-size-check --quiet $(FUZZDATA) + valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M $(FUZZDATA) # Minimal testing that runs in less than 3 minutes # @@ -1057,7 +1060,7 @@ quicktest: ./testfixture$(TEXE) # This is the common case. Run many tests that do not take too long, # including fuzzcheck, sqlite3_analyzer, and sqldiff tests. # -test: $(TESTPROGS) fuzztest +test: $(TESTPROGS) fastfuzztest ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS) # Run a test using valgrind. This can take a really long time @@ -1192,7 +1195,7 @@ clean: rm -f fts5.* fts5parse.* distclean: clean - rm -f config.log config.status libtool Makefile sqlite3.pc + rm -f config.h config.log config.status libtool Makefile sqlite3.pc # # Windows section diff --git a/Makefile.msc b/Makefile.msc index ed6e58e949..0e1fedee67 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -1007,8 +1007,8 @@ SRC4 = \ $(TOP)\ext\icu\icu.c \ $(TOP)\ext\rtree\rtree.h \ $(TOP)\ext\rtree\rtree.c \ - $(TOP)\ext\ota\sqlite3ota.h \ - $(TOP)\ext\ota\sqlite3ota.c + $(TOP)\ext\rbu\sqlite3rbu.h \ + $(TOP)\ext\rbu\sqlite3rbu.c # Generated source code files @@ -1069,7 +1069,7 @@ TESTSRC = \ $(TOP)\src\test_wsd.c \ $(TOP)\ext\fts3\fts3_term.c \ $(TOP)\ext\fts3\fts3_test.c \ - $(TOP)\ext\ota\test_ota.c + $(TOP)\ext\rbu\test_rbu.c # Statically linked extensions # @@ -1738,6 +1738,9 @@ queryplantest: testfixture.exe sqlite3.exe fuzztest: fuzzcheck.exe .\fuzzcheck.exe $(FUZZDATA) +fastfuzztest: fuzzcheck.exe + .\fuzzcheck.exe --limit-mem 100M $(FUZZDATA) + # Minimal testing that runs in less than 3 minutes (on a fast machine) # quicktest: testfixture.exe @@ -1746,7 +1749,7 @@ quicktest: testfixture.exe # This is the common case. Run many tests that do not take too long, # including fuzzcheck, sqlite3_analyzer, and sqldiff tests. # -test: $(TESTPROGS) fuzztest +test: $(TESTPROGS) fastfuzztest .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS) smoketest: $(TESTPROGS) diff --git a/autoconf/tea/Makefile.in b/autoconf/tea/Makefile.in index a8708974b0..3e481dadfe 100644 --- a/autoconf/tea/Makefile.in +++ b/autoconf/tea/Makefile.in @@ -348,7 +348,7 @@ clean: distclean: clean -rm -f *.tab.c -rm -f $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log config.status + -rm -f config.h config.cache config.log config.status #======================================================================== # Install binary object libraries. On Windows this includes both .dll and diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index 903d7d84fd..6a9b507fc0 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -4231,7 +4231,6 @@ static int fts3EvalPhraseStart(Fts3Cursor *pCsr, int bOptOk, Fts3Phrase *p){ int bIncrOk = (bOptOk && pCsr->bDesc==pTab->bDescIdx && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 - && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 #ifdef SQLITE_TEST && pTab->bNoIncrDoclist==0 #endif diff --git a/ext/fts5/fts5_expr.c b/ext/fts5/fts5_expr.c index 97ff3c72a0..861b20863a 100644 --- a/ext/fts5/fts5_expr.c +++ b/ext/fts5/fts5_expr.c @@ -60,7 +60,7 @@ struct Fts5ExprNode { /* Child nodes. For a NOT node, this array always contains 2 entries. For ** AND or OR nodes, it contains 2 or more entries. */ int nChild; /* Number of child nodes */ - Fts5ExprNode *apChild[0]; /* Array of child nodes */ + Fts5ExprNode *apChild[1]; /* Array of child nodes */ }; #define Fts5NodeIsString(p) ((p)->eType==FTS5_TERM || (p)->eType==FTS5_STRING) @@ -1619,7 +1619,7 @@ Fts5ExprNode *sqlite3Fts5ParseNode( if( pRight->eType==eType ) nChild += pRight->nChild-1; } - nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*nChild; + nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1); pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte); if( pRet ){ diff --git a/ext/fts5/fts5_index.c b/ext/fts5/fts5_index.c index f3384bb5cb..065df4fac1 100644 --- a/ext/fts5/fts5_index.c +++ b/ext/fts5/fts5_index.c @@ -3690,13 +3690,13 @@ static void fts5IndexMergeLevel( fts5MultiIterEof(p, pIter)==0; fts5MultiIterNext(p, pIter, 0, 0) ){ - Fts5SegIter *pSeg = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; + Fts5SegIter *pSegIter = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; int nPos; /* position-list size field value */ int nTerm; const u8 *pTerm; /* Check for key annihilation. */ - if( pSeg->nPos==0 && (bOldest || pSeg->bDel==0) ) continue; + if( pSegIter->nPos==0 && (bOldest || pSegIter->bDel==0) ) continue; pTerm = fts5MultiIterTerm(pIter, &nTerm); if( nTerm!=term.n || memcmp(pTerm, term.p, nTerm) ){ @@ -3715,11 +3715,11 @@ static void fts5IndexMergeLevel( /* Append the rowid to the output */ /* WRITEPOSLISTSIZE */ - nPos = pSeg->nPos*2 + pSeg->bDel; + nPos = pSegIter->nPos*2 + pSegIter->bDel; fts5WriteAppendRowid(p, &writer, fts5MultiIterRowid(pIter), nPos); /* Append the position-list data to the output */ - fts5ChunkIterate(p, pSeg, (void*)&writer, fts5MergeChunkCallback); + fts5ChunkIterate(p, pSegIter, (void*)&writer, fts5MergeChunkCallback); } /* Flush the last leaf page to disk. Set the output segment b-tree height diff --git a/ext/ota/ota.c b/ext/rbu/rbu.c similarity index 63% rename from ext/ota/ota.c rename to ext/rbu/rbu.c index fffc1267bd..dd46743def 100644 --- a/ext/ota/ota.c +++ b/ext/rbu/rbu.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** -** This file contains a command-line application that uses the OTA +** This file contains a command-line application that uses the RBU ** extension. See the usage() function below for an explanation. */ -#include "sqlite3ota.h" +#include "sqlite3rbu.h" #include #include #include @@ -24,18 +24,18 @@ */ void usage(const char *zArgv0){ fprintf(stderr, -"Usage: %s [-step NSTEP] TARGET-DB OTA-DB\n" +"Usage: %s [-step NSTEP] TARGET-DB RBU-DB\n" "\n" -" Argument OTA-DB must be an OTA database containing an update suitable for\n" +" Argument RBU-DB must be an RBU database containing an update suitable for\n" " target database TARGET-DB. If NSTEP is set to less than or equal to zero\n" " (the default value), this program attempts to apply the entire update to\n" " the target database.\n" "\n" " If NSTEP is greater than zero, then a maximum of NSTEP calls are made\n" -" to sqlite3ota_step(). If the OTA update has not been completely applied\n" -" after the NSTEP'th call is made, the state is saved in the database OTA-DB\n" -" and the program exits. Subsequent invocations of this (or any other OTA)\n" -" application will use this state to resume applying the OTA update to the\n" +" to sqlite3rbu_step(). If the RBU update has not been completely applied\n" +" after the NSTEP'th call is made, the state is saved in the database RBU-DB\n" +" and the program exits. Subsequent invocations of this (or any other RBU)\n" +" application will use this state to resume applying the RBU update to the\n" " target db.\n" "\n" , zArgv0); @@ -47,8 +47,8 @@ void report_default_vfs(){ fprintf(stdout, "default vfs is \"%s\"\n", pVfs->zName); } -void report_ota_vfs(sqlite3ota *pOta){ - sqlite3 *db = sqlite3ota_db(pOta, 0); +void report_rbu_vfs(sqlite3rbu *pRbu){ + sqlite3 *db = sqlite3rbu_db(pRbu, 0); if( db ){ char *zName = 0; sqlite3_file_control(db, "main", SQLITE_FCNTL_VFSNAME, &zName); @@ -63,16 +63,17 @@ void report_ota_vfs(sqlite3ota *pOta){ int main(int argc, char **argv){ int i; - const char *zTarget; /* Target database to apply OTA to */ - const char *zOta; /* Database containing OTA */ + const char *zTarget; /* Target database to apply RBU to */ + const char *zRbu; /* Database containing RBU */ + char zBuf[200]; /* Buffer for printf() */ char *zErrmsg; /* Error message, if any */ - sqlite3ota *pOta; /* OTA handle */ + sqlite3rbu *pRbu; /* RBU handle */ int nStep = 0; /* Maximum number of step() calls */ int rc; sqlite3_int64 nProgress = 0; /* Process command line arguments. Following this block local variables - ** zTarget, zOta and nStep are all set. */ + ** zTarget, zRbu and nStep are all set. */ if( argc==5 ){ int nArg1 = strlen(argv[1]); if( nArg1>5 || nArg1<2 || memcmp("-step", argv[1], nArg1) ) usage(argv[0]); @@ -81,34 +82,36 @@ int main(int argc, char **argv){ usage(argv[0]); } zTarget = argv[argc-2]; - zOta = argv[argc-1]; + zRbu = argv[argc-1]; report_default_vfs(); - /* Open an OTA handle. If nStep is less than or equal to zero, call - ** sqlite3ota_step() until either the OTA has been completely applied + /* Open an RBU handle. If nStep is less than or equal to zero, call + ** sqlite3rbu_step() until either the RBU has been completely applied ** or an error occurs. Or, if nStep is greater than zero, call - ** sqlite3ota_step() a maximum of nStep times. */ - pOta = sqlite3ota_open(zTarget, zOta, 0); - report_ota_vfs(pOta); - for(i=0; (nStep<=0 || i