xref: /sqlite-3.40.0/test/pager3.test (revision 69aedc8d)
111f47a9bSdan# 2010 June 15
211f47a9bSdan#
311f47a9bSdan# The author disclaims copyright to this source code.  In place of
411f47a9bSdan# a legal notice, here is a blessing:
511f47a9bSdan#
611f47a9bSdan#    May you do good and not evil.
711f47a9bSdan#    May you find forgiveness for yourself and forgive others.
811f47a9bSdan#    May you share freely, never taking more than you give.
911f47a9bSdan#
1011f47a9bSdan#***********************************************************************
1111f47a9bSdan#
1211f47a9bSdan
1311f47a9bSdanset testdir [file dirname $argv0]
1411f47a9bSdansource $testdir/tester.tcl
1511f47a9bSdansource $testdir/lock_common.tcl
1611f47a9bSdansource $testdir/malloc_common.tcl
1711f47a9bSdansource $testdir/wal_common.tcl
1811f47a9bSdan
19*69aedc8dSdanif {[atomic_batch_write test.db]} {
20*69aedc8dSdan  finish_test
21*69aedc8dSdan  return
22*69aedc8dSdan}
2311f47a9bSdan
2411f47a9bSdanforeach {tn sql res j} {
2511f47a9bSdan  1 "PRAGMA journal_mode = DELETE"  delete        0
2611f47a9bSdan  2 "CREATE TABLE t1(a, b)"         {}            0
2711f47a9bSdan  3 "PRAGMA locking_mode=EXCLUSIVE" {exclusive}   0
2811f47a9bSdan  4 "INSERT INTO t1 VALUES(1, 2)"   {}            1
2911f47a9bSdan  5 "PRAGMA locking_mode=NORMAL"    {normal}      1
3011f47a9bSdan  6 "SELECT * FROM t1"              {1 2}         0
3111f47a9bSdan} {
3211f47a9bSdan  do_execsql_test pager3-1.$tn.1 $sql $res
3311f47a9bSdan  do_test         pager3-1.$tn.2 { file exists test.db-journal } $j
3411f47a9bSdan}
3511f47a9bSdan
3611f47a9bSdan
3711f47a9bSdanfinish_test
38