0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-12-01 17:23:42 +01:00
sqlite/test/fts1n.test
shess 443ecd036d Replicates http://www.sqlite.org/cvstrac/chngview?cn=4151 which
modified fts2:

Modify handling of SQLITE_SCHEMA in fts2 code. An SQLITE_SCHEMA error
may cause SQLite to reload the internal schema, deleting and
recreating v-table objects. So the sqlite3_vtab structure can be
deleted out from under a v-table implementation. (CVS 4183)

FossilOrigin-Name: f9020cffda02923ef45979bb447ec2e232086ad5
2007-07-25 00:38:05 +00:00

46 lines
1.3 KiB
Plaintext

# 2007 July 24
#
# 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 file implements regression tests for SQLite library. The focus
# of this script is testing the FTS1 module for errors in the handling
# of SQLITE_SCHEMA.
#
# $Id: fts1n.test,v 1.1 2007/07/25 00:38:06 shess Exp $
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# If SQLITE_ENABLE_FTS1 is not defined, omit this file.
ifcapable !fts1 {
finish_test
return
}
do_test fts1m-1.1 {
execsql {
CREATE VIRTUAL TABLE t1 USING fts1(a, b, c);
INSERT INTO t1(a, b, c) VALUES('one three four', 'one four', 'one two');
SELECT a, b, c FROM t1 WHERE c MATCH 'two';
}
} {{one three four} {one four} {one two}}
# This test was crashing at one point.
#
do_test fts1m-1.2 {
execsql {
SELECT a, b, c FROM t1 WHERE c MATCH 'two';
CREATE TABLE t3(a, b, c);
SELECT a, b, c FROM t1 WHERE c MATCH 'two';
}
} {{one three four} {one four} {one two} {one three four} {one four} {one two}}
finish_test