Improved database corruption detection in the dbstat virtual table.

FossilOrigin-Name: fc5ecc88f8a0855ba90039177ee284721b2035e4de56a1024e323216f011f0af
This commit is contained in:
drh 2019-01-09 11:19:41 +00:00
parent 3e08ba4521
commit 8eaf565feb
3 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Small\ssimplification\sto\sthe\sdbstat\svirtual\stable.
D 2019-01-09T11:06:03.627
C Improved\sdatabase\scorruption\sdetection\sin\sthe\sdbstat\svirtual\stable.
D 2019-01-09T11:19:41.490
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in d8b254f8bb81bab43c340d70d17dc3babab40fcc8a348c8255881f780a45fee6
@ -462,7 +462,7 @@ F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/ctime.c 109e58d00f62e8e71ee1eb5944ac18b90171c928ab2e082e058056e1137cc20b
F src/date.c ebe1dc7c8a347117bb02570f1a931c62dd78f4a2b1b516f4837d45b7d6426957
F src/dbpage.c 135eb3b5e74f9ef74bde5cec2571192c90c86984fa534c88bf4a055076fa19b7
F src/dbstat.c 71f0bb9c38eac48812ed32cf926a6a41bf5d7f285740a2dcf5c3cbb67fbc2f1b
F src/dbstat.c c12833de69cb655751487d2c5a59607e36be1c58ba1f4bd536609909ad47b319
F src/delete.c 209cd8345b15d1843abeff2d91a6d9c765cf32ff4abcb24411c38fe08e18baab
F src/expr.c 9ad9c40a83c4218d79de19153b7a8ba7810564a123af7e09281927990bea2964
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
@ -1797,7 +1797,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P f09aa3248e2b4a32ff5b5d37084cb2a27445322cb06a3354cef723f4f0b2cd34
R 904b5dbe2cf1d3f367b8019199e2bad4
P 9d4c156fa26f80bb8f88b6ad8f24520a15af296de9c110604f6bd42c257455a0
R 08f271c3d2a22f68d05d7a10015b5079
U drh
Z 7d313c98edbc8f55ad96808211d5313e
Z 03110852217ebc64011b15a7274dc701

View File

@ -1 +1 @@
9d4c156fa26f80bb8f88b6ad8f24520a15af296de9c110604f6bd42c257455a0
fc5ecc88f8a0855ba90039177ee284721b2035e4de56a1024e323216f011f0af

View File

@ -531,6 +531,10 @@ statNextRestart:
goto statNextRestart; /* Tail recursion */
}
pCsr->iPage++;
if( pCsr->iPage>=ArraySize(pCsr->aPage) ){
statResetCsr(pCsr);
return SQLITE_CORRUPT_BKPT;
}
assert( p==&pCsr->aPage[pCsr->iPage-1] );
if( p->iCell==p->nCell ){