/ Check-in [a49ee69e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:A proported fix for ticket #374. (CVS 1047)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a49ee69e98df80b479aa6bb97a9af9c6abf04e3f
User & Date: drh 2003-07-07 10:47:10
Context
2003-07-08
23:42
Enhance the C/C++ documentation to clarify the meaning of the return value from sqlite_changes(). Ticket #383. (CVS 1048) check-in: 303b2da1 user: drh tags: trunk
2003-07-07
10:47
A proported fix for ticket #374. (CVS 1047) check-in: a49ee69e user: drh tags: trunk
00:10
Update the NULL-handling document to show current behavior of OCELOT. (CVS 1046) check-in: 1d4c92c7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

    14     14   ** The pager is used to access a database disk file.  It implements
    15     15   ** atomic commit and rollback through the use of a journal file that
    16     16   ** is separate from the database file.  The pager also implements file
    17     17   ** locking to prevent two processes from writing the same database
    18     18   ** file simultaneously, or one process from reading the database while
    19     19   ** another is writing.
    20     20   **
    21         -** @(#) $Id: pager.c,v 1.85 2003/06/14 11:42:58 drh Exp $
           21  +** @(#) $Id: pager.c,v 1.86 2003/07/07 10:47:10 drh Exp $
    22     22   */
    23     23   #include "os.h"         /* Must be first to enable large file support */
    24     24   #include "sqliteInt.h"
    25     25   #include "pager.h"
    26     26   #include <assert.h>
    27     27   #include <string.h>
    28     28   
................................................................................
  1516   1516   ** write lock if anything goes wrong.
  1517   1517   */
  1518   1518   static int pager_open_journal(Pager *pPager){
  1519   1519     int rc;
  1520   1520     assert( pPager->state==SQLITE_WRITELOCK );
  1521   1521     assert( pPager->journalOpen==0 );
  1522   1522     assert( pPager->useJournal );
         1523  +  sqlitepager_pagecount(pPager);
  1523   1524     pPager->aInJournal = sqliteMalloc( pPager->dbSize/8 + 1 );
  1524   1525     if( pPager->aInJournal==0 ){
  1525   1526       sqliteOsReadLock(&pPager->fd);
  1526   1527       pPager->state = SQLITE_READLOCK;
  1527   1528       return SQLITE_NOMEM;
  1528   1529     }
  1529   1530     rc = sqliteOsOpenExclusive(pPager->zJournal, &pPager->jfd,pPager->tempFile);
................................................................................
  1535   1536       return SQLITE_CANTOPEN;
  1536   1537     }
  1537   1538     pPager->journalOpen = 1;
  1538   1539     pPager->journalStarted = 0;
  1539   1540     pPager->needSync = 0;
  1540   1541     pPager->alwaysRollback = 0;
  1541   1542     pPager->nRec = 0;
  1542         -  sqlitepager_pagecount(pPager);
  1543   1543     if( pPager->errMask!=0 ){
  1544   1544       rc = pager_errcode(pPager);
  1545   1545       return rc;
  1546   1546     }
  1547   1547     pPager->origDbSize = pPager->dbSize;
  1548   1548     if( journal_format==JOURNAL_FORMAT_3 ){
  1549   1549       rc = sqliteOsWrite(&pPager->jfd, aJournalMagic3, sizeof(aJournalMagic3));