ddf4747053
FossilOrigin-Name: 1a08a836fa919524216a16faf5212eebc9ad788c9e15463b68b0576dfccd4387
43 lines
1020 B
Plaintext
43 lines
1020 B
Plaintext
# 2010 October 27
|
|
#
|
|
# 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.
|
|
#
|
|
#***********************************************************************
|
|
# Test that the FTS3 extension does not crash when it encounters a
|
|
# corrupt data structure on disk.
|
|
#
|
|
|
|
|
|
set testdir [file dirname $argv0]
|
|
source $testdir/tester.tcl
|
|
|
|
# If SQLITE_ENABLE_FTS3 is not defined, omit this file.
|
|
ifcapable !fts3 { finish_test ; return }
|
|
|
|
set ::testprefix fts3corrupt3
|
|
|
|
do_execsql_test 1.0 {
|
|
CREATE VIRTUAL TABLE t1 USING fts3;
|
|
BEGIN;
|
|
INSERT INTO t1 VALUES('one');
|
|
INSERT INTO t1 VALUES('one');
|
|
INSERT INTO t1 VALUES('one');
|
|
COMMIT;
|
|
}
|
|
do_execsql_test 1.1 {
|
|
SELECT quote(root) from t1_segdir;
|
|
} {X'00036F6E6509010200010200010200'}
|
|
do_execsql_test 1.2 {
|
|
UPDATE t1_segdir SET root = X'00036F6E650EFFFFFFFFFFFFFFFFFFFFFFFF0200';
|
|
}
|
|
do_catchsql_test 1.3 {
|
|
SELECT rowid FROM t1 WHERE t1 MATCH 'one'
|
|
} {0 -1}
|
|
|
|
|
|
|
|
|
|
finish_test
|