Begin adding query support to fts5.

FossilOrigin-Name: 47a9f3cc92deefe163108e3507bd4614bf1f5da7
This commit is contained in:
dan
2014-06-25 20:28:38 +00:00
parent d0bfb36a08
commit 22d43ec4e8
9 changed files with 539 additions and 150 deletions
+20
View File
@@ -54,4 +54,24 @@ do_execsql_test 1.6 {
SELECT * FROM t1 WHERE rowid=1.99;
} {}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 2.1 {
CREATE VIRTUAL TABLE t1 USING fts5(x);
INSERT INTO t1 VALUES('one');
INSERT INTO t1 VALUES('two');
INSERT INTO t1 VALUES('three');
}
do_catchsql_test 2.2 {
SELECT rowid, * FROM t1 WHERE t1 MATCH 'AND AND'
} {1 {fts5: syntax error near "AND"}}
do_execsql_test 2.3 { SELECT rowid, * FROM t1 WHERE t1 MATCH 'two' } {2 two}
do_execsql_test 2.4 { SELECT rowid, * FROM t1 WHERE t1 MATCH 'three' } {3 three}
do_execsql_test 2.5 { SELECT rowid, * FROM t1 WHERE t1 MATCH 'one' } {1 one}
finish_test
+6 -6
View File
@@ -56,12 +56,12 @@ foreach {tn expr res} {
breakpoint
foreach {tn expr err} {
1 {AND} {syntax error near "AND"}
2 {abc def AND} {syntax error near ""}
3 {abc OR AND} {syntax error near "AND"}
4 {(a OR b) abc} {syntax error near "abc"}
5 {NEaR (a b)} {syntax error near "NEaR"}
6 {(a OR b) NOT c)} {syntax error near ")"}
1 {AND} {fts5: syntax error near "AND"}
2 {abc def AND} {fts5: syntax error near ""}
3 {abc OR AND} {fts5: syntax error near "AND"}
4 {(a OR b) abc} {fts5: syntax error near "abc"}
5 {NEaR (a b)} {fts5: syntax error near "NEaR"}
6 {(a OR b) NOT c)} {fts5: syntax error near ")"}
7 {nosuch: a nosuch2: b} {no such column: nosuch}
8 {addr: a nosuch2: b} {no such column: nosuch2}
} {
+6
View File
@@ -222,6 +222,12 @@ test_suite "fts3" -prefix "" -description {
fts4growth.test fts4growth2.test
}
test_suite "fts5" -prefix "" -description {
All FTS5 tests.
} -files {
fts5aa.test fts5ab.test fts5ea.test
}
test_suite "nofaultsim" -prefix "" -description {
"Very" quick test suite. Runs in less than 5 minutes on a workstation.
This test suite is the same as the "quick" tests, except that some files