3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # This file contains tests for the content= and content_rowid= options.
15 source [file join [file dirname [info script]] fts5_common.tcl]
16 set testprefix fts5contentless5
18 # If SQLITE_ENABLE_FTS5 is defined, omit this file.
25 CREATE VIRTUAL TABLE t1 USING fts5(a, b, c, content='', contentless_delete=1);
26 INSERT INTO t1 VALUES('A', 'B', 'C');
27 INSERT INTO t1 VALUES('D', 'E', 'F');
28 INSERT INTO t1 VALUES('G', 'H', 'I');
31 do_execsql_test 1.01 {
32 CREATE TABLE t2(x, y);
33 INSERT INTO t2 VALUES('x', 'y');
36 # explain_i "UPDATE t1 SET a='a' WHERE t1.rowid=1"
38 explain_i "UPDATE t1 SET a='a' FROM t2 WHERE t1.rowid=1 AND b IS NULL"
41 #explain_i "UPDATE t1 SET a='a' WHERE b IS NULL AND rowid=?"
44 1 "UPDATE t1 SET a='a', b='b', c='c' WHERE rowid=1" 0
45 2 "UPDATE t1 SET a='a', b='b' WHERE rowid=1" 1
46 3 "UPDATE t1 SET b='b', c='c' WHERE rowid=1" 1
47 4 "UPDATE t1 SET a='a', c='c' WHERE rowid=1" 1
48 5 "UPDATE t1 SET a='a', c='c' WHERE t1.rowid=1 AND b IS NULL" 1
49 6 "UPDATE t1 SET a='a' FROM t2 WHERE t1.rowid=1" 1
50 7 "UPDATE t1 SET a='a', b='b', c='c' FROM t2 WHERE t1.rowid=1" 0
54 set res(1) {1 {cannot UPDATE a subset of columns on fts5 contentless-delete table: t1}}
55 do_catchsql_test 1.$tn $up $res($err)