]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the ptrmapPageno() routine so that it works correctly for an input of 1.
authordrh <drh@noemail.net>
Sat, 21 Aug 2010 15:09:37 +0000 (15:09 +0000)
committerdrh <drh@noemail.net>
Sat, 21 Aug 2010 15:09:37 +0000 (15:09 +0000)
FossilOrigin-Name: 699a9bf28377f43f58c509878cce60cb906dbf48

manifest
manifest.uuid
src/btree.c

index 46e650350e6fed2530369ef8e6e697cc419db214..3d0ba1027a63487ea5d16dc1ad35c034dde38f89 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Do\snot\sallow\sa\sbackup\sto\schange\sthe\spage\ssize\sif\sa\scodec\sis\sin\suse.
-D 2010-08-20T15:32:21
+C Fix\sthe\sptrmapPageno()\sroutine\sso\sthat\sit\sworks\scorrectly\sfor\san\sinput\sof\s1.
+D 2010-08-21T15:09:37
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 543f91f24cd7fee774ecc0a61c19704c0c3e78fd
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -116,7 +116,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
 F src/backup.c 8ff0b7018df253c7f30d3f9702b0b16f19209d5c
 F src/bitvec.c af50f1c8c0ff54d6bdb7a80e2fceca5a93670bef
 F src/btmutex.c 96a12f50f7a17475155971a241d85ec5171573ff
-F src/btree.c 69942b33b4ed4e0cc9a36b18a288839293528267
+F src/btree.c 2dff4076d3c994dc1954ec7c1792febd49e13631
 F src/btree.h b4ba2fdf6b64c7c376bdfffa826af6b786b151d9
 F src/btreeInt.h 5b034ff54800046cc5870605d683ac1f9134bd99
 F src/build.c 0018d49629fc4807100c988dd191dd95e185bb38
@@ -848,14 +848,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 6a0cbb272c3f0c1dfdeed381ba92f2f2f16ae824
-R 4d947b2be8e528f5b1f57b6ae25bb254
+P 5523ecd32295c188e3bf5dbd57d92d2879461e32
+R dc568dd5438d0cab5b031335b05c73a5
 U drh
-Z a5dd11d4db14995185bd3cc381bc0177
+Z 4fafdd21c95475ac900afea2d119affc
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFMbqAJoxKgR168RlERAtWjAJsGkTB7PoEEAyEHc28sHL4Q6xG9XQCghnJH
-TrSCzzZw80Uns0M1vpEzqWw=
-=GSse
+iD8DBQFMb+w3oxKgR168RlERAu8pAJ9xUYJ2vVngElJD9AJ0FdpZF4d/kACaA0pc
+mVGOV+o62jEkChLiO5Bqu4Q=
+=8+AE
 -----END PGP SIGNATURE-----
index 607ea43f0777b18d9aa4cab6ca6d48994f1e2751..ca679bdeb95f89715593eb3640f82a34e47ba5bb 100644 (file)
@@ -1 +1 @@
-5523ecd32295c188e3bf5dbd57d92d2879461e32
\ No newline at end of file
+699a9bf28377f43f58c509878cce60cb906dbf48
\ No newline at end of file
index f6110a9110d8be6c46ef9201911791146b423c1b..83a0fed5fd9912d424ef7f6b32c8950e13260c0a 100644 (file)
@@ -730,11 +730,16 @@ int sqlite3BtreeCursorHasMoved(BtCursor *pCur, int *pHasMoved){
 ** Given a page number of a regular database page, return the page
 ** number for the pointer-map page that contains the entry for the
 ** input page number.
+**
+** Return 0 (not a valid page) for pgno==1 since there is
+** no pointer map associated with page 1.  The integrity_check logic
+** requires that ptrmapPageno(*,1)!=1.
 */
 static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){
   int nPagesPerMapPage;
   Pgno iPtrMap, ret;
   assert( sqlite3_mutex_held(pBt->mutex) );
+  if( pgno<2 ) return 0;
   nPagesPerMapPage = (pBt->usableSize/5)+1;
   iPtrMap = (pgno-2)/nPagesPerMapPage;
   ret = (iPtrMap*nPagesPerMapPage) + 2;