/ Check-in [5aa2bdb5]
Login

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

Overview
Comment:Add tests to walmode.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5aa2bdb502d70ccbc249a6b38b8a07b91c4ccd26
User & Date: dan 2010-07-08 06:22:26
Context
2010-07-08
09:44
Changes to test scripts so that the "inmemory_journal" permutation works with [ef126e775a]. check-in: f553c8ed user: dan tags: trunk
06:22
Add tests to walmode.test. check-in: 5aa2bdb5 user: dan tags: trunk
03:13
Changes to os_win.c to have it simulate IO errors like os_unix.c. check-in: 0d53da94 user: shaneh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/walmode.test.

   285    285         PRAGMA journal_mode = $mode;
   286    286         PRAGMA journal_mode = wal;
   287    287       "
   288    288     } [list $mode wal]
   289    289   }
   290    290   db close
   291    291   
          292  +#-------------------------------------------------------------------------
          293  +# Test the effect of a "PRAGMA journal_mode" command being the first 
          294  +# thing executed by a new connection. This means that the schema is not
          295  +# loaded when sqlite3_prepare_v2() is called to compile the statement.
          296  +#
   292    297   do_test walmode-7.0 {
   293    298     file delete -force test.db
   294    299     sqlite3 db test.db
   295    300     execsql {
   296    301       PRAGMA journal_mode = WAL;
   297    302       CREATE TABLE t1(a, b);
   298    303     }
................................................................................
   319    324     do_test walmode-7.$tn { 
   320    325       db close
   321    326       sqlite3 db test.db
   322    327       execsql $sql
   323    328     } $result
   324    329   }
   325    330   db close
          331  +
          332  +#-------------------------------------------------------------------------
          333  +# Test the effect of a "PRAGMA journal_mode" command on an attached 
          334  +# database.
          335  +#
          336  +faultsim_delete_and_reopen
          337  +do_execsql_test walmode-8.1 {
          338  +  CREATE TABLE t1(a, b);
          339  +  PRAGMA journal_mode = WAL;
          340  +  ATTACH 'test.db2' AS two;
          341  +  CREATE TABLE two.t2(a, b);
          342  +} {wal}
          343  +do_execsql_test walmode-8.2 { PRAGMA main.journal_mode }         {wal}
          344  +do_execsql_test walmode-8.3 { PRAGMA two.journal_mode  }         {wal}
          345  +do_execsql_test walmode-8.4 { PRAGMA two.journal_mode = DELETE } {delete}
          346  +
          347  +db close
          348  +sqlite3 db test.db
          349  +do_execsql_test walmode-8.5  { ATTACH 'test.db2' AS two }          {}
          350  +do_execsql_test walmode-8.6  { PRAGMA main.journal_mode }          {wal}
          351  +do_execsql_test walmode-8.7  { PRAGMA two.journal_mode  }          {delete}
          352  +do_execsql_test walmode-8.8  { INSERT INTO two.t2 DEFAULT VALUES } {}
          353  +do_execsql_test walmode-8.9  { PRAGMA two.journal_mode  }          {delete}
          354  +do_execsql_test walmode-8.10 { INSERT INTO t1 DEFAULT VALUES } {}
          355  +do_execsql_test walmode-8.11 { PRAGMA main.journal_mode  }         {wal}
          356  +do_execsql_test walmode-8.12 { PRAGMA journal_mode  }              {delete}
          357  +
          358  +db close
          359  +sqlite3 db test.db
          360  +do_execsql_test walmode-8.13 { PRAGMA journal_mode = WAL }         {wal}
          361  +do_execsql_test walmode-8.14 { ATTACH 'test.db2' AS two  }         {}
          362  +do_execsql_test walmode-8.15 { PRAGMA main.journal_mode  }         {wal}
          363  +do_execsql_test walmode-8.16 { PRAGMA two.journal_mode   }         {wal}
          364  +do_execsql_test walmode-8.17 { INSERT INTO two.t2 DEFAULT VALUES } {}
          365  +do_execsql_test walmode-8.18 { PRAGMA two.journal_mode   }         {wal}
          366  + 
          367  +sqlite3 db2 test.db2
          368  +do_test walmode-8.19 { execsql { PRAGMA main.journal_mode } db2 }  {wal}
          369  +db2 close
   326    370   
   327    371   finish_test
          372  +