/ Check-in [c117f992]
Login

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

Overview
Comment:Add a NEVER macro around a test in btree.c that can not longer be true.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c117f99236a009778bb7878da464918554391f0a
User & Date: drh 2010-03-30 15:51:13
Context
2010-03-30
22:58
Continuing refinements to the filesize-in-header enhancement. check-in: 79e22b95 user: drh tags: trunk
15:51
Add a NEVER macro around a test in btree.c that can not longer be true. check-in: c117f992 user: drh tags: trunk
12:40
Do not crash when compiling an "INSERT INTO tbl DEFAULT VALUES" when tbl has either BEFORE or INSTEAD OF triggers attached to it. Ticket [f3162063fd]. check-in: ca359a3e user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  6878   6878   
  6879   6879       /* Update the pointer-map and meta-data with the new root-page number. */
  6880   6880       ptrmapPut(pBt, pgnoRoot, PTRMAP_ROOTPAGE, 0, &rc);
  6881   6881       if( rc ){
  6882   6882         releasePage(pRoot);
  6883   6883         return rc;
  6884   6884       }
         6885  +
         6886  +    /* When the new root page was allocated, page 1 was made writable in
         6887  +    ** order either to increase the database filesize, or to decrement the
         6888  +    ** freelist count.  Hence, the sqlite3BtreeUpdateMeta() call cannot fail.
         6889  +    */
         6890  +    assert( sqlite3PagerIswriteable(pBt->pPage1->pDbPage) );
  6885   6891       rc = sqlite3BtreeUpdateMeta(p, 4, pgnoRoot);
  6886         -    if( rc ){
         6892  +    if( NEVER(rc) ){
  6887   6893         releasePage(pRoot);
  6888   6894         return rc;
  6889   6895       }
  6890   6896   
  6891   6897     }else{
  6892   6898       rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
  6893   6899       if( rc ) return rc;