/ Check-in [278ed41e]
Login

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

Overview
Comment:Minor changes to test cases to account for the fact that databases with read/write versions of 2 are now understood.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wal
Files: files | file ages | folders
SHA1: 278ed41e1d4bbff9544cb2cf4cf52dbbcf0c17df
User & Date: dan 2010-04-21 06:19:13
Context
2010-04-21
11:43
If, after obtaining a SHARED lock, there exists a *-wal file in the file-system, use WAL mode. This is necessary to recover from a crash that damages the first page of the database file. check-in: 33cabf27 user: dan tags: wal
06:19
Minor changes to test cases to account for the fact that databases with read/write versions of 2 are now understood. check-in: 278ed41e user: dan tags: wal
2010-04-20
18:53
Use the read and write version fields of the database header to mark a database as operating in wal-mode. check-in: 96bef18c user: dan tags: wal
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

   819    819     void *pProfileArg;                        /* Argument to profile function */
   820    820     void *pCommitArg;                 /* Argument to xCommitCallback() */   
   821    821     int (*xCommitCallback)(void*);    /* Invoked at every commit. */
   822    822     void *pRollbackArg;               /* Argument to xRollbackCallback() */   
   823    823     void (*xRollbackCallback)(void*); /* Invoked at every commit. */
   824    824     void *pUpdateArg;
   825    825     void (*xUpdateCallback)(void*,int, const char*,const char*,sqlite_int64);
   826         -  int (*xLogCallback)(void *, sqlite3 *, const char *, u32);
          826  +  int (*xLogCallback)(void *, sqlite3 *, const char *, int);
   827    827     void *pLogArg;
   828    828     void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*);
   829    829     void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*);
   830    830     void *pCollNeededArg;
   831    831     sqlite3_value *pErr;          /* Most recent error message */
   832    832     char *zErrMsg;                /* Most recent error message (UTF-8 encoded) */
   833    833     char *zErrMsg16;              /* Most recent error message (UTF-16 encoded) */
................................................................................
  2988   2988   int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
  2989   2989   int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
  2990   2990   int sqlite3Reprepare(Vdbe*);
  2991   2991   void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
  2992   2992   CollSeq *sqlite3BinaryCompareCollSeq(Parse *, Expr *, Expr *);
  2993   2993   int sqlite3TempInMemory(const sqlite3*);
  2994   2994   VTable *sqlite3GetVTable(sqlite3*, Table*);
         2995  +const char *sqlite3JournalModename(int);
  2995   2996   
  2996   2997   /* Declarations for functions in fkey.c. All of these are replaced by
  2997   2998   ** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
  2998   2999   ** key functionality is available. If OMIT_TRIGGER is defined but
  2999   3000   ** OMIT_FOREIGN_KEY is not, only some of the functions are no-oped. In
  3000   3001   ** this case foreign keys are parsed, but no other functionality is 
  3001   3002   ** provided (enforcement of FK constraints requires the triggers sub-system).

Changes to test/corruptA.test.

    35     35   # is detected when opening the database file.
    36     36   #
    37     37   db close
    38     38   file copy -force test.db test.db-template
    39     39   
    40     40   do_test corruptA-2.1 {
    41     41     file copy -force test.db-template test.db
    42         -  hexio_write test.db 19 02   ;# the read format number
           42  +  hexio_write test.db 19 03   ;# the read format number
    43     43     sqlite3 db test.db
    44     44     catchsql {SELECT * FROM t1}  
    45     45   } {1 {file is encrypted or is not a database}}
    46     46    
    47     47   do_test corruptA-2.2 {
    48     48     db close
    49     49     file copy -force test.db-template test.db

Changes to test/rdonly.test.

    25     25     execsql {
    26     26       CREATE TABLE t1(x);
    27     27       INSERT INTO t1 VALUES(1);
    28     28       SELECT * FROM t1;
    29     29     }
    30     30   } {1}
    31     31   
    32         -# Changes the write version from 1 to 2.  Verify that the database
           32  +# Changes the write version from 1 to 3.  Verify that the database
    33     33   # can be read but not written.
    34     34   #
    35     35   do_test rdonly-1.2 {
    36     36     db close
    37     37     hexio_get_int [hexio_read test.db 18 1]
    38     38   } 1
    39     39   do_test rdonly-1.3 {
    40         -  hexio_write test.db 18 02
           40  +  hexio_write test.db 18 03
    41     41     sqlite3 db test.db
    42     42     execsql {
    43     43       SELECT * FROM t1;
    44     44     }
    45     45   } {1}
    46     46   do_test rdonly-1.4 {
    47     47     catchsql {
................................................................................
    64     64   
    65     65   # Now, after connection [db] has loaded the database schema, modify the
    66     66   # write-version of the file (and the change-counter, so that the 
    67     67   # write-version is reloaded). This way, SQLite does not discover that
    68     68   # the database is read-only until after it is locked.
    69     69   #
    70     70   do_test rdonly-1.6 {
    71         -  hexio_write test.db 18 02              ; # write-version
           71  +  hexio_write test.db 18 03              ; # write-version
    72     72     hexio_write test.db 24 11223344        ; # change-counter
    73     73     catchsql {
    74     74       INSERT INTO t1 VALUES(2);
    75     75     }
    76     76   } {1 {attempt to write a readonly database}}
    77     77   
    78     78   finish_test