interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / ext / rbu / rbuB.test

62 lines · 1269 bytes Raw Blame History
1# 2014 August 30
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
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.
9#
10#***********************************************************************
11#
12#
13
14source [file join [file dirname [info script]] rbu_common.tcl]
15if_no_rbu_support { finish_test ; return }
16set ::testprefix rbuB
17
18db close
19sqlite3_shutdown
20test_sqlite3_log xLog
21reset_db
22
23proc xLog {args} { }
24
25set db_sql {
26 CREATE TABLE t1(a PRIMARY KEY, b, c);
27}
28set rbu_sql {
29 CREATE TABLE data_t1(a, b, c, rbu_control);
30 INSERT INTO data_t1 VALUES(1, 2, 3, 0);
31 INSERT INTO data_t1 VALUES(4, 5, 6, 0);
32 INSERT INTO data_t1 VALUES(7, 8, 9, 0);
33}
34
35do_test 1.1 {
36 forcedelete rbu.db
37 sqlite3 rbu rbu.db
38 rbu eval $rbu_sql
39 rbu close
40
41 db eval $db_sql
42} {}
43
44set ::errlog [list]
45proc xLog {err msg} { lappend ::errlog $err }
46do_test 1.2 {
47 run_rbu test.db rbu.db
48} {SQLITE_DONE}
49
50do_test 1.3 {
51 set ::errlog
52} {SQLITE_NOTICE_RECOVER_WAL SQLITE_NOTICE_RBU}
53
54do_execsql_test 1.4 {
55 SELECT * FROM t1
56} {1 2 3 4 5 6 7 8 9}
57
58db close
59sqlite3_shutdown
60test_sqlite3_log
61sqlite3_initialize
62finish_test