mirror of
https://github.com/sqlite/sqlite.git
synced 2024-11-25 08:59:33 +01:00
a3d4d7a0ae
FossilOrigin-Name: 92f018698a87ed32acc31d83f7246dbb7295867bd6a801b7984a16f97a5c7786
57 lines
1.3 KiB
Plaintext
57 lines
1.3 KiB
Plaintext
# 2016 October 21
|
|
#
|
|
# 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.
|
|
#
|
|
#***********************************************************************
|
|
#
|
|
# This test file focuses on interactions between RBU and the feature
|
|
# enabled by SQLITE_DIRECT_OVERFLOW_READ - Direct Overflow Read.
|
|
#
|
|
|
|
source [file join [file dirname [info script]] rbu_common.tcl]
|
|
if_no_rbu_support { finish_test ; return }
|
|
set ::testprefix rbudor
|
|
|
|
set bigA [string repeat a 5000]
|
|
set bigB [string repeat b 5000]
|
|
do_execsql_test 1.0 {
|
|
PRAGMA page_size = 1024;
|
|
CREATE TABLE t1(a INTEGER PRIMARY KEY, b BLOB);
|
|
INSERT INTO t1 VALUES(1, $bigA);
|
|
} {}
|
|
|
|
do_test 1.1 {
|
|
forcedelete rbu.db
|
|
sqlite3 rbu rbu.db
|
|
rbu eval {
|
|
CREATE TABLE data_t1(a, b, rbu_control);
|
|
INSERT INTO data_t1 VALUES(2, $bigB, 0);
|
|
}
|
|
rbu close
|
|
} {}
|
|
|
|
do_test 1.2 {
|
|
sqlite3rbu rbu test.db rbu.db
|
|
while {[rbu state]!="checkpoint"} {
|
|
rbu step
|
|
}
|
|
rbu step
|
|
db eval { SELECT * FROM t1 }
|
|
} [list 1 $bigA 2 $bigB]
|
|
|
|
do_test 1.3 {
|
|
while {[rbu step]=="SQLITE_OK"} {}
|
|
rbu close
|
|
} {SQLITE_DONE}
|
|
|
|
do_execsql_test 1.4 {
|
|
SELECT * FROM t1
|
|
} [list 1 $bigA 2 $bigB]
|
|
|
|
finish_test
|