** If an OOM error occurs, SQLITE_NOMEM is returned. Otherwise, SQLITE_OK.
*/
static int fts3ScanInteriorNode(
- Fts3Table *p, /* Virtual table handle */
const char *zTerm, /* Term to select leaves for */
int nTerm, /* Size of term zTerm in bytes */
const char *zNode, /* Buffer containing segment interior node */
assert( piLeaf || piLeaf2 );
sqlite3Fts3GetVarint32(zNode, &iHeight);
- rc = fts3ScanInteriorNode(p, zTerm, nTerm, zNode, nNode, piLeaf, piLeaf2);
+ rc = fts3ScanInteriorNode(zTerm, nTerm, zNode, nNode, piLeaf, piLeaf2);
assert( !piLeaf2 || !piLeaf || rc!=SQLITE_OK || (*piLeaf<=*piLeaf2) );
if( rc==SQLITE_OK && iHeight>1 ){
if( pArray ){
int i;
for(i=0; i<pArray->nSegment; i++){
- sqlite3Fts3SegReaderFree(0, pArray->apSegment[i]);
+ sqlite3Fts3SegReaderFree(pArray->apSegment[i]);
}
sqlite3_free(pArray);
}
sizeof(Fts3SegReaderArray) + (nNew-1) * sizeof(Fts3SegReader*)
);
if( !pArray ){
- sqlite3Fts3SegReaderFree(0, pNew);
+ sqlite3Fts3SegReaderFree(pNew);
return SQLITE_NOMEM;
}
if( nNew==16 ){
** leaf). Do not bother inspecting any data in this case, just
** create a Fts3SegReader to scan the single leaf.
*/
- rc = sqlite3Fts3SegReaderNew(p, iAge, 0, 0, 0, zRoot, nRoot, &pNew);
+ rc = sqlite3Fts3SegReaderNew(iAge, 0, 0, 0, zRoot, nRoot, &pNew);
}else{
sqlite3_int64 i1; /* First leaf that may contain zTerm */
sqlite3_int64 i2; /* Final leaf that may contain zTerm */
rc = fts3SelectLeaf(p, zTerm, nTerm, zRoot, nRoot, &i1, (isPrefix?&i2:0));
if( isPrefix==0 ) i2 = i1;
if( rc==SQLITE_OK ){
- rc = sqlite3Fts3SegReaderNew(p, iAge, i1, i2, 0, 0, 0, &pNew);
+ rc = sqlite3Fts3SegReaderNew(iAge, i1, i2, 0, 0, 0, &pNew);
}
}
assert( (pNew==0)==(rc!=SQLITE_OK) );
int sqlite3Fts3PendingTermsFlush(Fts3Table *);
void sqlite3Fts3PendingTermsClear(Fts3Table *);
int sqlite3Fts3Optimize(Fts3Table *);
-int sqlite3Fts3SegReaderNew(Fts3Table *,int, sqlite3_int64,
+int sqlite3Fts3SegReaderNew(int, sqlite3_int64,
sqlite3_int64, sqlite3_int64, const char *, int, Fts3SegReader**);
int sqlite3Fts3SegReaderPending(Fts3Table*,const char*,int,int,Fts3SegReader**);
-void sqlite3Fts3SegReaderFree(Fts3Table *, Fts3SegReader *);
+void sqlite3Fts3SegReaderFree(Fts3SegReader *);
int sqlite3Fts3SegReaderIterate(
Fts3Table *, Fts3SegReader **, int, Fts3SegFilter *,
int (*)(Fts3Table *, void *, char *, int, char *, int), void *
if( sqlite3_fts3_enable_parentheses ){
if( *zInput=='(' ){
int nConsumed;
- int rc;
pParse->nNest++;
rc = fts3ExprParse(pParse, &zInput[1], nInput-1, ppExpr, &nConsumed);
if( rc==SQLITE_OK && !*ppExpr ){
int i, j;
char zReverse[28];
char *z, *z2;
- if( nIn<3 || nIn>=sizeof(zReverse)-7 ){
+ if( nIn<3 || nIn>=(int)sizeof(zReverse)-7 ){
/* The word is too big or too small for the porter stemmer.
** Fallback to the copy stemmer */
copy_stemmer(zIn, nIn, zOut, pnOut);
static int fts3ExprPhraseCountCb(Fts3Expr *pExpr, int iPhrase, void *ctx){
(*(int *)ctx)++;
+ UNUSED_PARAMETER(pExpr);
+ UNUSED_PARAMETER(iPhrase);
return SQLITE_OK;
}
static int fts3ExprPhraseCount(Fts3Expr *pExpr){
break;
default: {
+ Fts3Expr *pExpr;
assert( zArg[i]==FTS3_MATCHINFO_HITS );
- Fts3Expr *pExpr = pCsr->pExpr;
+ pExpr = pCsr->pExpr;
rc = fts3ExprLoadDoclists(pCsr, 0, 0);
if( rc!=SQLITE_OK ) break;
if( bGlobal ){
}
#endif
- if( SQLITE_OK!=rc
- || SQLITE_OK!=(rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0))
- || SQLITE_OK!=(rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0))
+ if( SQLITE_OK==rc ){
+ rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0);
+ }
+ if( SQLITE_OK==rc ){
+ rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0);
+ }
#ifdef SQLITE_TEST
- || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0))
- || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0))
- || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0))
+ if( SQLITE_OK==rc ){
+ rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0);
+ }
+ if( SQLITE_OK==rc ){
+ rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0);
+ }
+ if( SQLITE_OK==rc ){
+ rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0);
+ }
#endif
- );
#ifdef SQLITE_TEST
sqlite3_free(zTest);
return fts3SelectDocsize(pTab, SQL_SELECT_DOCSIZE, iDocid, ppStmt);
}
-void sqlite3Fts3MatchinfoLcs(Fts3Expr *pExpr, u32 *aOut){
-}
-
/*
** Similar to fts3SqlStmt(). Except, after binding the parameters in
** array apVal[] to the SQL statement identified by eStmt, the statement
** Free all allocations associated with the iterator passed as the
** second argument.
*/
-void sqlite3Fts3SegReaderFree(Fts3Table *p, Fts3SegReader *pReader){
+void sqlite3Fts3SegReaderFree(Fts3SegReader *pReader){
if( pReader && !fts3SegReaderIsPending(pReader) ){
sqlite3_free(pReader->zTerm);
if( !fts3SegReaderIsRootOnly(pReader) ){
** Allocate a new SegReader object.
*/
int sqlite3Fts3SegReaderNew(
- Fts3Table *p, /* Virtual table handle */
int iAge, /* Segment "age". */
sqlite3_int64 iStartLeaf, /* First leaf to traverse */
sqlite3_int64 iEndLeaf, /* Final leaf to traverse */
if( rc==SQLITE_OK ){
*ppReader = pReader;
}else{
- sqlite3Fts3SegReaderFree(p, pReader);
+ sqlite3Fts3SegReaderFree(pReader);
}
return rc;
}
** code is returned.
*/
static int fts3SegReaderNew(
- Fts3Table *p, /* Virtual table handle */
sqlite3_stmt *pStmt, /* See above */
int iAge, /* Segment "age". */
Fts3SegReader **ppReader /* OUT: Allocated Fts3SegReader */
){
- return sqlite3Fts3SegReaderNew(p, iAge,
+ return sqlite3Fts3SegReaderNew(iAge,
sqlite3_column_int64(pStmt, 1),
sqlite3_column_int64(pStmt, 2),
sqlite3_column_int64(pStmt, 3),
if( rc!=SQLITE_OK ) goto finished;
sqlite3_bind_int(pStmt, 1, iLevel);
for(i=0; SQLITE_ROW==(sqlite3_step(pStmt)); i++){
- rc = fts3SegReaderNew(p, pStmt, i, &apSegment[i]);
+ rc = fts3SegReaderNew(pStmt, i, &apSegment[i]);
if( rc!=SQLITE_OK ){
goto finished;
}
fts3SegWriterFree(pWriter);
if( apSegment ){
for(i=0; i<nSegment; i++){
- sqlite3Fts3SegReaderFree(p, apSegment[i]);
+ sqlite3Fts3SegReaderFree(apSegment[i]);
}
sqlite3_free(apSegment);
}
- sqlite3Fts3SegReaderFree(p, pPending);
+ sqlite3Fts3SegReaderFree(pPending);
sqlite3_reset(pStmt);
return rc;
}
rc = fts3SegWriterFlush(p, pWriter, 0, idx);
}
fts3SegWriterFree(pWriter);
- sqlite3Fts3SegReaderFree(p, pReader);
+ sqlite3Fts3SegReaderFree(pReader);
if( rc==SQLITE_OK ){
sqlite3Fts3PendingTermsClear(p);
typedef unsigned int u32;
#endif
+/* The following macro is used to suppress compiler warnings.
+*/
+#ifndef UNUSED_PARAMETER
+# define UNUSED_PARAMETER(x) (void)(x)
+#endif
+
typedef struct Rtree Rtree;
typedef struct RtreeCursor RtreeCursor;
typedef struct RtreeNode RtreeNode;
/* Check that the blob is roughly the right size. */
nBlob = sqlite3_value_bytes(pValue);
- if( nBlob<sizeof(RtreeMatchArg)
+ if( nBlob<(int)sizeof(RtreeMatchArg)
|| ((nBlob-sizeof(RtreeMatchArg))%sizeof(double))!=0
){
return SQLITE_ERROR;
memcpy(p, sqlite3_value_blob(pValue), nBlob);
if( p->magic!=RTREE_GEOMETRY_MAGIC
- || nBlob!=(sizeof(RtreeMatchArg) + (p->nParam-1)*sizeof(double))
+ || nBlob!=(int)(sizeof(RtreeMatchArg) + (p->nParam-1)*sizeof(double))
){
sqlite3_free(pGeom);
return SQLITE_ERROR;
int iIdx = 0;
char zIdxStr[RTREE_MAX_DIMENSIONS*8+1];
memset(zIdxStr, 0, sizeof(zIdxStr));
+ UNUSED_PARAMETER(tab);
assert( pIdxInfo->idxStr==0 );
for(ii=0; ii<pIdxInfo->nConstraint; ii++){
if( ii!=iExclude )
#else
assert( iExclude==-1 );
+ UNUSED_PARAMETER(iExclude);
#endif
{
int jj;
Rtree tree;
int ii;
+ UNUSED_PARAMETER(nArg);
memset(&node, 0, sizeof(RtreeNode));
memset(&tree, 0, sizeof(Rtree));
tree.nDim = sqlite3_value_int(apArg[0]);
}
static void rtreedepth(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){
+ UNUSED_PARAMETER(nArg);
if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB
|| sqlite3_value_bytes(apArg[0])<2
){
rc = sqlite3_create_function(db, "rtreenode", 2, utf8, 0, rtreenode, 0, 0);
if( rc==SQLITE_OK ){
- int utf8 = SQLITE_UTF8;
rc = sqlite3_create_function(db, "rtreedepth", 1, utf8, 0,rtreedepth, 0, 0);
}
if( rc==SQLITE_OK ){
-C Fix\san\suninitialized\svariable\sin\sfts3.c.
-D 2010-11-26T16:31:44
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+C Fix\svarious\scompiler\swarnings.
+D 2010-11-26T16:49:59
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 4547616ad2286053af6ccccefa242dc925e49bf0
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
-F ext/fts3/fts3.c 7fda91bbe8d6e4a84bed15c38c1e5768347c3609
+F ext/fts3/fts3.c bae65cf771cd2c1dbcc972b064f770737cdbfca4
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
-F ext/fts3/fts3Int.h 52c818623c60943bc4ac4a22d77b2e8f28395e78
-F ext/fts3/fts3_expr.c ee48b9278b8b2432a05a03320fbcacba151dbaa5
+F ext/fts3/fts3Int.h a6c69c1c5e2c8c19172ddff42d262c087dcd7337
+F ext/fts3/fts3_expr.c f1cd71e78f73c99341d979619c14cac8b5c4f56f
F ext/fts3/fts3_hash.c 3c8f6387a4a7f5305588b203fa7c887d753e1f1c
F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec
F ext/fts3/fts3_icu.c ac494aed69835008185299315403044664bda295
-F ext/fts3/fts3_porter.c 8df6f6efcc4e9e31f8bf73a4007c2e9abca1dfba
-F ext/fts3/fts3_snippet.c e8a952d5de28950c91bbfed3d75b77ae2c3977ce
-F ext/fts3/fts3_tokenizer.c 1301b0ee3ef414caae3257a702215925cc48cd9c
+F ext/fts3/fts3_porter.c d61cfd81fb0fd8fbcb25adcaee0ba671aefaa5c2
+F ext/fts3/fts3_snippet.c 1d827175e9bf3ae58d608a43ce2a7ac89d5bbe0c
+F ext/fts3/fts3_tokenizer.c 055f3dc7369585350b28db1ee0f3b214dca6724d
F ext/fts3/fts3_tokenizer.h 13ffd9fcb397fec32a05ef5cd9e0fa659bf3dbd3
F ext/fts3/fts3_tokenizer1.c 6e5cbaa588924ac578263a598e4fb9f5c9bb179d
-F ext/fts3/fts3_write.c b4e5b4c74f755a6f494dab9c131ad9bb04bab50c
+F ext/fts3/fts3_write.c 9d254e1baf4ed7ebebef8dbf1ec21cbdb611d1f6
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
F ext/icu/README.txt bf8461d8cdc6b8f514c080e4e10dc3b2bbdfefa9
F ext/icu/icu.c 850e9a36567bbcce6bd85a4b68243cad8e3c2de2
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
-F ext/rtree/rtree.c 1a15546893b4c05df810ebc18d3bf910ac8ca601
+F ext/rtree/rtree.c e1a2d0fd4b38200bf09d417e4c9400f62c981391
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
F ext/rtree/rtree1.test dbd4250ac0ad367a262eb9676f7e3080b0368206
F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
F src/utf.c 1baeeac91707a4df97ccc6141ec0f808278af685
F src/util.c ab1c92426494f499f42b9e307537b03e923d75c1
F src/vacuum.c 924bd1bcee2dfb05376f79845bd3b4cec7b54b2f
-F src/vdbe.c 7aef0a9e174099a0b2d6b940ca9d3ae9833fd014
+F src/vdbe.c 21a9285fedf2e310ffc4bad27b828645dc2b20bb
F src/vdbe.h 4de0efb4b0fdaaa900cf419b35c458933ef1c6d2
F src/vdbeInt.h 7f4cf1b2b69bef3a432b1f23dfebef57275436b4
F src/vdbeapi.c fb0036185b3c56e15916a5ee96309cd4acf6818f
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 7d660b91b748126c499285713bd0237530a1a601
-R bf3c79b7317123c38edff4a337096bab
-U dan
-Z e6c80a7ed69438f59cf0d2cdb47a5fa6
+P 3c3d076b42da36cd5413749ec022d0349325edfa
+R 6eb1d3796cc6e7f30b85a46219b5a41c
+U drh
+Z dad7028ef2a2e95ebd4d4284381d5339
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+iD8DBQFM7+U6oxKgR168RlERArCCAJ9Ms95IkrYzcyhjnhaA4kTfC+owCwCdG6XU
+6RTdcghjuTo4XsP3zh0JwEk=
+=o/S3
+-----END PGP SIGNATURE-----
-3c3d076b42da36cd5413749ec022d0349325edfa
\ No newline at end of file
+c412f61229b6ab1ac90b932afd56f7c5e3ba1cfe
\ No newline at end of file
newMax = 0;
if( pOp->p3 ){
newMax = sqlite3BtreeLastPage(pBt);
- if( pOp->p3>newMax ) newMax = pOp->p3;
+ if( newMax < (unsigned)pOp->p3 ) newMax = (unsigned)pOp->p3;
}
pOut->u.i = sqlite3BtreeMaxPageCount(pBt, newMax);
break;