Update trace2.test to account for new FTS queries.
FossilOrigin-Name: 2c20129297b64f4113b8edb551385eb918279471
This commit is contained in:
parent
2f77934385
commit
653265d9ed
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C Add\stests\sfor\sdeferred\stokens\sto\sfts3auto.test.\sFix\sa\sproblem\swith\sOR\squeries\sand\sdeferred\stokens.
|
C Update\strace2.test\sto\saccount\sfor\snew\sFTS\squeries.
|
||||||
D 2011-06-13T17:00:12.630
|
D 2011-06-13T18:21:11.056
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in c1d7a7f4fd8da6b1815032efca950e3d5125407e
|
F Makefile.in c1d7a7f4fd8da6b1815032efca950e3d5125407e
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@ -455,7 +455,7 @@ F test/fts3am.test 218aa6ba0dfc50c7c16b2022aac5c6be593d08d8
|
|||||||
F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18
|
F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18
|
||||||
F test/fts3ao.test b83f99f70e9eec85f27d75801a974b3f820e01f9
|
F test/fts3ao.test b83f99f70e9eec85f27d75801a974b3f820e01f9
|
||||||
F test/fts3atoken.test 402ef2f7c2fb4b3d4fa0587df6441c1447e799b3
|
F test/fts3atoken.test 402ef2f7c2fb4b3d4fa0587df6441c1447e799b3
|
||||||
F test/fts3auto.test bf01a1d793155d744d23e4092871ca116f1db64c
|
F test/fts3auto.test 0173f3fc3e03d66beb6dd65f7b99e7eb4ae2a27d
|
||||||
F test/fts3aux1.test 0b02743955d56fc0d4d66236a26177bd1b726de0
|
F test/fts3aux1.test 0b02743955d56fc0d4d66236a26177bd1b726de0
|
||||||
F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
|
F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
|
||||||
F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
|
F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
|
||||||
@ -821,7 +821,7 @@ F test/tkt3997.test a335fa41ca3985660a139df7b734a26ef53284bd
|
|||||||
F test/tkt4018.test 7c2c9ba4df489c676a0a7a0e809a1fb9b2185bd1
|
F test/tkt4018.test 7c2c9ba4df489c676a0a7a0e809a1fb9b2185bd1
|
||||||
F test/tokenize.test ce430a7aed48fc98301611429595883fdfcab5d7
|
F test/tokenize.test ce430a7aed48fc98301611429595883fdfcab5d7
|
||||||
F test/trace.test 4b36a41a3e9c7842151af6da5998f5080cdad9e5
|
F test/trace.test 4b36a41a3e9c7842151af6da5998f5080cdad9e5
|
||||||
F test/trace2.test 0ce11265c83333d8f5beeca19e71ed93a88d386c
|
F test/trace2.test 962175290996d5f06dc4402ca218bbfc7df4cb20
|
||||||
F test/trans.test 6e1b4c6a42dba31bd65f8fa5e61a2708e08ddde6
|
F test/trans.test 6e1b4c6a42dba31bd65f8fa5e61a2708e08ddde6
|
||||||
F test/trans2.test d5337e61de45e66b1fcbf9db833fa8c82e624b22
|
F test/trans2.test d5337e61de45e66b1fcbf9db833fa8c82e624b22
|
||||||
F test/trans3.test d728abaa318ca364dc370e06576aa7e5fbed7e97
|
F test/trans3.test d728abaa318ca364dc370e06576aa7e5fbed7e97
|
||||||
@ -945,7 +945,7 @@ F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
|
|||||||
F tool/symbols.sh bc2a3709940d47c8ac8e0a1fdf17ec801f015a00
|
F tool/symbols.sh bc2a3709940d47c8ac8e0a1fdf17ec801f015a00
|
||||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||||
F tool/warnings.sh 347d974d143cf132f953b565fbc03026f19fcb4d
|
F tool/warnings.sh 347d974d143cf132f953b565fbc03026f19fcb4d
|
||||||
P e4ab6cdb101bbeb804820425cf569ee7dc2397fb
|
P b9fb69e55bb05a8819688ee63987f2a05c33d59b
|
||||||
R 7fcdbf104822a42776783c2cd9e89101
|
R 4f421cd82a93c9e8973177e58e4c866f
|
||||||
U dan
|
U dan
|
||||||
Z 0999cf6b26be67f673d9db0918d86701
|
Z 2a2f406b9fac55b2e6e57d2ed45fc4da
|
||||||
|
@ -1 +1 @@
|
|||||||
b9fb69e55bb05a8819688ee63987f2a05c33d59b
|
2c20129297b64f4113b8edb551385eb918279471
|
@ -21,8 +21,62 @@ set sfep $sqlite_fts3_enable_parentheses
|
|||||||
set sqlite_fts3_enable_parentheses 1
|
set sqlite_fts3_enable_parentheses 1
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Start of Tcl procs used by tests.
|
# Start of Tcl infrastructure used by tests. The entry point is
|
||||||
|
# [do_fts3query_test] (described below).
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# do_fts3query_test TESTNAME ?OPTIONS? TABLE MATCHEXPR
|
||||||
|
#
|
||||||
|
# This proc runs several test cases on FTS3/4 table $TABLE using match
|
||||||
|
# expression $MATCHEXPR. All documents in $TABLE must be formatted so that
|
||||||
|
# they can be "tokenized" using the Tcl list commands (llength, lindex etc.).
|
||||||
|
# The name and column names used by $TABLE must not require any quoting or
|
||||||
|
# escaping when used in SQL statements.
|
||||||
|
#
|
||||||
|
# $MATCHINFO may be any expression accepted by the FTS4 MATCH operator,
|
||||||
|
# except that the "<column-name>:token" syntax is not supported. Tcl list
|
||||||
|
# commands are used to tokenize the expression. Any parenthesis must appear
|
||||||
|
# either as separate list elements, or as the first (for opening) or last
|
||||||
|
# (for closing) character of a list element. i.e. the expression "(a OR b)c"
|
||||||
|
# will not be parsed correctly, but "( a OR b) c" will.
|
||||||
|
#
|
||||||
|
set sqlite_fts3_enable_parentheses 1
|
||||||
|
proc do_fts3query_test {tn tbl expr} {
|
||||||
|
|
||||||
|
get_near_results $tbl $expr aMatchinfo
|
||||||
|
set match $expr
|
||||||
|
|
||||||
|
set matchinfo_asc [list]
|
||||||
|
foreach docid [lsort -integer -incr [array names aMatchinfo]] {
|
||||||
|
lappend matchinfo_asc $docid $aMatchinfo($docid)
|
||||||
|
}
|
||||||
|
set matchinfo_desc [list]
|
||||||
|
foreach docid [lsort -integer -decr [array names aMatchinfo]] {
|
||||||
|
lappend matchinfo_desc $docid $aMatchinfo($docid)
|
||||||
|
}
|
||||||
|
|
||||||
|
set title "(\"$match\" -> [llength [array names aMatchinfo]] rows)"
|
||||||
|
|
||||||
|
do_execsql_test $tn$title.1 "
|
||||||
|
SELECT docid FROM $tbl WHERE $tbl MATCH '$match' ORDER BY docid ASC
|
||||||
|
" [lsort -integer -incr [array names aMatchinfo]]
|
||||||
|
|
||||||
|
do_execsql_test $tn$title.2 "
|
||||||
|
SELECT docid FROM $tbl WHERE $tbl MATCH '$match' ORDER BY docid DESC
|
||||||
|
" [lsort -integer -decr [array names aMatchinfo]]
|
||||||
|
|
||||||
|
do_execsql_test $tn$title.3 "
|
||||||
|
SELECT docid, mit(matchinfo($tbl, 'x')) FROM $tbl
|
||||||
|
WHERE $tbl MATCH '$match' ORDER BY docid DESC
|
||||||
|
" $matchinfo_desc
|
||||||
|
|
||||||
|
do_execsql_test $tn$title.4 "
|
||||||
|
SELECT docid, mit(matchinfo($tbl, 'x')) FROM $tbl
|
||||||
|
WHERE $tbl MATCH '$match' ORDER BY docid ASC
|
||||||
|
" $matchinfo_asc
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
proc mit {blob} {
|
proc mit {blob} {
|
||||||
set scan(littleEndian) i*
|
set scan(littleEndian) i*
|
||||||
set scan(bigEndian) I*
|
set scan(bigEndian) I*
|
||||||
@ -252,41 +306,6 @@ proc get_near_results {tbl expr arrayvar {nullvar ""}} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc do_fts3query_test {tn tbl expr} {
|
|
||||||
|
|
||||||
get_near_results $tbl $expr aMatchinfo
|
|
||||||
set match $expr
|
|
||||||
|
|
||||||
set matchinfo_asc [list]
|
|
||||||
foreach docid [lsort -integer -incr [array names aMatchinfo]] {
|
|
||||||
lappend matchinfo_asc $docid $aMatchinfo($docid)
|
|
||||||
}
|
|
||||||
set matchinfo_desc [list]
|
|
||||||
foreach docid [lsort -integer -decr [array names aMatchinfo]] {
|
|
||||||
lappend matchinfo_desc $docid $aMatchinfo($docid)
|
|
||||||
}
|
|
||||||
|
|
||||||
set title "(\"$match\" -> [llength [array names aMatchinfo]] rows)"
|
|
||||||
|
|
||||||
do_execsql_test $tn$title.1 "
|
|
||||||
SELECT docid FROM $tbl WHERE $tbl MATCH '$match' ORDER BY docid ASC
|
|
||||||
" [lsort -integer -incr [array names aMatchinfo]]
|
|
||||||
|
|
||||||
do_execsql_test $tn$title.2 "
|
|
||||||
SELECT docid FROM $tbl WHERE $tbl MATCH '$match' ORDER BY docid DESC
|
|
||||||
" [lsort -integer -decr [array names aMatchinfo]]
|
|
||||||
|
|
||||||
do_execsql_test $tn$title.3 "
|
|
||||||
SELECT docid, mit(matchinfo($tbl, 'x')) FROM $tbl
|
|
||||||
WHERE $tbl MATCH '$match' ORDER BY docid DESC
|
|
||||||
" $matchinfo_desc
|
|
||||||
|
|
||||||
do_execsql_test $tn$title.4 "
|
|
||||||
SELECT docid, mit(matchinfo($tbl, 'x')) FROM $tbl
|
|
||||||
WHERE $tbl MATCH '$match' ORDER BY docid ASC
|
|
||||||
" $matchinfo_asc
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# End of test procs. Actual tests are below this line.
|
# End of test procs. Actual tests are below this line.
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
@ -329,7 +348,6 @@ foreach {tn create} {
|
|||||||
5 "fts4(a, b, order=DESC, prefix=1)"
|
5 "fts4(a, b, order=DESC, prefix=1)"
|
||||||
6 "fts4(a, b, order=ASC, prefix=1)"
|
6 "fts4(a, b, order=ASC, prefix=1)"
|
||||||
} {
|
} {
|
||||||
break
|
|
||||||
do_test 2.$tn.1 {
|
do_test 2.$tn.1 {
|
||||||
catchsql { DROP TABLE t1 }
|
catchsql { DROP TABLE t1 }
|
||||||
execsql "CREATE VIRTUAL TABLE t1 USING $create"
|
execsql "CREATE VIRTUAL TABLE t1 USING $create"
|
||||||
@ -390,15 +408,15 @@ foreach {tn create} {
|
|||||||
catchsql { DROP TABLE t1 }
|
catchsql { DROP TABLE t1 }
|
||||||
execsql "CREATE VIRTUAL TABLE t1 USING $create"
|
execsql "CREATE VIRTUAL TABLE t1 USING $create"
|
||||||
do_execsql_test 3.$tn.1 {
|
do_execsql_test 3.$tn.1 {
|
||||||
INSERT INTO t1 VALUES('a b c d e f g h i j k');
|
INSERT INTO t1(docid, x) VALUES(-2, 'a b c d e f g h i j k');
|
||||||
INSERT INTO t1 VALUES('b c d e f g h i j k a');
|
INSERT INTO t1(docid, x) VALUES(-1, 'b c d e f g h i j k a');
|
||||||
INSERT INTO t1 VALUES('c d e f g h i j k a b');
|
INSERT INTO t1(docid, x) VALUES(0, 'c d e f g h i j k a b');
|
||||||
INSERT INTO t1 VALUES('d e f g h i j k a b c');
|
INSERT INTO t1(docid, x) VALUES(1, 'd e f g h i j k a b c');
|
||||||
INSERT INTO t1 VALUES('e f g h i j k a b c d');
|
INSERT INTO t1(docid, x) VALUES(2, 'e f g h i j k a b c d');
|
||||||
INSERT INTO t1 VALUES('f g h i j k a b c d e');
|
INSERT INTO t1(docid, x) VALUES(3, 'f g h i j k a b c d e');
|
||||||
INSERT INTO t1 VALUES('a c e g i k');
|
INSERT INTO t1(docid, x) VALUES(4, 'a c e g i k');
|
||||||
INSERT INTO t1 VALUES('a d g j');
|
INSERT INTO t1(docid, x) VALUES(5, 'a d g j');
|
||||||
INSERT INTO t1 VALUES('c a b');
|
INSERT INTO t1(docid, x) VALUES(6, 'c a b');
|
||||||
}
|
}
|
||||||
|
|
||||||
make_token_deferrable t1 c
|
make_token_deferrable t1 c
|
||||||
|
@ -141,10 +141,10 @@ ifcapable fts3 {
|
|||||||
INSERT INTO x1(x1) VALUES('optimize');
|
INSERT INTO x1(x1) VALUES('optimize');
|
||||||
} {
|
} {
|
||||||
"INSERT INTO x1(x1) VALUES('optimize');"
|
"INSERT INTO x1(x1) VALUES('optimize');"
|
||||||
"-- SELECT idx, start_block, leaves_end_block, end_block, root FROM 'main'.'x1_segdir' ORDER BY level DESC, idx ASC"
|
"-- SELECT idx, start_block, leaves_end_block, end_block, root FROM 'main'.'x1_segdir' WHERE level BETWEEN ? AND ?ORDER BY level DESC, idx ASC"
|
||||||
"-- SELECT count(*), max(level) FROM 'main'.'x1_segdir'"
|
"-- SELECT max(level) FROM 'main'.'x1_segdir' WHERE level BETWEEN ? AND ?"
|
||||||
"-- SELECT coalesce((SELECT max(blockid) FROM 'main'.'x1_segments') + 1, 1)"
|
"-- SELECT coalesce((SELECT max(blockid) FROM 'main'.'x1_segments') + 1, 1)"
|
||||||
"-- DELETE FROM 'main'.'x1_segdir'"
|
"-- DELETE FROM 'main'.'x1_segdir' WHERE level BETWEEN ? AND ?"
|
||||||
"-- INSERT INTO 'main'.'x1_segdir' VALUES(?,?,?,?,?,?)"
|
"-- INSERT INTO 'main'.'x1_segdir' VALUES(?,?,?,?,?,?)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user