From: drh Date: Tue, 4 May 2010 18:50:40 +0000 (+0000) Subject: When sqlite3PagerPagecount() is called without any locks, always return X-Git-Tag: version-3.7.2~436 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7721b23e0a310c95e84088dab89494622e42087c;p=thirdparty%2Fsqlite.git When sqlite3PagerPagecount() is called without any locks, always return the physical file size, not the logical file size. FossilOrigin-Name: 4016b422286587beda7323052d27821adb1fed73 --- diff --git a/manifest b/manifest index d621b8811e..2054f3305d 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Be\ssure\sto\srelease\sall\swal-index\slocks\sbefore\sclosing\sthe\swal-index. -D 2010-05-04T17:38:42 +C When\ssqlite3PagerPagecount()\sis\scalled\swithout\sany\slocks,\salways\sreturn\nthe\sphysical\sfile\ssize,\snot\sthe\slogical\sfile\ssize. +D 2010-05-04T18:50:40 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in d83a0ffef3dcbfb08b410a6c6dd6c009ec9167fb F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -155,7 +155,7 @@ F src/os_common.h 0d6ee583b6ee3185eb9d951f890c6dd03021a08d F src/os_os2.c 8ad77a418630d7dee91d1bb04f79c2096301d3a0 F src/os_unix.c 7ab8d2fe59954dca619af3e1bbd4789f5032fece F src/os_win.c a8fc01d8483be472e495793c01064fd87e56a5c1 -F src/pager.c f030536592582d29a761b75988f409c894c37d5e +F src/pager.c 224df6ad5f8c1fed238570092199db1e57233779 F src/pager.h 934b598583a9d936bb13c37d62a2fe68ac48781c F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e F src/pcache.c ace8f6a5ecd4711cc66a1b23053be7109bd437cf @@ -812,14 +812,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 8f9d22d58c75ad7476c1eea8ba296347e30b7beb -R 8fbb8b98c2b4c7e4e790d9b614444182 +P b15b67fa14ff77963f470678ff6188c63be8e079 +R 90a516a40aed68998882df9ec8564c82 U drh -Z cd1e036df5c7f4b84b82fa991fe96193 +Z a30cf60f66607a4454bb94232875c47b -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFL4FuloxKgR168RlERAuGdAKCKxpQuBFvFj5bt0Vv1gj+o6sGfqQCfZXDE -c8UJveZgjNHF+6e0sDdZ4FI= -=CRPz +iD8DBQFL4GyCoxKgR168RlERAqJFAJ40lJ/yFBAWE6VloZv7iEujVoKLPQCeMvkL +ZkjLFoOe5DHk4e/ITO6H6WY= +=5Otc -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 2727209520..a9c8773bd1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b15b67fa14ff77963f470678ff6188c63be8e079 \ No newline at end of file +4016b422286587beda7323052d27821adb1fed73 \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 7f0e4f7fe9..8d126144fd 100644 --- a/src/pager.c +++ b/src/pager.c @@ -2785,8 +2785,10 @@ int sqlite3PagerMaxPageCount(Pager *pPager, int mxPage){ if( mxPage>0 ){ pPager->mxPgno = mxPage; } - sqlite3PagerPagecount(pPager, &nPage); - assert( pPager->mxPgno>=nPage ); + if( pPager->state!=PAGER_UNLOCK ){ + sqlite3PagerPagecount(pPager, &nPage); + assert( pPager->mxPgno>=nPage ); + } return pPager->mxPgno; } @@ -2876,7 +2878,7 @@ int sqlite3PagerPagecount(Pager *pPager, int *pnPage){ int rc; /* Error returned by OsFileSize() */ i64 n = 0; /* File size in bytes returned by OsFileSize() */ - if( pagerUseWal(pPager) ){ + if( pagerUseWal(pPager) && pPager->state!=PAGER_UNLOCK ){ sqlite3WalDbsize(pPager->pWal, &nPage); }