aboutsummaryrefslogtreecommitdiff
path: root/test/fts3snippet.test
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-02-10 05:33:17 +0000
committerdan <dan@noemail.net>2010-02-10 05:33:17 +0000
commit56f2996b489684f65ab6355dc45f34f5437e013c (patch)
tree4cad3bff1f64c20c4de5056342021229bf295a28 /test/fts3snippet.test
parent309e6555a5663c919bd1eee3ae443d37ed087e65 (diff)
downloadsqlite-56f2996b489684f65ab6355dc45f34f5437e013c.tar.gz
sqlite-56f2996b489684f65ab6355dc45f34f5437e013c.zip
Fix a segfault in fts3 that may occur if the snippet, offsets or matchinfo functions are used in a query that does not contain a MATCH clause.
FossilOrigin-Name: 14ab536a96f81595ab8c3dcd4b72075f1a827c8b
Diffstat (limited to 'test/fts3snippet.test')
-rw-r--r--test/fts3snippet.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/fts3snippet.test b/test/fts3snippet.test
index d112c5e09..614691a8b 100644
--- a/test/fts3snippet.test
+++ b/test/fts3snippet.test
@@ -432,7 +432,34 @@ foreach {DO_MALLOC_TEST enc} {
{2 2 1 3 3 3 6 3 0 0 0 2 3 2}
{2 2 1 3 3 3 6 3 0 0 0 2 3 2}
}]
+
+ # EVIDENCE-OF: R-56101-59725 If used within a SELECT that uses the
+ # "query by rowid" or "linear scan" strategies, then the snippet and
+ # offsets both return an an empty string, and the matchinfo function
+ # returns a blob value zero bytes in size.
+ #
+ set r 1000000 ;# A rowid that exists in table ft
+ do_select_test $T.10.0 { SELECT rowid FROM ft WHERE rowid = $r } $r
+ do_select_test $T.10.1 {
+ SELECT length(offsets(ft)), typeof(offsets(ft)) FROM ft;
+ } {0 text 0 text 0 text}
+ do_select_test $T.10.2 {
+ SELECT length(offsets(ft)), typeof(offsets(ft)) FROM ft WHERE rowid = $r
+ } {0 text}
+ do_select_test $T.10.3 {
+ SELECT length(snippet(ft)), typeof(snippet(ft)) FROM ft;
+ } {0 text 0 text 0 text}
+ do_select_test $T.10.4 {
+ SELECT length(snippet(ft)), typeof(snippet(ft)) FROM ft WHERE rowid = $r;
+ } {0 text}
+ do_select_test $T.10.5 {
+ SELECT length(matchinfo(ft)), typeof(matchinfo(ft)) FROM ft;
+ } {0 blob 0 blob 0 blob}
+ do_select_test $T.10.6 {
+ SELECT length(matchinfo(ft)), typeof(matchinfo(ft)) FROM ft WHERE rowid = $r
+ } {0 blob}
}
+
set sqlite_fts3_enable_parentheses 0
finish_test