/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to test/walmode.test.

285
286
287
288
289
290
291





292
293
294
295
296
297
298
...
319
320
321
322
323
324
325
326







































327

      PRAGMA journal_mode = $mode;
      PRAGMA journal_mode = wal;
    "
  } [list $mode wal]
}
db close






do_test walmode-7.0 {
  file delete -force test.db
  sqlite3 db test.db
  execsql {
    PRAGMA journal_mode = WAL;
    CREATE TABLE t1(a, b);
  }
................................................................................
  do_test walmode-7.$tn { 
    db close
    sqlite3 db test.db
    execsql $sql
  } $result
}
db close








































finish_test








>
>
>
>
>







 








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
...
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
      PRAGMA journal_mode = $mode;
      PRAGMA journal_mode = wal;
    "
  } [list $mode wal]
}
db close

#-------------------------------------------------------------------------
# Test the effect of a "PRAGMA journal_mode" command being the first 
# thing executed by a new connection. This means that the schema is not
# loaded when sqlite3_prepare_v2() is called to compile the statement.
#
do_test walmode-7.0 {
  file delete -force test.db
  sqlite3 db test.db
  execsql {
    PRAGMA journal_mode = WAL;
    CREATE TABLE t1(a, b);
  }
................................................................................
  do_test walmode-7.$tn { 
    db close
    sqlite3 db test.db
    execsql $sql
  } $result
}
db close

#-------------------------------------------------------------------------
# Test the effect of a "PRAGMA journal_mode" command on an attached 
# database.
#
faultsim_delete_and_reopen
do_execsql_test walmode-8.1 {
  CREATE TABLE t1(a, b);
  PRAGMA journal_mode = WAL;
  ATTACH 'test.db2' AS two;
  CREATE TABLE two.t2(a, b);
} {wal}
do_execsql_test walmode-8.2 { PRAGMA main.journal_mode }         {wal}
do_execsql_test walmode-8.3 { PRAGMA two.journal_mode  }         {wal}
do_execsql_test walmode-8.4 { PRAGMA two.journal_mode = DELETE } {delete}

db close
sqlite3 db test.db
do_execsql_test walmode-8.5  { ATTACH 'test.db2' AS two }          {}
do_execsql_test walmode-8.6  { PRAGMA main.journal_mode }          {wal}
do_execsql_test walmode-8.7  { PRAGMA two.journal_mode  }          {delete}
do_execsql_test walmode-8.8  { INSERT INTO two.t2 DEFAULT VALUES } {}
do_execsql_test walmode-8.9  { PRAGMA two.journal_mode  }          {delete}
do_execsql_test walmode-8.10 { INSERT INTO t1 DEFAULT VALUES } {}
do_execsql_test walmode-8.11 { PRAGMA main.journal_mode  }         {wal}
do_execsql_test walmode-8.12 { PRAGMA journal_mode  }              {delete}

db close
sqlite3 db test.db
do_execsql_test walmode-8.13 { PRAGMA journal_mode = WAL }         {wal}
do_execsql_test walmode-8.14 { ATTACH 'test.db2' AS two  }         {}
do_execsql_test walmode-8.15 { PRAGMA main.journal_mode  }         {wal}
do_execsql_test walmode-8.16 { PRAGMA two.journal_mode   }         {wal}
do_execsql_test walmode-8.17 { INSERT INTO two.t2 DEFAULT VALUES } {}
do_execsql_test walmode-8.18 { PRAGMA two.journal_mode   }         {wal}
 
sqlite3 db2 test.db2
do_test walmode-8.19 { execsql { PRAGMA main.journal_mode } db2 }  {wal}
db2 close

finish_test