Commit Graph

14513 Commits

Author SHA1 Message Date
drh 13bf8c498f Add support for CREATE INDEX statements that use deterministic expressions
rather than only column names.

FossilOrigin-Name: 2131a5ca53f0e9b0b98a9dd9a20e495d54d146a7
2015-09-04 17:32:19 +00:00
drh aac39e1ded Merge trunk enhancements, and espeically the fix for allowing strings
as column identifers in CREATE INDEX statements.

FossilOrigin-Name: 5ff855293865c244ac632c630e8e7e8d7c05a5f6
2015-09-04 13:02:21 +00:00
drh edb04ed946 Continue to support the (broken) legacy syntax of allowing strings for
column names in CREATE INDEX statements and in UNIQUE and PRIMARY KEY
constraints.

FossilOrigin-Name: 3d3df79bfaf9dbc7aa711c08a19d2f6dbe744b32
2015-09-04 12:54:01 +00:00
dan 4dfe98a8c4 Enhance showfts5.tcl so that it can optionally display the number of terms in each segment.
FossilOrigin-Name: d648ddd93de039820f5abe064c7bc1318cd9d6b1
2015-09-04 11:13:00 +00:00
dan 477fc0e621 Modify the fts5 custom tokenizer interface to permit synonym support. The fts5_api.iVersion value is now set to 2. Existing fts5 custom tokenizers (if there are such things) will need to be updated to use the new api version.
FossilOrigin-Name: 0b7e4ab8abde3ae32459233df115c433dd58d2c1
2015-09-04 10:31:51 +00:00
dan 31c171c154 Merge latest trunk changes.
FossilOrigin-Name: 443a5eb8e17fd4f0b83ecc5bba74848e2c8a968c
2015-09-04 10:24:05 +00:00
drh 92af02c939 Simplification of the LRU list handling in pcache1.
FossilOrigin-Name: 05a3a2cd140587265b5427d23c93c5be1f39e199
2015-09-04 04:31:56 +00:00
drh 95a0b37156 Change the pcache module to keep track of the total number of references to
all pages rather than the number of pages references, for a performance
improvement and size reduction.

FossilOrigin-Name: f00a9e1e998c4bd249a45444dc2d71a7e4903b8b
2015-09-03 20:43:55 +00:00
dan f8efe64649 Rearrange code in fts5_expr.c so that synonym support does not slow down the common case.
FossilOrigin-Name: 801882817f1d895aef1426f9a7196bd140b807c3
2015-09-03 19:48:02 +00:00
dan cce413202a Merge enhancements from trunk.
FossilOrigin-Name: 4b49fe996989fe42d2bb1c24e7193fef09c5fc50
2015-09-03 18:57:52 +00:00
drh 98c5f8795a A simple optimization and size reduction in sqlite3PagerAcquire().
FossilOrigin-Name: 618d8dd4ff44cce10cc4688a2134715ff66cc562
2015-09-03 18:20:10 +00:00
dan ea8b93ee20 Add documentation for fts5 synonym support.
FossilOrigin-Name: 58aa1f435959852df74f1bca8e0bdbc4f47c256a
2015-09-03 18:05:09 +00:00
drh c98a4cc8b6 Change the Pager.hasBeenUsed flag into Pager.hasHeldSharedLock in order to
take it off the critical path in sqlite3PagerAcquire().

FossilOrigin-Name: b79096be7cb02aae2f303db33a8bf19e69204374
2015-09-03 17:54:32 +00:00
dan ea623630e2 Add tests to improve coverage of fts5_varint.c.
FossilOrigin-Name: 89f24f31a8f7d7cb0a66ee53523881f566dcb035
2015-09-03 15:37:26 +00:00
dan e1c28d7229 Remove some more code from fts5_index.c by consolidating similar functions.
FossilOrigin-Name: 59ae30b97b40faa363c55aa2664dead9eaeeddc0
2015-09-03 14:22:27 +00:00
drh 34de0c8c5e Merge enhancements from trunk.
FossilOrigin-Name: 1ab10cbf27245961b40eda1ce70f35646f0a9966
2015-09-03 14:18:12 +00:00
drh 076e85f59c Add the sqlite3VdbeLoadString() and sqlite3VdbeMultiLoad() routines to help
with code generation, especially on PRAGMAs.  Rename sqlite3VdbeAddGoto()
to just sqlite3VdbeGoto().

FossilOrigin-Name: 847387ec8e6fef283899578fb232b2c23b00ee5b
2015-09-03 13:46:12 +00:00
dan 5d144875bc Remove dead code from fts5_index.c.
FossilOrigin-Name: 8a0a9b01e74072ee52fe393311ad591208fbbf7c
2015-09-03 11:17:52 +00:00
dan 9a9e3531f7 Fix the fts5 integrity-check so that it works with columnsize=0 tables.
FossilOrigin-Name: 11b887b15eaee57ea2577c763e70494f1e251275
2015-09-03 11:00:50 +00:00
dan 2a6ecb3141 Fix a memory leak in fts5_expr.c.
FossilOrigin-Name: 399932a181437d84cd57234e76c4b65da1e4ac5f
2015-09-03 10:27:02 +00:00
drh 7cc023c7fa Factor out and simplify code in pragma.c for pragmas that return a single
row with a single column that is an integer or text value.

FossilOrigin-Name: d7f4bdf594e93c848f46901637861c8eed4c34df
2015-09-03 04:28:25 +00:00
drh b460e52a83 For PRAGMAs, factor out the code that sets the result set column names into
a subroutine.

FossilOrigin-Name: 0ea6e5c9fc6b1dd1174c09097be5bf291da4e6c7
2015-09-03 03:29:51 +00:00
drh 2a8f671244 Optimizations to the printf formatter.
FossilOrigin-Name: a3b35ddeca8f459e81105ab6477f3c5afb9b96d5
2015-09-02 21:00:48 +00:00
dan 9c671b741c Further tests to raise coverage of fts5 synonym code to 100%. Fix a dropped error code in the same.
FossilOrigin-Name: bdedd838bb3028c586bcc9f643852ce1364adb49
2015-09-02 19:48:55 +00:00
dan 50ea76e748 Fix an issue with fts5 synonyms and NEAR(...) queries.
FossilOrigin-Name: f2e590700d8eb30da8ac3a92f6ca92a2bbe9c1fe
2015-09-02 18:56:01 +00:00
drh 0ff287fb01 Add and use the sqlite3VdbeChangeOpcode() routine. Simplify the implementation
of the other sqlite3VdbeChange*() routines.

FossilOrigin-Name: 0a5b00e493efae58252f9fc7bde5a469645942d5
2015-09-02 18:40:33 +00:00
drh 2991ba050b Add the sqlite3VdbeAddGoto(v,i) routine as a shorthand for
sqlite3VdbeAddOp2(v,OP_Goto,0,i).

FossilOrigin-Name: be78f413df1b0d874b44a866ef6bf17543d7e8a2
2015-09-02 18:19:00 +00:00
drh ef41dfe5b1 Change sqlite3_sql() so that it always returns the SQL text of the prepared
statement, if the text is available, even if the the prepared statement was
generated using sqlite3_prepare() instead of sqlite3_prepare_v2().  Also
include some minor comment fixes and code simplifications.

FossilOrigin-Name: 2f5472cfda6c72e75b9cf7b7481612465c1a5e6a
2015-09-02 17:55:12 +00:00
dan bea34fc53a Fix a problem with fts5 synonyms and phrase queries. Also fix an OOM handling bug in fts5.
FossilOrigin-Name: a4c35fa2c94fe34b376670244fe72303c99868c1
2015-09-02 17:34:22 +00:00
drh 2ed0d809a6 Small simplification to the EXPLAIN QUERY PLAN logic.
FossilOrigin-Name: d1592d201afea20cb2ca94fe2bf5ae031bd29ede
2015-09-02 16:51:37 +00:00
drh d37bea5bdc Use sqlite3XPrintf() instead of sqlite3StrAccumAppend() in a few places
for better performance and a smaller footprint.

FossilOrigin-Name: 82355e41084387fa11b7b531e4d660dd3b4cd984
2015-09-02 15:37:50 +00:00
drh 4ef299a32c The sqlite3_memory_alarm() interface has been deprecated and undocumented
for almost 8 years (since version 3.5.3).  Change it into a no-op.

FossilOrigin-Name: 5d3f5df4da9f40d5897b5c23b2ea9333fc18ac2c
2015-09-02 14:56:56 +00:00
dan 583611df65 Fix a problem handling OOM conditions within fts5 queries that feature synonyms.
FossilOrigin-Name: 11fa980897c6c7be218bbd9c4cd8253272d2c300
2015-09-02 14:17:38 +00:00
dan df998c3d4f Fix a problem with fts5 synonyms and the xQueryPhrase() auxiliary function API.
FossilOrigin-Name: cf3e45e76d23e10ee06296c3561a341591597a04
2015-09-02 08:22:41 +00:00
drh 02bf8b45b7 Very minor optimizations in the unix VFS.
FossilOrigin-Name: 6db3ff45bc15ece29cb2c7a736e5c6d005dde200
2015-09-01 23:51:53 +00:00
drh 59a5364cf9 Performance improvement in sqlite3VarintLen().
FossilOrigin-Name: adf9fefb00ae1dbb07a921c6796cb0a9505c6d19
2015-09-01 22:29:07 +00:00
drh 054bbabc76 Small size reduction and performance increase in sqlite3DbMallocSize().
FossilOrigin-Name: 8a80967f849eed002a701235ed7fb406099d566e
2015-09-01 20:09:33 +00:00
drh 3c0c43191a Reduce the number of calls to sqlite3BeginBenignMalloc().
FossilOrigin-Name: 0bee6583665782fac5d9e82bdf19b6f07e7bd03f
2015-09-01 19:51:37 +00:00
dan d917ad019c Fix a problem that occurs when more than 4 synonyms for a term appear within a single row.
FossilOrigin-Name: cd359550bdc2bf7be4c294b60130c9fc3f583902
2015-09-01 18:44:33 +00:00
dan 3faa07ee04 Add tests for fts5 synonyms implemented by adding extra terms to queries. And fixes for the same.
FossilOrigin-Name: dbcb73802b88f76be17f09f3eb83ffac542de633
2015-09-01 18:08:36 +00:00
drh a7f910b549 Rename SQLITE_FUNC_VARYING to SQLITE_FUNC_SLOCHNG - a more descriptive name
for what that bit means.

FossilOrigin-Name: ff5137a6dd8cb2a9b629b3a244f52665e9c9ebce
2015-09-01 13:17:17 +00:00
drh 7d3d9daea2 Remove unreachable branches.
FossilOrigin-Name: fd4da2318cc032d7c355376e440d4a05d7ab8793
2015-09-01 00:42:52 +00:00
drh 8b57642259 Fix a bug in error reporting when a UNIQUE index on expressions fails its
uniqueness test.

FossilOrigin-Name: 5a2c0e90a1933545b4768d91d8f7c42c8f391019
2015-08-31 23:09:42 +00:00
drh 03bf26d90d Not only date/time functions, but also functions like sqlite_version() and
changes() need to be prohibited from use inside of indexes.

FossilOrigin-Name: 487131303980f15dd5e1b6695b4f29efda229eb8
2015-08-31 21:16:36 +00:00
dan cb8b58caf7 Begin changes to allow synonym support by adding multiple terms to a query (an alternative to adding multiple terms to the FTS index).
FossilOrigin-Name: ad7feaed4cd6b1d6e6376bb82d1f5664ddd083f3
2015-08-31 20:06:06 +00:00
drh 8492653c37 Always assume that indexed expressions can generate a NULL. Get
indexed expressions working for the case of two or more expressions in
the same index.

FossilOrigin-Name: cc60321a67bf9f169c090b47afb505f589a6925e
2015-08-31 19:38:42 +00:00
drh 390b88a448 Case should not be significant when comparing function names.
FossilOrigin-Name: e2f1caf117b0a9632d52246717ab202852982339
2015-08-31 18:13:01 +00:00
drh 1d85e405e6 Make the distinction between truly deterministic functions and date/time
functions which only return the same answer for a single query.  Only truly
deterministic functions are allowed in indexes.  Add new expression index
test cases.

FossilOrigin-Name: c77554b5c42327106a7b90334e9cc3c07b007c76
2015-08-31 17:34:41 +00:00
drh 47991425cb Improved analysis and usage of indexed expressions in the query planner.
FossilOrigin-Name: f8893696387cba9d293a05a68dc38228077b3dc5
2015-08-31 15:58:06 +00:00
drh 087f83b662 Merge the latest enhancements from trunk.
FossilOrigin-Name: 7bde6d4d8cf05e1beb9bdf20b85760dc3e7a76c9
2015-08-31 14:27:29 +00:00