1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +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

@ -520,5 +520,24 @@ do_execsql_test 2.6 {
{[one] two three [four] five}
}
#-------------------------------------------------------------------------
do_execsql_test 3 {
CREATE VIRTUAL TABLE t3 USING fts4;
INSERT INTO t3 VALUES('[one two three]');
}
do_execsql_test 3.1 {
SELECT snippet(t3) FROM t3 WHERE t3 MATCH 'one';
} {{[<b>one</b> two three]}}
do_execsql_test 3.2 {
SELECT snippet(t3) FROM t3 WHERE t3 MATCH 'two';
} {{[one <b>two</b> three]}}
do_execsql_test 3.3 {
SELECT snippet(t3) FROM t3 WHERE t3 MATCH 'three';
} {{[one two <b>three</b>]}}
do_execsql_test 3.4 {
SELECT snippet(t3) FROM t3 WHERE t3 MATCH 'one OR two OR three';
} {{[<b>one</b> <b>two</b> <b>three</b>]}}
set sqlite_fts3_enable_parentheses 0
finish_test