3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # This file contains tests for the RBU module. More specifically, it
13 # contains tests to ensure that it is an error to attempt to update
14 # a wal mode database via RBU.
17 if {![info exists testdir]} {
18 set testdir [file join [file dirname [info script]] .. .. test]
20 source $testdir/tester.tcl
24 CREATE TABLE t1(a PRIMARY KEY, b, c);
27 CREATE TABLE data_t1(a, b, c, rbu_control);
28 INSERT INTO data_t1 VALUES(1, 2, 3, 0);
29 INSERT INTO data_t1 VALUES(4, 5, 6, 0);
30 INSERT INTO data_t1 VALUES(7, 8, 9, 0);
35 forcedelete test.db rbu.db
39 db eval { PRAGMA journal_mode = wal }
46 sqlite3rbu rbu test.db rbu.db
50 list [catch { rbu close } msg] $msg
51 } {1 {SQLITE_ERROR - cannot update wal mode database}}
54 forcedelete test.db rbu.db
64 sqlite3rbu rbu test.db rbu.db
71 db eval {PRAGMA journal_mode = wal}
73 sqlite3rbu rbu test.db rbu.db
78 list [catch { rbu close } msg] $msg
79 } {1 {SQLITE_ERROR - cannot update wal mode database}}