Snapshot of upstream SQLite 3.25.0
[sqlcipher.git] / ext / rbu / rbuB.test
blobc007fb7d9a25d4a3ebb1155145ed6f04183279ea
1 # 2014 August 30
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 #***********************************************************************
14 source [file join [file dirname [info script]] rbu_common.tcl]
15 set ::testprefix rbuB
17 db close
18 sqlite3_shutdown
19 test_sqlite3_log xLog
20 reset_db
22 proc xLog {args} { }
24 set db_sql {
25   CREATE TABLE t1(a PRIMARY KEY, b, c);
27 set rbu_sql {
28   CREATE TABLE data_t1(a, b, c, rbu_control);
29   INSERT INTO data_t1 VALUES(1, 2, 3, 0);
30   INSERT INTO data_t1 VALUES(4, 5, 6, 0);
31   INSERT INTO data_t1 VALUES(7, 8, 9, 0);
34 do_test 1.1 {
35   forcedelete rbu.db
36   sqlite3 rbu rbu.db
37   rbu eval $rbu_sql
38   rbu close
40   db eval $db_sql
41 } {}
43 set ::errlog [list]
44 proc xLog {err msg} { lappend ::errlog $err }
45 do_test 1.2 {
46   run_rbu test.db rbu.db
47 } {SQLITE_DONE}
49 do_test 1.3 {
50   set ::errlog
51 } {SQLITE_NOTICE_RECOVER_WAL SQLITE_INTERNAL}
53 do_execsql_test 1.4 {
54   SELECT * FROM t1
55 } {1 2 3 4 5 6 7 8 9}
57 db close
58 sqlite3_shutdown
59 test_sqlite3_log 
60 sqlite3_initialize
61 finish_test