]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a problem preventing doclist indexes from being loaded.
authordan <dan@noemail.net>
Wed, 15 Apr 2015 16:01:42 +0000 (16:01 +0000)
committerdan <dan@noemail.net>
Wed, 15 Apr 2015 16:01:42 +0000 (16:01 +0000)
FossilOrigin-Name: b29109a083e5cd442cdd19f29d7be45b09c4f661

ext/fts5/fts5_index.c
manifest
manifest.uuid

index 2616d32e60d6bb8054b185e7a73aab714e18729d..3c6e436e56e55f6b6cc147aefd5f4940660aedfd 100644 (file)
@@ -2018,7 +2018,6 @@ static void fts5SegIterLoadDlidx(Fts5Index *p, int iIdx, Fts5SegIter *pIter){
   int iSeg = pIter->pSeg->iSegid;
   int bRev = (pIter->flags & FTS5_SEGITER_REVERSE);
   Fts5Data *pLeaf = pIter->pLeaf; /* Current leaf data */
-  int iOff = pIter->iLeafOffset;  /* Byte offset within current leaf */
 
   assert( pIter->flags & FTS5_SEGITER_ONETERM );
   assert( pIter->pDlidx==0 );
@@ -2027,18 +2026,19 @@ static void fts5SegIterLoadDlidx(Fts5Index *p, int iIdx, Fts5SegIter *pIter){
   ** early without loading the doclist-index (as it belongs to a different
   ** term. */
   if( pIter->iTermLeafPgno==pIter->iLeafPgno ){
-    int nPos = pIter->nPos;
+    int iOff = pIter->iLeafOffset + pIter->nPos;
     while( iOff<pLeaf->n ){
       i64 iDelta;
 
       /* iOff is currently the offset of the start of position list data */
-      iOff += nPos;
       iOff += getVarint(&pLeaf->p[iOff], (u64*)&iDelta);
       if( iDelta==0 ) return;
 
       if( iOff<pLeaf->n ){
         int bDummy;
+        int nPos;
         iOff += fts5GetPoslistSize(&pLeaf->p[iOff], &nPos, &bDummy);
+        iOff += nPos;
       }
     }
   }
@@ -4492,8 +4492,6 @@ int sqlite3Fts5IndexIntegrityCheck(Fts5Index *p, u64 cksum){
         ** the index is disabled are the same. In both ASC and DESC order. */
         if( iIdx>0 && rc==SQLITE_OK ){
           int f = flags|FTS5INDEX_QUERY_TEST_NOIDX;
-static int nCall = 0;
-nCall++;
           ck2 = 0;
           rc = fts5QueryCksum(p, z, n, f, &ck2);
           if( rc==SQLITE_OK && ck1!=ck2 ) rc = FTS5_CORRUPT;
index 5066aafec8cf7b897359f09db7825215bcd051c6..a2d7a01cc038b90e990beb9d3276e21aea90477d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Begin\schanging\sfts5\sto\suse\sa\sdelete\sflag\sso\sthat\sdelete\smarkers\smay\sbe\sannihilated\smore\squickly.
-D 2015-04-14T20:15:41.831
+C Fix\sa\sproblem\spreventing\sdoclist\sindexes\sfrom\sbeing\sloaded.
+D 2015-04-15T16:01:42.421
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -112,7 +112,7 @@ F ext/fts5/fts5_buffer.c 3ba56cc6824c9f7b1e0695159e0a9c636f6b4a23
 F ext/fts5/fts5_config.c 0847facc8914f57ea4452c43ce109200dc65e894
 F ext/fts5/fts5_expr.c 5215137efab527577d36bdf9e44bfc2ec3e1be98
 F ext/fts5/fts5_hash.c 3cb5a3d04dd2030eb0ac8d544711dfd37c0e6529
-F ext/fts5/fts5_index.c ba7680d0c6b3f4772e1ac54676f6f65679c24a08
+F ext/fts5/fts5_index.c 9556d405a12a38b3e1a323333a2620813b9f323a
 F ext/fts5/fts5_storage.c ac0f0937059c8d4f38a1f13aa5f2c2cd7edf3e0d
 F ext/fts5/fts5_tcl.c 617b6bb96545be8d9045de6967c688cd9cd15541
 F ext/fts5/fts5_tokenize.c c07f2c2f749282c1dbbf46bde1f6d7095c740b8b
@@ -1292,7 +1292,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 bdb8e82ab683f2438cde9f0b63e497dbf0141dcf
-R 98bc774fac6611e41c6e4422cb947fd5
+P 9341c070bb6140dbf559680952909674aa83fa55
+R c6ba726746ea3bc47027dcf89fd1186f
 U dan
-Z 5d35832a61b13dbbe8195fefbe4221a8
+Z a5a728f32ef73ddd62455c44220623a7
index 0a948972b3d0ec1c89e62d70b17070403e5ecacd..fdf9afda57d87e17532b0cc8aeec452f50469173 100644 (file)
@@ -1 +1 @@
-9341c070bb6140dbf559680952909674aa83fa55
\ No newline at end of file
+b29109a083e5cd442cdd19f29d7be45b09c4f661
\ No newline at end of file