/ Check-in [1c2f0f84]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Remove an always-true conditional. Replace it with an assert().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1c2f0f8477bcf251fe874a2cfae4d7a403cb88ff
User & Date: drh 2011-04-09 17:53:30
Context
2011-04-09
19:17
Add test file unordered.test. check-in: f346dae1 user: dan tags: trunk
18:13
Pull all the latest trunk changes into the apple-osx branch. check-in: 4eaef4ad user: drh tags: apple-osx
18:07
Merge the latest trunk changes into the sessions branch. check-in: 83705e90 user: drh tags: sessions
17:53
Remove an always-true conditional. Replace it with an assert(). check-in: 1c2f0f84 user: drh tags: trunk
17:32
Add VerifyCookie instructions to "DROP XXX IF EXISTS" statements if the specified database object does not exist when the statement is prepared. check-in: a46f3290 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/backup.c.

619
620
621
622
623
624
625

626
627
628
629
630
631
632
633
634
635
    assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
    if( !isFatalError(p->rc) && iPage<p->iNext ){
      /* The backup process p has already copied page iPage. But now it
      ** has been modified by a transaction on the source pager. Copy
      ** the new data into the backup.
      */
      int rc;

      if( p->pDestDb ) sqlite3_mutex_enter(p->pDestDb->mutex);
      rc = backupOnePage(p, iPage, aData);
      if( p->pDestDb ) sqlite3_mutex_leave(p->pDestDb->mutex);
      assert( rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED );
      if( rc!=SQLITE_OK ){
        p->rc = rc;
      }
    }
  }
}







>
|

|







619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
    assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
    if( !isFatalError(p->rc) && iPage<p->iNext ){
      /* The backup process p has already copied page iPage. But now it
      ** has been modified by a transaction on the source pager. Copy
      ** the new data into the backup.
      */
      int rc;
      assert( p->pDestDb );
      sqlite3_mutex_enter(p->pDestDb->mutex);
      rc = backupOnePage(p, iPage, aData);
      sqlite3_mutex_leave(p->pDestDb->mutex);
      assert( rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED );
      if( rc!=SQLITE_OK ){
        p->rc = rc;
      }
    }
  }
}