3
# The author disclaims copyright to this source code.
5
#*************************************************************************
6
# This file implements regression tests for SQLite library. fts3
7
# DELETE handling assumed all fields were non-null. This was not
8
# the intention at all.
10
# $Id: fts3am.test,v 1.1 2007/08/20 17:38:42 shess Exp $
13
set testdir [file dirname $argv0]
14
source $testdir/tester.tcl
16
# If SQLITE_ENABLE_FTS3 is defined, omit this file.
23
CREATE VIRTUAL TABLE t1 USING fts3(col_a, col_b);
25
INSERT INTO t1(rowid, col_a, col_b) VALUES(1, 'testing', 'testing');
26
INSERT INTO t1(rowid, col_a, col_b) VALUES(2, 'only a', null);
27
INSERT INTO t1(rowid, col_a, col_b) VALUES(3, null, 'only b');
28
INSERT INTO t1(rowid, col_a, col_b) VALUES(4, null, null);
33
SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
39
DELETE FROM t1 WHERE rowid = 1;
40
SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
46
DELETE FROM t1 WHERE rowid = 2;
47
SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
53
DELETE FROM t1 WHERE rowid = 3;
54
SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
60
DELETE FROM t1 WHERE rowid = 4;
61
SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;