2019-05-08 20:49:51 +02:00
|
|
|
# 2014 August 30
|
|
|
|
#
|
|
|
|
# The author disclaims copyright to this source code. In place of
|
|
|
|
# a legal notice, here is a blessing:
|
|
|
|
#
|
|
|
|
# May you do good and not evil.
|
|
|
|
# May you find forgiveness for yourself and forgive others.
|
|
|
|
# May you share freely, never taking more than you give.
|
|
|
|
#
|
|
|
|
#***********************************************************************
|
|
|
|
#
|
|
|
|
|
|
|
|
source [file join [file dirname [info script]] rbu_common.tcl]
|
|
|
|
set ::testprefix rbumisc
|
|
|
|
|
|
|
|
db close
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_uri 1
|
|
|
|
reset_db
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Ensure that RBU is not confused by oddly named tables in an RBU
|
|
|
|
# database.
|
|
|
|
#
|
|
|
|
do_execsql_test 1.0 {
|
|
|
|
CREATE TABLE x1(a, b, c INTEGER PRIMARY KEY);
|
|
|
|
}
|
|
|
|
do_test 1.1 {
|
|
|
|
forcedelete rbu.db
|
|
|
|
sqlite3 rbu rbu.db
|
|
|
|
rbu eval {
|
|
|
|
CREATE TABLE data_x1(a, b, c, rbu_control);
|
|
|
|
INSERT INTO data_x1 VALUES(1, 1, 1, 0);
|
|
|
|
INSERT INTO data_x1 VALUES(2, 2, 2, 0);
|
|
|
|
|
|
|
|
CREATE TABLE dat(a, b, c, rbu_control);
|
|
|
|
CREATE TABLE "data x1"(a, b, c, rbu_control);
|
|
|
|
CREATE TABLE datax1(a, b, c, rbu_control);
|
|
|
|
CREATE TABLE data_(a, b, c, rbu_control);
|
|
|
|
|
|
|
|
INSERT INTO "data x1" VALUES(3, 3, 3, 0);
|
|
|
|
INSERT INTO datax1 VALUES(3, 3, 3, 0);
|
|
|
|
INSERT INTO data_ VALUES(3, 3, 3, 0);
|
|
|
|
INSERT INTO dat VALUES(3, 3, 3, 0);
|
|
|
|
}
|
2019-05-08 23:14:48 +02:00
|
|
|
rbu close
|
2019-05-08 20:49:51 +02:00
|
|
|
} {}
|
|
|
|
|
|
|
|
do_test 1.2 {
|
|
|
|
step_rbu test.db rbu.db
|
|
|
|
db eval { SELECT * FROM x1 }
|
|
|
|
} {1 1 1 2 2 2}
|
|
|
|
|
2019-05-08 23:14:48 +02:00
|
|
|
do_test 1.3 {
|
|
|
|
db eval { DELETE FROM x1 }
|
|
|
|
sqlite3 rbu rbu.db
|
|
|
|
rbu eval { DELETE FROM rbu_state }
|
|
|
|
rbu close
|
|
|
|
step_rbu test.db rbu.db
|
|
|
|
db eval { SELECT * FROM x1 }
|
|
|
|
} {1 1 1 2 2 2}
|
|
|
|
|
|
|
|
do_test 1.4 {
|
|
|
|
db eval { DELETE FROM x1 }
|
|
|
|
sqlite3 rbu rbu.db
|
|
|
|
rbu eval { DELETE FROM rbu_state }
|
|
|
|
rbu close
|
|
|
|
|
|
|
|
sqlite3rbu rbu test.db rbu.db
|
|
|
|
rbu step
|
|
|
|
rbu step
|
|
|
|
rbu close
|
|
|
|
|
|
|
|
forcecopy test.db-oal test.db-wal
|
|
|
|
sqlite3rbu rbu test.db rbu.db
|
|
|
|
rbu step
|
|
|
|
list [catch { rbu close } msg] $msg
|
|
|
|
} {1 {SQLITE_ERROR - cannot update wal mode database}}
|
|
|
|
|
2019-05-08 20:49:51 +02:00
|
|
|
finish_test
|