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 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # This file implements tests to verify that ticket [bdc6bbbb38] has been
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
19 set testprefix tkt-bdc6bbbb38
21 # If SQLITE_ENABLE_FTS3 is defined, omit this file.
22 ifcapable !fts3 { finish_test ; return }
23 set sqlite_fts3_enable_parentheses 1
25 foreach {tn idxdir} {1 ASC 2 DESC} {
26 execsql { DROP TABLE IF EXISTS t2 }
28 do_execsql_test $tn.1.1 "CREATE VIRTUAL TABLE t2 USING fts4(x, order=$idxdir)"
29 do_execsql_test $tn.1.2 { INSERT INTO t2 VALUES('a b c') }
31 do_execsql_test $tn.1.3 {
32 SELECT offsets(t2) FROM t2 WHERE t2 MATCH 'a AND d OR b' ORDER BY docid ASC
36 do_execsql_test $tn.1.4 {
37 SELECT snippet(t2,'[',']') FROM t2 WHERE t2 MATCH 'a AND d OR b'
42 do_execsql_test $tn.1.5 { INSERT INTO t2 VALUES('a c d') }
43 do_execsql_test $tn.1.6 {
44 SELECT offsets(t2) FROM t2 WHERE t2 MATCH 'a AND d OR b' ORDER BY docid ASC
49 do_execsql_test $tn.1.7 {
50 SELECT snippet(t2,'[',']') FROM t2 WHERE t2 MATCH 'a AND d OR b'
57 execsql { DROP TABLE IF EXISTS t3 }
58 do_execsql_test $tn.2.1 "CREATE VIRTUAL TABLE t3 USING fts4(x, order=$idxdir)"
59 do_execsql_test $tn.2.2 { INSERT INTO t3 VALUES('a c d') }
60 do_execsql_test $tn.2.3 {
61 SELECT offsets(t3) FROM t3 WHERE t3 MATCH 'a AND d OR b' ORDER BY docid DESC
65 do_execsql_test $tn.2.4 {
66 SELECT snippet(t3,'[',']') FROM t3 WHERE t3 MATCH 'a AND d OR b'
71 do_execsql_test $tn.2.5 {
72 INSERT INTO t3 VALUES('a b c');
74 do_execsql_test $tn.2.6 {
75 SELECT offsets(t3) FROM t3 WHERE t3 MATCH 'a AND d OR b' ORDER BY docid DESC
80 do_execsql_test $tn.2.7 {
81 SELECT snippet(t3,'[',']') FROM t3 WHERE t3 MATCH 'a AND d OR b'
89 set sqlite_fts3_enable_parentheses 0