1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Do not call pager_open_journal() from within PagerBegin() if the connection is in exclusive-access mode. It will be called from within PagerWrite() just as it is for non-exclusive mode anyway.

FossilOrigin-Name: cdf2c5c2dd2e4404ffb85a680d31307afea266eb
This commit is contained in:
dan
2010-06-30 04:36:03 +00:00
parent ba3cbf3d4b
commit 3ad5fd2502
3 changed files with 17 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
C Add\scoverage\stest\scases.\sHave\ssqlite3_backup_step()\stransform\sSQLITE_IOERR_NOMEM\sto\sSQLITE_NOMEM\sbefore\sreturning. C Do\snot\scall\spager_open_journal()\sfrom\swithin\sPagerBegin()\sif\sthe\sconnection\sis\sin\sexclusive-access\smode.\sIt\swill\sbe\scalled\sfrom\swithin\sPagerWrite()\sjust\sas\sit\sis\sfor\snon-exclusive\smode\sanyway.
D 2010-06-30T04:29:04 D 2010-06-30T04:36:03
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3 F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -156,7 +156,7 @@ F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f
F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19 F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19
F src/os_unix.c ec7c7f7ca224ce2ff58736eebf804b48a75f9946 F src/os_unix.c ec7c7f7ca224ce2ff58736eebf804b48a75f9946
F src/os_win.c 48f67798969ba983487fed5691059ade7fff2ef7 F src/os_win.c 48f67798969ba983487fed5691059ade7fff2ef7
F src/pager.c c7cf3aa7d9bdb4803bc65a35b1f714fe0a77f55e F src/pager.c 813d09dd66da03ea12cfa21d17eceec1bc3638f4
F src/pager.h 879fdde5a102d2f21a3135d6f647530b21c2796c F src/pager.h 879fdde5a102d2f21a3135d6f647530b21c2796c
F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e
F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07 F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07
@@ -828,7 +828,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 008513ee6115f8d6f4b4e1428c1c638282b971a3 P 5e19bc360e098ec06a72f4a86254d8e62e93ea57
R 4d038e637f507e57a7e7904b3d6eb6a6 R 5e5594cd4eb071b5b3230f1e0b49f110
U dan U dan
Z ec59b3b431545b36d61a7ff1dc492de7 Z 149f00e8d8a2d6c3e6c5decd2d696d30

View File

@@ -1 +1 @@
5e19bc360e098ec06a72f4a86254d8e62e93ea57 cdf2c5c2dd2e4404ffb85a680d31307afea266eb

View File

@@ -4634,30 +4634,19 @@ int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
** we might save the work of creating a file if the transaction ** we might save the work of creating a file if the transaction
** ends up being a no-op. ** ends up being a no-op.
*/ */
}else if( isOpen(pPager->jfd) && pPager->journalOff==0 ){
/* This happens when the pager was in exclusive-access mode the last if( rc!=SQLITE_OK ){
** time a (read or write) transaction was successfully concluded assert( !pPager->dbModified );
** by this connection. Instead of deleting the journal file it was /* Ignore any IO error that occurs within pager_end_transaction(). The
** kept open and either was truncated to 0 bytes or its header was ** purpose of this call is to reset the internal state of the pager
** overwritten with zeros. ** sub-system. It doesn't matter if the journal-file is not properly
*/ ** finalized at this point (since it is not a valid journal file anyway).
assert( pagerUseWal(pPager)==0 ); */
assert( pPager->nRec==0 ); pager_end_transaction(pPager, 0);
assert( pPager->dbOrigSize==0 ); }
assert( pPager->pInJournal==0 );
rc = pager_open_journal(pPager);
} }
PAGERTRACE(("TRANSACTION %d\n", PAGERID(pPager))); PAGERTRACE(("TRANSACTION %d\n", PAGERID(pPager)));
if( rc!=SQLITE_OK ){
assert( !pPager->dbModified );
/* Ignore any IO error that occurs within pager_end_transaction(). The
** purpose of this call is to reset the internal state of the pager
** sub-system. It doesn't matter if the journal-file is not properly
** finalized at this point (since it is not a valid journal file anyway).
*/
pager_end_transaction(pPager, 0);
}
return rc; return rc;
} }
@@ -4708,7 +4697,6 @@ static int pager_write(PgHdr *pPg){
** which means they have acquired the necessary locks but the rollback ** which means they have acquired the necessary locks but the rollback
** journal might not yet be open. ** journal might not yet be open.
*/ */
assert( pPager->state>PAGER_SHARED );
rc = sqlite3PagerBegin(pPager, 0, pPager->subjInMemory); rc = sqlite3PagerBegin(pPager, 0, pPager->subjInMemory);
if( rc!=SQLITE_OK ){ if( rc!=SQLITE_OK ){
return rc; return rc;