/ Check-in [bc110117]
Login

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

Overview
Comment:When a write transaction fails to being because the database is read-only, fail right away. Do not give the error code an opportunity to be overwritten with SQLITE_OK. Ticket [5ee23731f15].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:bc1101179abb4577417c971a7e4fbacde50e19a2
User & Date: drh 2009-10-13 15:36:52
References
2009-10-13
15:44 Fixed ticket [5ee23731]: assert() failure (or invalid error code) caused by opening statement transaction on read-only database with active read statements plus 3 other changes artifact: b7a954b4 user: drh
Context
2009-10-13
15:42
Add a test case to verify that ticket [5ee23731f15] has been fixed. check-in: f894ebf8 user: drh tags: trunk
15:36
When a write transaction fails to being because the database is read-only, fail right away. Do not give the error code an opportunity to be overwritten with SQLITE_OK. Ticket [5ee23731f15]. check-in: bc110117 user: drh tags: trunk
13:08
Suppress some harmless compiler warnings. check-in: 5d381daa user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
  if( pBt ){
    rc = sqlite3BtreeBeginTrans(pBt, pOp->p2);
    if( rc==SQLITE_BUSY ){
      p->pc = pc;
      p->rc = rc = SQLITE_BUSY;
      goto vdbe_return;
    }
    if( rc!=SQLITE_OK && rc!=SQLITE_READONLY /* && rc!=SQLITE_BUSY */ ){
      goto abort_due_to_error;
    }

    if( pOp->p2 && p->usesStmtJournal 
     && (db->autoCommit==0 || db->activeVdbeCnt>1) 
    ){
      assert( sqlite3BtreeIsInTrans(pBt) );







|







2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
  if( pBt ){
    rc = sqlite3BtreeBeginTrans(pBt, pOp->p2);
    if( rc==SQLITE_BUSY ){
      p->pc = pc;
      p->rc = rc = SQLITE_BUSY;
      goto vdbe_return;
    }
    if( rc!=SQLITE_OK ){
      goto abort_due_to_error;
    }

    if( pOp->p2 && p->usesStmtJournal 
     && (db->autoCommit==0 || db->activeVdbeCnt>1) 
    ){
      assert( sqlite3BtreeIsInTrans(pBt) );