0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-29 00:12:23 +01:00
sqlite/test/fts3fault2.test

66 lines
1.5 KiB
Plaintext
Raw Normal View History

# 2011 February 3
#
# 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.
#
#***********************************************************************
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set ::testprefix fts3fault2
do_test 1.0 {
execsql {
CREATE VIRTUAL TABLE t1 USING fts4(x);
INSERT INTO t1 VALUES('a b c');
INSERT INTO t1 VALUES('c d e');
CREATE VIRTUAL TABLE terms USING fts4aux(t1);
}
faultsim_save_and_close
} {}
do_faultsim_test 1.1 -prep {
faultsim_restore_and_reopen
db eval {SELECT * FROM sqlite_master}
} -body {
execsql "CREATE VIRTUAL TABLE terms2 USING fts4aux(t1)"
} -test {
faultsim_test_result {0 {}}
}
do_faultsim_test 1.2 -prep {
faultsim_restore_and_reopen
db eval {SELECT * FROM sqlite_master}
} -body {
execsql "SELECT * FROM terms"
} -test {
faultsim_test_result {0 {a 1 1 b 1 1 c 2 2 d 1 1 e 1 1}}
}
do_faultsim_test 1.3 -prep {
faultsim_restore_and_reopen
db eval {SELECT * FROM sqlite_master}
} -body {
execsql "SELECT * FROM terms WHERE term>'a' AND TERM < 'd'"
} -test {
faultsim_test_result {0 {b 1 1 c 2 2}}
}
do_faultsim_test 1.4 -prep {
faultsim_restore_and_reopen
db eval {SELECT * FROM sqlite_master}
} -body {
execsql "SELECT * FROM terms WHERE term='c'"
} -test {
faultsim_test_result {0 {c 2 2}}
}
finish_test