1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix a bug in the fts3 snippet() function causing it to omit leading separator characters from snippets that begin with the first token in a column.

FossilOrigin-Name: adc9283dd9bc3a6463f8c4fe23dd58a3712c349d
This commit is contained in:
dan
2015-01-27 19:01:26 +00:00
parent 18f6ff9eb7
commit 6f0138e89e
4 changed files with 33 additions and 10 deletions

View File

@ -682,8 +682,12 @@ static int fts3SnippetText(
** required. They are required if (a) this is not the first fragment,
** or (b) this fragment does not begin at position 0 of its column.
*/
if( rc==SQLITE_OK && (iPos>0 || iFragment>0) ){
rc = fts3StringAppend(pOut, zEllipsis, -1);
if( rc==SQLITE_OK ){
if( iPos>0 || iFragment>0 ){
rc = fts3StringAppend(pOut, zEllipsis, -1);
}else if( iBegin ){
rc = fts3StringAppend(pOut, zDoc, iBegin);
}
}
if( rc!=SQLITE_OK || iCurrent<iPos ) continue;
}