Fix other minor problems with the fts5 snippet() function.
FossilOrigin-Name: b56b2a85cf377686727f3929208ede43f797cf76
This commit is contained in:
+4
-1
@@ -441,7 +441,7 @@ static void fts5SnippetFunction(
|
||||
nColSize = nDocsize;
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK && sFinder.nFirst ){
|
||||
if( rc==SQLITE_OK && sFinder.nFirst && nDocsize>nToken ){
|
||||
for(jj=0; jj<(sFinder.nFirst-1); jj++){
|
||||
if( sFinder.aFirst[jj+1]>io ) break;
|
||||
}
|
||||
@@ -469,6 +469,9 @@ static void fts5SnippetFunction(
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = pApi->xColumnText(pFts, iBestCol, &ctx.zIn, &ctx.nIn);
|
||||
}
|
||||
if( rc==SQLITE_OK && nColSize==0 ){
|
||||
rc = pApi->xColumnSize(pFts, iBestCol, &nColSize);
|
||||
}
|
||||
if( ctx.zIn ){
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = fts5CInstIterInit(pApi, pFts, iBestCol, &ctx.iter);
|
||||
|
||||
@@ -156,6 +156,14 @@ if {[detail_is_full]} {
|
||||
}
|
||||
}
|
||||
|
||||
do_execsql_test 4.0 {
|
||||
CREATE VIRTUAL TABLE x1 USING fts5(a, b);
|
||||
INSERT INTO x1 VALUES('xyz', '1 2 3 4 5 6 7 8 9 10 11 12 13');
|
||||
SELECT snippet(x1, 1, '[', ']', '...', 5) FROM x1('xyz');
|
||||
} {
|
||||
{1 2 3 4 5...}
|
||||
}
|
||||
|
||||
} ;# foreach_detail_mode
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
C Register\sany\sbuilt-in\sfts5\smodule\sbefore\sloading\sautomatic\sextensions.\sThis\sallows\sautomatic\sextensions\sto\sregister\sfts5\stokenizers\sand\sauxiliary\sfunctions.
|
||||
D 2016-08-19T18:37:35.386
|
||||
C Fix\sother\sminor\sproblems\swith\sthe\sfts5\ssnippet()\sfunction.
|
||||
D 2016-08-20T17:23:45.034
|
||||
F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a
|
||||
@@ -99,7 +99,7 @@ F ext/fts3/unicode/parseunicode.tcl da577d1384810fb4e2b209bf3313074353193e95
|
||||
F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0
|
||||
F ext/fts5/fts5.h 62f3e33ceeb9a428db139f9c012186b371da1cc7
|
||||
F ext/fts5/fts5Int.h b2eda36e0f224365c8e23dc8f559311834f1c13f
|
||||
F ext/fts5/fts5_aux.c 26a2b7e5f02cdc6b7322b85f473e488de452a5be
|
||||
F ext/fts5/fts5_aux.c 13246759ce03614a3b214894fa4b0f76891e97c0
|
||||
F ext/fts5/fts5_buffer.c 4c1502d4c956cd092c89ce4480867f9d8bf325cd
|
||||
F ext/fts5/fts5_config.c 5af9c360e99669d29f06492c370892394aba0857
|
||||
F ext/fts5/fts5_expr.c 1ee97156421919e497595bfa962bb88ad1665401
|
||||
@@ -122,7 +122,7 @@ F ext/fts5/test/fts5ab.test 30325a89453280160106be411bba3acf138e6d1b
|
||||
F ext/fts5/test/fts5ac.test 55cad4275a1f5acabfe14d8442a8046b47e49e5f
|
||||
F ext/fts5/test/fts5ad.test 36995f0586f30f5602074e012b9224c71ec5171c
|
||||
F ext/fts5/test/fts5ae.test 612dcb51f4069226791ff14c17dbfb3138c56f20
|
||||
F ext/fts5/test/fts5af.test b601bbab5a35ca15dd3d1069ee7075a859567073
|
||||
F ext/fts5/test/fts5af.test b21abd9455c7351a9ef872b650d16f9dd8db2c49
|
||||
F ext/fts5/test/fts5ag.test 27180de76c03036be75ee80b93d8c5f540014071
|
||||
F ext/fts5/test/fts5ah.test dfb7897711dbcda1dacb038aec310daca139fcf5
|
||||
F ext/fts5/test/fts5ai.test 3909d0b949b2afcaae4d5795cd79153da75381df
|
||||
@@ -1510,7 +1510,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P d8180af2adfc101dfce95a0498b5cd7b30643b30
|
||||
R 60073adaf70faac8deb27fa21c3071ec
|
||||
P b10e31dce8e590e1ba30f512374a8c16656bcc72
|
||||
R adacbf86d42eaec5a7639c5010230497
|
||||
U dan
|
||||
Z db6d5df26cfba25421660b26226c4ab6
|
||||
Z 520e1a56589636baad586098a109d286
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
b10e31dce8e590e1ba30f512374a8c16656bcc72
|
||||
b56b2a85cf377686727f3929208ede43f797cf76
|
||||
Reference in New Issue
Block a user