/ Check-in [66c2fa08]
Login

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

Overview
Comment:This fixes a missed case in check-in (3866). Do not apply patch (3866) without also applying this patch. (CVS 3867)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 66c2fa0836089f360b1c3343df84b73e8d89b293
User & Date: drh 2007-04-24 17:35:59
Context
2007-04-25
11:28
Fix a bug in the sqlite3_changes() function reported on the mailing list. (CVS 3868) check-in: 58ea768c user: drh tags: trunk
2007-04-24
17:35
This fixes a missed case in check-in (3866). Do not apply patch (3866) without also applying this patch. (CVS 3867) check-in: 66c2fa08 user: drh tags: trunk
17:27
When the write_version flag in the database header is larger than what the library understands, make the database read-only. The old behavior was to make the database unreadable. (CVS 3866) check-in: 10648e99 user: drh 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.357 2007/04/24 17:27:51 drh Exp $
           12  +** $Id: btree.c,v 1.358 2007/04/24 17:35:59 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.
................................................................................
  2784   2784       }
  2785   2785     }
  2786   2786   
  2787   2787     if( pBt->pPage1==0 ){
  2788   2788       rc = lockBtreeWithRetry(p);
  2789   2789       if( rc!=SQLITE_OK ){
  2790   2790         return rc;
         2791  +    }
         2792  +    if( pBt->readOnly && wrFlag ){
         2793  +      return SQLITE_READONLY;
  2791   2794       }
  2792   2795     }
  2793   2796     pCur = sqliteMalloc( sizeof(*pCur) );
  2794   2797     if( pCur==0 ){
  2795   2798       rc = SQLITE_NOMEM;
  2796   2799       goto create_cursor_exception;
  2797   2800     }