/ Check-in [9ed97a85]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add an ALWAYS on an always-true branch in wal.c. Fix the ANALYZE command so that it resets the "unordered" and "noskipscan" flags on indices when reloading the sqlite_stat1 table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9ed97a85feee6593faefa2b54cc4cf9a60f515f9
User & Date: drh 2014-11-19 14:05:41
Context
2014-11-19
14:31
Completely remove an assert() that had previously been commented out. check-in: 89b3c1c4 user: drh tags: trunk
14:05
Add an ALWAYS on an always-true branch in wal.c. Fix the ANALYZE command so that it resets the "unordered" and "noskipscan" flags on indices when reloading the sqlite_stat1 table. check-in: 9ed97a85 user: drh tags: trunk
2014-11-18
21:54
Adding the "noskipscan" token to an sqlite_stat1.stat field prevents an index for being used with the skip-scan algorithm. check-in: 4461bf04 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/analyze.c.

  1434   1434     int i;
  1435   1435     tRowcnt v;
  1436   1436   
  1437   1437   #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  1438   1438     if( z==0 ) z = "";
  1439   1439   #else
  1440   1440     assert( z!=0 );
         1441  +  pIndex->bUnordered = 0;
         1442  +  pIndex->noSkipScan = 0;
  1441   1443   #endif
  1442   1444     for(i=0; *z && i<nOut; i++){
  1443   1445       v = 0;
  1444   1446       while( (c=z[0])>='0' && c<='9' ){
  1445   1447         v = v*10 + c - '0';
  1446   1448         z++;
  1447   1449       }

Changes to src/wal.c.

  2502   2502     
  2503   2503       /* Restore the clients cache of the wal-index header to the state it
  2504   2504       ** was in before the client began writing to the database. 
  2505   2505       */
  2506   2506       memcpy(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr));
  2507   2507   
  2508   2508       for(iFrame=pWal->hdr.mxFrame+1; 
  2509         -        rc==SQLITE_OK && iFrame<=iMax; 
         2509  +        ALWAYS(rc==SQLITE_OK) && iFrame<=iMax; 
  2510   2510           iFrame++
  2511   2511       ){
  2512   2512         /* This call cannot fail. Unless the page for which the page number
  2513   2513         ** is passed as the second argument is (a) in the cache and 
  2514   2514         ** (b) has an outstanding reference, then xUndo is either a no-op
  2515   2515         ** (if (a) is false) or simply expels the page from the cache (if (b)
  2516   2516         ** is false).