Commit Graph

453 Commits

Author SHA1 Message Date
dan cb38809159 Add a test case to check that the fts5 unicode64 tokenizer is dealing with
codepoints greater than 65535 correctly.

FossilOrigin-Name: 9f7a6ae878cd17ff4de7c55e654406773e0ea2b9fe1c4e2a9fc2b0da84d059a4
2018-05-09 16:32:00 +00:00
drh cdf88760da More test case updates. Tests are all running now.
FossilOrigin-Name: dab5e5294813891469660cceb211ac1a1e526715bb57dcdbb1ab90321e6a4dad
2018-05-02 19:42:33 +00:00
drh b3f0276b9e Fix test cases so that they work with the new EXPLAIN QUERY PLAN output
format.  Only some of the cases have been fixed.  This is an incremental
check-in.

FossilOrigin-Name: 5f0e803e33aa557865d5fc830d9202d628de9a94c9757058ca48f1a560702cd3
2018-05-02 18:00:17 +00:00
dan 67ecf1f5c2 Fix the fts5 xBestIndex method so that it is not confused by "IS", "!=",
"REGEXP", "GLOB" or "LIKE" operators.

FossilOrigin-Name: a0ca4ddbbf179b8f0a5f30c127f2f8c92b6d45a08be3e1ef2194e44ebcc28120
2018-04-09 14:26:44 +00:00
mistachkin 23355215fb Fix harmless compiler warning in FTS5.
FossilOrigin-Name: 2d544711c7e9f4c2c3ca7ee7d588948d048da82e63c82f41c999fce947d6661d
2018-03-07 14:49:32 +00:00
dan eab0e10304 In extensions rtree, fts3 and fts5, ensure that when dynamic buffers are bound
to persistent SQL statements using SQLITE_STATIC, the binding is replaced with
an SQL NULL before the buffer is freed. Otherwise, a user may obtain a pointer
to the persistent statement using sqlite3_next_stmt() and attempt to access
the freed buffer using sqlite3_expanded_sql() or similar.

FossilOrigin-Name: 2a5f813bc61f9e780f2ccbda425611f65ad523b6d486a1e5e2b9d5e9f1d260a2
2018-02-07 18:02:50 +00:00
dan 30fe26c47f Update test file fts5fault6.test to account for test tokenizers implemented in
Tcl returning SQLITE_ERROR instead of SQLITE_NOMEM following an OOM error.

FossilOrigin-Name: c232f6424a858ede44940a927fe4e26ee99c6ab614aa6f63e13ba46e88dbb280
2018-01-17 12:57:07 +00:00
drh 2d9e8c55da Fix compiler warning in the FTS5 test interface.
FossilOrigin-Name: 2ab4e8d5d82ab410c00f048c12555f2f40f9fd8bffda64ccbdd3dfe036727315
2018-01-16 21:00:58 +00:00
dan 4bd387495f Fix a test problem causing an error in fts5fault9.test.
FossilOrigin-Name: 8e2048113fc6ed87fc7d5ba470261926aa0bd35474744bb2b99ea596bc468f02
2018-01-16 20:44:00 +00:00
mistachkin 9a5efdec70 Fix compiler warnings.
FossilOrigin-Name: 19aabccfe34c956599f33cd3ddc846816adc06784c2496838f1ef53059e038e5
2018-01-05 17:10:49 +00:00
dan c8f44d245c Fix crashes that could occur if SQL NULL values were passed to the built-in
FTS5 snippet function. Edit: breaks amalgamation builds.

FossilOrigin-Name: 6a790b67a0a5c698526db16ea262b13ecdd1b6ca74e80bdccfcad88ddbdc933a
2017-12-26 14:32:25 +00:00
dan 2e6ca188c4 Fix a buffer overwrite in fts5 that could occur when processing a prefix
query.

FossilOrigin-Name: 92fc146bc2b781e7e2d7138b00e5ea649c6fee1c2b8449420460a1b3e5c9661b
2017-12-11 17:20:37 +00:00
dan d37ce8396a Add the "^" syntax from fts3/4 to fts5.
FossilOrigin-Name: 24d7058e2799133dd681d2fef341025ca50554861bb4cd39e93ee87ae1d8a605
2017-11-24 19:24:44 +00:00
mistachkin 94ea27f808 Fix harmless compiler warnings in FTS5 seen with MSVC.
FossilOrigin-Name: 5594a121bf132a98d0ecb4cf86d9f2681925c9416206096bf11c9370a5dae22f
2017-10-08 02:22:06 +00:00
dan 865c3c58ab Add test cases for ticket [be436a7f4587ce517] using virtual table modules fts5
and rtree.

FossilOrigin-Name: 2101b4208787d297788e05f2bd82d4a9aff26e2237a7016ac857a52fb5252ce0
2017-08-17 14:12:16 +00:00
dan 3c77a1e9f1 Add new test file fts5vocab2.test.
FossilOrigin-Name: 02174842c353bfaa747019cb3dcdee5bca6551d0a06d83fc1ac6d4569e16bc34
2017-08-12 18:31:31 +00:00
dan 7c3ca3611c Add the "instance" type to the fts5vocab virtual table module. For direct
access to the contents of the fts5 term index.

FossilOrigin-Name: 34a7bd7121a478e14982d59be95ad891fab8050ad5e006638f826c57c392b93e
2017-08-10 20:36:56 +00:00
drh 22930062d5 Add a destructor argument to sqlite3_bind_pointer()
and sqlite3_result_pointer().

FossilOrigin-Name: 3d9e841f6011480ebb8a6d860da72af7fa545983e08835ddef2cac96e5f5cd4b
2017-07-27 03:48:02 +00:00
mistachkin 885f410472 Remove some 'breakpoint' commands in test files.
FossilOrigin-Name: d14fc621e918915bbf8e04597eb238ea78dff3d9c5eb4402cb88692d00dbdfee
2017-07-19 18:01:42 +00:00
drh 72495b44e0 Improved the interface to the fts5() extension mechanism for enhanced
security.

FossilOrigin-Name: bc78235f547977f1a821342ca8f3e03103a0eb351f8b3115ac10b43dd9c7044d
2017-07-17 15:38:57 +00:00
drh a690ff360b Change the error message text for SQLITE_ERROR to omit the part about
"missing database" as that meaning is now obsolete (since approx SQLite 2.0).

FossilOrigin-Name: 732f90d6327c5c6368fc8b4cc207bd644ef08e3ae6d2e7295258ab099deaba63
2017-07-07 19:43:23 +00:00
drh d0bbe4e9c2 Incorporate recent trunk changes.
FossilOrigin-Name: 62b8269ba2ff71e2daaa86688698896badd6f6e34ab42fbf92dda7fcda73a230
2017-06-28 15:56:58 +00:00
dan 210ec4c855 Fix a virtual table problem that can occur when the vtab is on the RHS of a
LEFT JOIN and there is a MATCH constraint in the ON clause, or when the vtab
is in a sub-query that is the RHS of a LEFT JOIN and there is a MATCH
constraint in the WHERE clause of the sub-query.

FossilOrigin-Name: 87b381663398f029f52cb5598aadd069b03034b6f833ce80ba762b406075a44e
2017-06-27 16:39:01 +00:00
drh 2c2f392dca Add interfaces sqlite3_prepare_v3() and sqlite3_prepare16_v3() with the
extra prepFlags argument.  Add the SQLITE_PREPARE_PERSISTENT option as one
bit in that argument.

FossilOrigin-Name: 4a25c5883380fe5990d8180adb58c3bdc7a3d081bc4c69cd4de3cd57074fb251
2017-06-01 00:54:35 +00:00
mistachkin 831265f962 Fix harmless compiler warnings in FTS5.
FossilOrigin-Name: 57a60e959c198b87ed29fab14356f89e0ea7cdb1dd99adbea45b40e8d0cb310a
2017-05-24 15:32:44 +00:00
dan 22025ef198 Fix some problems in fts5 code detected by -fsanitize=undefined.
FossilOrigin-Name: 35f721045dfe3f82e016938ab1a668bfc37b6b57b8813cc963ef640ec82de58d
2017-05-19 12:32:32 +00:00
dan 6b4fbabd6a Do not save the state of an fts5 merge operation mid-way through an input
term, even if no previous entry for that term has caused any output. Doing so
may corrupt the FTS index.

FossilOrigin-Name: 9a2de4f05fabf7e725666fb8824ae1adad56834d7ae4f2e118375bb6f9c0ae77
2017-05-11 18:14:06 +00:00
dan b9e6a73866 Replace <fts5.h> with "fts5.h" in test file fts5_test_tok.c.
FossilOrigin-Name: 63d9ca5c7392e1efe3330689fe750310a952287e843b3242178724e8561fae0e
2017-04-26 14:34:04 +00:00
dan 0619838c55 Fix an FTS5 bug that could cause a prefix-query without a prefix-index on a
database that contains delete-markers to return extra, non-matching, rows.

FossilOrigin-Name: 840042cb2bed2924e2263f21887317f661e5a585c4466c3af25b91ed57a6b49b
2017-04-21 16:04:18 +00:00
dan 929b695111 Allow a user column name to be used on the LHS of a MATCH operator in FTS5.
FossilOrigin-Name: 6f54ffd151b0eca6f9ef57ac54802584a839cfc7373f10c100fc18c855edcc0a
2017-04-13 09:45:21 +00:00
dan 03155f659f Update fts5 to support "<colset> : ( <expr> )" for column filtering, as well
as "<colset> : NEAR(...)" and "<colset> : <phrase>".

FossilOrigin-Name: c847543f8bb1376fef52bca72b4191162a32eb7e6c5f0cd1aa0ab116b3183396
2017-04-12 17:50:12 +00:00
dan be0bc8bb4d Have fts5 close any open blob-handle when a new savepoint is opened. This
ensures that fts5 does not prevent DROP TABLE statements (which always open a
savepoint) from succeeding.

FossilOrigin-Name: a921ada89050ce1d162fd1b0056939573635e2cec7ac0c2a99ae924b3ae593f7
2017-04-08 09:12:20 +00:00
dan 81415257ec Improve performance of fts5 writes by writing the "averages" record once at
the end of each transaction instead of every time the table is updated.

FossilOrigin-Name: 2b210d691462b463796e7948399133c296e89ebf
2017-02-27 17:06:56 +00:00
dan 9c58b63c18 Add an sqlite3_set_last_insert_rowid() method. Use it to work around fts4 and
fts5 modifying the last-insert-rowid unintuitively from within commit
processing.

FossilOrigin-Name: fe41bb5632a5d438acfd682809f1bd12315b970a
2017-02-27 14:52:48 +00:00
dan f0e808c60b Fix an FTS5 problem that could cause a crash when certain queries were
interrupted using sqlite3_interrupt().

FossilOrigin-Name: e400909f313c317b7b67be6eb867ed61df7383dc
2017-02-21 17:52:58 +00:00
drh ac279be98e Avoid a duplication #define in FTS5
FossilOrigin-Name: c447441cff1884d6fe5f0a76d64b3e7d908584a1
2017-02-13 13:20:02 +00:00
dan 1b9fd2651b Fix a problem preventing FTS5 from correctly passing the FTS5_TOKENIZE_PREFIX
flag to custom tokenizer implementations.

FossilOrigin-Name: 03c601344ed56b316bcc5fd02f6648b0009ba61b
2017-01-23 07:06:27 +00:00
dan 1439a1e80f Improve handling of corrupt data in fts5.
FossilOrigin-Name: 609ac1c73f7c2b48a571c178a72383996a9538fe
2017-01-06 11:55:03 +00:00
dan 55092c1504 Fix an fts5 bug that could cause a crash following an OOM error or
sqlite3_interrupt() interrupt.

FossilOrigin-Name: 0ea3ece988883874bb88e3daaa220d7fc0cf36ef
2016-12-09 16:12:04 +00:00
dan 158e4e56d7 Simplify some code in fts5_expr.c. Add some extra test cases for the same.
FossilOrigin-Name: 7cc2d60dce90b8d4dca35708e33002ae6387806e
2016-11-28 14:52:23 +00:00
dan b3e845ba33 Fix an fts5 problem causing a crash in phrase queries where the first token of
the phrase matches one or more rows but some other token within the phrase
matches zero.

FossilOrigin-Name: e78f6f3bbf4781850960fe6741f7cba480f2c27d
2016-11-14 08:19:37 +00:00
dan 642f0146d7 Fix some compiler warnings in fts5.
FossilOrigin-Name: b066637bb75959267fe6104da323c5112ad78f82
2016-10-05 20:14:29 +00:00
dan 49377a8fb7 Fix a problem with the fts5 auxiliary function API causing a crash when a query contained a phrase of zero terms.
FossilOrigin-Name: 0741812d7fcd558479e4849fbb3ba8d03738d018
2016-09-21 19:43:34 +00:00
dan 48a72ebfa3 Update the fts5vocab table to handle "ORDER BY term" efficiently.
FossilOrigin-Name: d4928fb5cd63a72808f01778fa5a11395385dedf
2016-09-21 14:41:09 +00:00
dan 37ff4d4c77 Fix a bug in the fts5 snippet function causing it to return text containing zero phrase instances.
FossilOrigin-Name: b174ed2bde43a1872374ce18b85ac9f067e86fbb
2016-08-24 18:50:47 +00:00
dan 783e778f38 Fix other minor problems with the fts5 snippet() function.
FossilOrigin-Name: b56b2a85cf377686727f3929208ede43f797cf76
2016-08-20 17:23:45 +00:00
dan 7ca1ea16ff Have the fts5 snippet() function avoid favouring snippets that begin with sentences that do not contain search terms. Add an extra bias in favour of the first sentence in the document.
FossilOrigin-Name: d8180af2adfc101dfce95a0498b5cd7b30643b30
2016-08-19 14:25:38 +00:00
dan b39a5ac229 Adjust some tests to account for recent changes to the fts5 snippet function.
FossilOrigin-Name: 184ecbe9c0c3280a22cdeda5c7836a7b280c3e1f
2016-08-18 14:47:48 +00:00
dan e7036202bc Bias the fts5 snippet() function to return snippets that look like they start at the start of sentences.
FossilOrigin-Name: 60de159476edbd48dc363f7f77f09c32ea68422f
2016-08-17 19:05:12 +00:00
dan 8c2b1fde58 Fix a problem in the fts5 snippet() auxiliary function.
FossilOrigin-Name: a861713cc6a3868a1c89240e8340bc7b2b9559da
2016-08-17 11:14:39 +00:00