14583 Commits

Author SHA1 Message Date
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
drh
3ad93bba84 Enhance the json_extract() function so that if given multiple PATH arguments
it will return a JSON array with all of the answers.  Also update comments
within the json1 extension to reflect stricter interpretation of JSON and PATH
arguments.

FossilOrigin-Name: 1da60c3dda4254620052a83c853c2d2b6dd5009f
2015-08-29 19:41:45 +00:00
drh
3be094df69 Link the json1 extension into the command-line shell by default.
FossilOrigin-Name: 2e8e239cec5a12ac81cf62c0fbe94fb5713c31b1
2015-08-29 19:03:33 +00:00
dan
0cb01f5c2c Add a test for an fts5 tokenizer that supports synonyms by adding multiple entries to the fts index.
FossilOrigin-Name: 98d07d16cab92f1e7001afbe370df3ec6343fc1f
2015-08-29 18:46:12 +00:00
drh
20b3b6109b New test cases for the json1 extension.
FossilOrigin-Name: daff4832af963f98bcc1d2c2f84bd815d384f850
2015-08-29 18:30:30 +00:00
drh
d29759288e Fix the build with -DSQLITE_OMIT_VIRTUALTABLE.
FossilOrigin-Name: 752918def7231f7846b3e985c9953a1cc825ab6b
2015-08-29 17:22:33 +00:00
drh
d1f0068d19 Do not consider an empty string to be valid JSON. Add some additional
JSON test cases.

FossilOrigin-Name: fd19ff029f128f478f69910352a6f8b84262ce1d
2015-08-29 16:02:37 +00:00
dan
ee0c0a8de3 Another change to the fts5 tokenizer API.
FossilOrigin-Name: fc71868496f45f9c7a79ed2bf2d164a7c4718ce1
2015-08-29 15:44:27 +00:00
drh
a771402e55 Change the json1.c module so that it throws an error if any of the
JSON selector paths are malformed.

FossilOrigin-Name: 3aa0855fd463076fc3277f1d9fe00d2f30e6b449
2015-08-29 00:54:49 +00:00
drh
f2df7e71d6 Back out the json_check() routine. Instead, throw an error if the input to
a json function (other than json_valid()) is not valid JSON.

FossilOrigin-Name: dc9ce7b18cbe23d065317757234ef9fb8792da7a
2015-08-28 20:07:40 +00:00
dan
57e0add3f9 Change the fts5 tokenizer API to allow more than one token to occupy a single position within a document.
FossilOrigin-Name: 90b85b42f2b2dd3e939b129b7df2b822a05e243d
2015-08-28 19:56:47 +00:00
dan
2798f0b54b Fix compiler warnings in rbu code.
FossilOrigin-Name: 0fdc36fe35ae2fc8e9688fe6c53437f4d47502d9
2015-08-28 16:41:45 +00:00
dan
3b05828ea8 When searching the wal file for a frame, do not search that part that was already checkpointed when the transaction was opened.
FossilOrigin-Name: a84cf4f5d326270a61faf4ff867260f2dd1e68a6
2015-08-28 16:18:45 +00:00
dan
8f9ea2dc70 Merge latest trunk into this branch.
FossilOrigin-Name: ab93024da7bd577d8850b417aff8597a8b3807fc
2015-08-28 15:50:24 +00:00
drh
f6ec8d4f4c Add the json_check() function, which returns its argument if the argument
is well-formed JSON or which throws an error otherwise.

FossilOrigin-Name: 64abb65d4df11e5b3bcc4afc8e7c18e907c6080a
2015-08-28 03:48:04 +00:00
drh
ecb5fedb3f Enhance the json_insert(), json_replace(), and json_set() functions with the
ability to add JSON instead of text if the argument is text and if the PATH
begins with '$$' instead of just '$'.

FossilOrigin-Name: 44f103d8862abc2d5613bac04dc2ea8e625b1f40
2015-08-28 03:33:50 +00:00
drh
31a5d34283 Fix the OR-optimization so that it always ignores subplans that do not use an index.
FossilOrigin-Name: cf452028d1be2c5578a07f6e21b4d8b613373eb8
2015-08-27 23:42:43 +00:00
drh
2dc292930d Fix the OR-optimization so that it always ignores subplans that do not
use an index.

FossilOrigin-Name: 66f92a16866e5825363636b9cc4b8f9b29d9e84d
2015-08-27 23:18:55 +00:00
drh
c7c4680ffd Fix EXPLAIN QUERY PLAN output for indexed-expressions. Fix another
obscure fault in the WHERE term scanner.

FossilOrigin-Name: 73d361ce9e4d72c943def8b0b3caa227f9199aed
2015-08-27 20:33:38 +00:00
drh
29d03f6517 Fix problems in the indexed-expression handling in the optimizer.
FossilOrigin-Name: 03375017691d5b480e73d712c4318632e835060c
2015-08-27 19:56:49 +00:00
drh
6860e6fa6f Activate the ability to use expressions in indexes in a query. There are some
test failures, but mostly this seems to work.

FossilOrigin-Name: 42f93f582eccd8a778189aa6c113874f995ab751
2015-08-27 18:24:02 +00:00
drh
b377020ca9 Merge changes from trunk.
FossilOrigin-Name: c80e9e8e8cc1e7676d7c782ee0827726875db79e
2015-08-27 16:07:02 +00:00
drh
bb52308f3d Adjustments to the WHERE term scanning, to better handle scanning terms of
an index.

FossilOrigin-Name: 5611130a595e7f0b6d5f21d76f2755e9c09c7810
2015-08-27 15:58:51 +00:00
drh
a3f108e93d Reduce the size of the WhereScan object by 24 bytes while also clarifying its
operation.

FossilOrigin-Name: cbc3c9a8bf169ae0b21f26855038502c6cc25cfe
2015-08-26 21:08:04 +00:00
drh
e14796085a Merge enhancements from trunk.
FossilOrigin-Name: ec6ddb3d481d005c304a26c948c9c808586750e9
2015-08-26 18:04:23 +00:00
drh
5579d59fb3 Evaluate expressions only once when the same expression is used in both the
result set and in the ORDER BY clause.

FossilOrigin-Name: c2f3bbad778504681b39ab9399a1eb3c1a35ab3f
2015-08-26 14:01:41 +00:00
drh
0576bc59a7 Refactor With.a.zErr into With.a.zCteErr. No logic changes.
FossilOrigin-Name: 58ba73630ecc4bc58b03a7962dd45b305ef605ef
2015-08-26 11:40:11 +00:00
drh
1c4505de91 Update the TreeView output for compound SELECT statements so that all entries
are shown vertically aligned rather than each successive entry being indented.

FossilOrigin-Name: 65a8918776aa395009a690fa86bfc7d99eb973f9
2015-08-26 11:34:31 +00:00
drh
567cc1e407 Move sqlite3IndexColumnAffinity() inside of SQLITE_ENABLE_STAT3_OR_STAT4.
FossilOrigin-Name: b3732a4e1b42a86675d89766cb8089914e2fab9a
2015-08-25 19:42:28 +00:00
drh
760b32dff2 Merge trunk enhancements.
FossilOrigin-Name: e8b02902c48f3668dcff7b1767347ac7ef3c971e
2015-08-25 19:24:11 +00:00
drh
e910769817 Use the sqlite3IndexColumnAffinity() routine to quickly and correctly find the
affinity of an index column.

FossilOrigin-Name: 1ee089a72d789002a0a377347fc51e08ab32fb14
2015-08-25 19:20:04 +00:00