/ Check-in [9a7d7e31]
Login

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

Overview
Comment:Comment changes in btree.c and added a missing "else" in pragma.c. (CVS 3757)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9a7d7e31908e9bac14a68bbc2fb4e1ca593ea234
User & Date: drh 2007-03-30 11:12:08
Context
2007-03-30
11:23
Remove the anonymous union from the sqlite3_value structure since some compilers are unable to deal with it. (CVS 3758) check-in: 6b995259 user: drh tags: trunk
11:12
Comment changes in btree.c and added a missing "else" in pragma.c. (CVS 3757) check-in: 9a7d7e31 user: drh tags: trunk
09:13
Test coverage a few extra lines in where.c. (CVS 3756) check-in: ea49ddf6 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btree.c,v 1.345 2007/03/29 05:51:49 drh Exp $
           12  +** $Id: btree.c,v 1.346 2007/03/30 11:12:08 drh Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** For a detailed discussion of BTrees, refer to
    16     16   **
    17     17   **     Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3:
    18     18   **     "Sorting And Searching", pages 473-480. Addison-Wesley
    19     19   **     Publishing Company, Reading, Massachusetts.
................................................................................
  2405   2405     }
  2406   2406     return rc;
  2407   2407   }
  2408   2408   #endif
  2409   2409   
  2410   2410   /*
  2411   2411   ** Commit the transaction currently in progress.
         2412  +**
         2413  +** This routine implements the second phase of a 2-phase commit.  The
         2414  +** sqlite3BtreeSync() routine does the first phase and should be invoked
         2415  +** prior to calling this routine.  The sqlite3BtreeSync() routine did
         2416  +** all the work of writing information out to disk and flushing the
         2417  +** contents so that they are written onto the disk platter.  All this
         2418  +** routine has to do is delete or truncate the rollback journal
         2419  +** (which causes the transaction to commit) and drop locks.
  2412   2420   **
  2413   2421   ** This will release the write lock on the database file.  If there
  2414   2422   ** are no active cursors, it also releases the read lock.
  2415   2423   */
  2416   2424   int sqlite3BtreeCommit(Btree *p){
  2417   2425     BtShared *pBt = p->pBt;
  2418   2426   
................................................................................
  6511   6519   ** Return non-zero if a read (or write) transaction is active.
  6512   6520   */
  6513   6521   int sqlite3BtreeIsInReadTrans(Btree *p){
  6514   6522     return (p && (p->inTrans!=TRANS_NONE));
  6515   6523   }
  6516   6524   
  6517   6525   /*
         6526  +** This routine does the first phase of a 2-phase commit.  This routine
         6527  +** causes a rollback journal to be created (if it does not already exist)
         6528  +** and populated with enough information so that if a power loss occurs
         6529  +** the database can be restored to its original state by playing back
         6530  +** the journal.  Then the contents of the journal are flushed out to
         6531  +** the disk.  After the journal is safely on oxide, the changes to the
         6532  +** database are written into the database file and flushed to oxide.
         6533  +** At the end of this call, the rollback journal still exists on the
         6534  +** disk and we are still holding all locks, so the transaction has not
         6535  +** committed.  See sqlite3BtreeCommit() for the second phase of the
         6536  +** commit process.
         6537  +**
  6518   6538   ** This call is a no-op if no write-transaction is currently active on pBt.
  6519   6539   **
  6520   6540   ** Otherwise, sync the database file for the btree pBt. zMaster points to
  6521   6541   ** the name of a master journal file that should be written into the
  6522   6542   ** individual journal file, or is NULL, indicating no master journal file 
  6523   6543   ** (single database transaction).
  6524   6544   **

Changes to src/pragma.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to implement the PRAGMA command.
    13     13   **
    14         -** $Id: pragma.c,v 1.130 2007/03/24 16:45:05 danielk1977 Exp $
           14  +** $Id: pragma.c,v 1.131 2007/03/30 11:12:08 drh Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   #include "os.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /* Ignore this whole file if pragmas are disabled
    21     21   */
................................................................................
   970    970         };
   971    971         int addr = sqlite3VdbeAddOpList(v, ArraySize(readCookie), readCookie);
   972    972         sqlite3VdbeChangeP1(v, addr, iDb);
   973    973         sqlite3VdbeChangeP2(v, addr, iCookie);
   974    974         sqlite3VdbeSetNumCols(v, 1);
   975    975         sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLeft, P3_TRANSIENT);
   976    976       }
   977         -  }
          977  +  }else
   978    978   #endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */
   979    979   
   980    980   #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
   981    981     /*
   982    982     ** Report the current state of file logs for all databases
   983    983     */
   984    984     if( sqlite3StrICmp(zLeft, "lock_status")==0 ){