-C Correctly\shandle\sthe\sobscure\scase\sof\sa\sread-only\shot-journal\sfile.\s(CVS\s3791)
-D 2007-04-02T11:08:59
+C If\san\sIO\serror\sis\sencountered\son\sa\scommit,\sclose\sthe\sjournal\sso\sthat\sit\npersists\sand\scan\s(hopefully)\srollback\sthe\sfailed\stransaction\slater.\s(CVS\s3792)
+D 2007-04-02T11:22:22
F Makefile.in 2f2c3bf69faf0ae7b8e8af4f94f1986849034530
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c c9a99524d6b2bdec636264cad1b67553925e3309
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
-F src/pager.c 0583079cb746f96702b7351b0cda346be4c02da8
+F src/pager.c 30e4a54e4ce9817839043eaa8968aace95f73ed9
F src/pager.h e79a24cf200b8771366217f5bca414f5b7823f42
F src/parse.y 207ab04273ae13aa4a729b96008d294d5f334ab3
F src/pragma.c 3b992b5b2640d6ae25cef05aa6a42cd1d6c43234
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P ba0538a4977aefd6645554f1989f0a98b540b9cd
-R fe59b9bdc90ed7270cae7cde15f7b2a0
-U danielk1977
-Z 614d37969660406bc4f5f28fc9575c7e
+P 4d8c6bf44ec00ec04e615983cb33425ca2c3998a
+R b60be37f8194d17dcc865a186ba19df6
+U drh
+Z 36541dd9060dc60ff27a9aed65ba02c4
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.315 2007/04/02 11:08:59 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.316 2007/04/02 11:22:22 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
pPager->stmtOpen = 0;
}
if( pPager->journalOpen ){
- if( pPager->exclusiveMode ){
- rc = sqlite3OsTruncate(pPager->jfd, 0);
+ if( pPager->exclusiveMode
+ && (rc = sqlite3OsTruncate(pPager->jfd, 0))==SQLITE_OK ){;
sqlite3OsSeek(pPager->jfd, 0);
pPager->journalOff = 0;
pPager->journalStarted = 0;
}else{
sqlite3OsClose(&pPager->jfd);
pPager->journalOpen = 0;
- /* If this is a temporary pager file, then the journal file should
- ** have been configured as delete-on-close. Otherwise, it should still
- ** be in the file system. This pager still holds a RESERVED or greater
- ** lock on the database file, so there is no chance another process
- ** could create or remove a journal file.
- **
- ** These asserts are not valid for asynchronous I/O such as is found
- ** in async.test
- */
- /*assert( sqlite3OsFileExists(pPager->zJournal) || pPager->tempFile );*/
- /*assert( !sqlite3OsFileExists(pPager->zJournal) || !pPager->tempFile );*/
- if( !pPager->tempFile ){
+ if( rc==SQLITE_OK ){
rc = sqlite3OsDelete(pPager->zJournal);
}
}
failed_to_open_journal:
sqliteFree(pPager->aInJournal);
pPager->aInJournal = 0;
-#if 0
- if( rc==SQLITE_NOMEM ){
- /* If this was a malloc() failure, then we will not be closing the pager
- ** file. So delete any journal file we may have just created. Otherwise,
- ** the system will get confused, we have a read-lock on the file and a
- ** mysterious journal has appeared in the filesystem.
- */
- /* sqlite3OsDelete(pPager->zJournal); */
- }else{
- /* If we reset the pager here, we will delete pages out from under
- ** various cursors and will ultimately segfault. */
- /* pager_reset(pPager); */
- }
-#endif
return rc;
}