Commit Graph

2182 Commits

Author SHA1 Message Date
drh 3528f6b62b Add the SQLITE_STMTSTATUS_MEMUSED option for sqlite3_stmt_status() that reports
the amount of heap memory used for a single prepared statement.

FossilOrigin-Name: b57d510465458dec5b5fc778fd6e8833392964201f9febebf526e60a543da0c2
2017-05-31 16:21:54 +00:00
drh 6b37e0adc9 Add the experimental "stmts" virtual table for introspection of prepared
statements.

FossilOrigin-Name: cb4c5c66aba757356da3b8ec3c66a5c8c40e180b3360638ac634f7787404a5b1
2017-05-31 16:09:04 +00:00
mistachkin 831265f962 Fix harmless compiler warnings in FTS5.
FossilOrigin-Name: 57a60e959c198b87ed29fab14356f89e0ea7cdb1dd99adbea45b40e8d0cb310a
2017-05-24 15:32:44 +00:00
drh 92b71757f7 Do not use strcpy() in the (obsolete) amatch extension.
In releasetest.tcl, run Apple tests using -Os instead of -O1

FossilOrigin-Name: 4440e42031b9cb0edf9a8621cd4f46f209392940ec5b9eefcf8c1e3fef5f7b76
2017-05-23 19:35:20 +00:00
dan 07d0f15e93 Fix incompatibilities between the "sqldiff --changeset" command and the
sessions module. Specifically, allow sessions to process changesets containing
tables with zero operations on them and have sqldiff output the expected
output for tables with multi-column primary keys.

FossilOrigin-Name: 0bb23c48064cc64134697469f3f4d2d3610b9e6c7a0dc54a3c47a00bd6c2a860
2017-05-22 18:09:00 +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
drh 31976dacf1 Merge changes from trunk.
FossilOrigin-Name: 6e0f64ab5eafda5d9e61e00c89af3c1ea2c5aa29821da1bdbcab040957b12403
2017-05-15 17:56:48 +00:00
drh 9715f0e544 Enhance the json_extract() function to reuse parses of the same JSON when
the function appears multiple times in the same query.

FossilOrigin-Name: 3ba9e7ab79e32090a71c7aa152da9bd5951940ae5e2cf433bceadeb6bfca193f
2017-05-11 18:42:19 +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
drh 3fb153cb29 Cache the JSON parse used by json_extract().
FossilOrigin-Name: 44ca6c2c4639f3c50ae9233ee299ff0fc4566462c31f28d8676f8de7ffdcd7f0
2017-05-11 16:49:59 +00:00
drh f8a2e8c2d2 Fix requirements marks and harmless compiler warnings.
FossilOrigin-Name: 198ff4c01d86d193a54745764d69376cab8e94747a4daa444690f7e1ec87800b
2017-05-06 17:12:52 +00:00
drh bd0f1dbd06 Get sqlite3_expert building on Windows.
FossilOrigin-Name: d8254047b30f7c1be486bf39d4420678604573b951b5cc83c19ebf74aba0864c
2017-05-03 12:50:46 +00:00
drh 138bd6df41 In sqlite3expert.c, do not copy the schema for virtual tables. Updates to
makefiles to make building easier.

FossilOrigin-Name: da15752dccf6090e40ec825db89048eca2b30185882225bf81f1891e914c2e7f
2017-05-03 12:15:20 +00:00
drh 382bce037c In the sqlite3_expert command-line tool, allow two-dash options. Do not
accept the database name if it begins with "-".

FossilOrigin-Name: af7d1596044980e0a18baa3ab6674779724dffbf18a152c72e53f11a08999e68
2017-05-02 20:42:30 +00:00
drh 5034dc673d Merge the latest enhancements from trunk.
FossilOrigin-Name: a7dcf6a79f7e1c5884baee2909a4bf3174ae06d561dae87b390856e573f81b49
2017-05-02 19:45:14 +00:00
drh e780764b4e Fix the fts3EvalAverageDocsize() routine so that it returns errors from
sqlite3_reset() rather than always returning SQLITE_OK.

FossilOrigin-Name: 430f539cbb3f806fb89191e0b759a5f8b49d9e5b6c95fe9a4b55a1aa0875762a
2017-05-02 18:00:31 +00:00
dan 6f92c34866 Update this branch with latest trunk changes.
FossilOrigin-Name: 11f4761c3a84e2cc9df62f117a003af8c57f3d226eec5a40d6241b121e78d002
2017-05-01 14:25:34 +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 f3ac8ba569 Another minor formatting fix.
FossilOrigin-Name: 9fa2ce3c2b75408594d387684984cd946765776d30bc622a1f4e64d6fe1856d5
2017-04-21 19:58:35 +00:00
dan 6b0fa916f5 Fix formatting errors in the previous commit.
FossilOrigin-Name: da9a2e5aa977f7e8e9e4365f7b34bb4f482029a3d44646100773cedc8ea9b959
2017-04-21 19:56:53 +00:00
dan 5b9dbd1ed0 Update the README.md file in the ext/expert/ directory.
FossilOrigin-Name: 3b2ff4e0692dfca395d4523b7d5cd0dfd5c319c1072a2a873631fa477cee0b79
2017-04-21 19:53:39 +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 c42a0056d7 Merge latest trunk changes into this branch.
FossilOrigin-Name: b1533bc455f52f570c0f4b8aaa0da802757dc89b0e45b9a9b31aa591a44bf7bd
2017-04-20 17:35:46 +00:00
dan bc3f784cd2 Speed this branch up a bit by filtering before the virtual table layer when
sampling user data.

FossilOrigin-Name: 8e57c31340dd9ffc457da63c5996fb1b573f8154f864ec2b52c15f399906ac8b
2017-04-20 16:43:32 +00:00
dan 2ed99def5b Avoid creating a temp table in the user database in the sqlite3_expert code.
Trouble is, this makes sampling for stat1 data much slower.

FossilOrigin-Name: c62e358243d96cb38a7ce2aa679fc640b62bf46080eab4bd5fc2acf5997d6cd5
2017-04-20 16:08:33 +00:00
dan e53b4f9774 Add an option to generate stat1 data based on a subset of the user database
table contents to sqlite3_expert.

FossilOrigin-Name: c69c3e21db6e141f7e24226c6432f2ed31fe5f177bd23781915871f8600ee56a
2017-04-20 09:54:04 +00:00
dan dc62daca86 Further improvements to coverage of fts3 module.
FossilOrigin-Name: 6b21d0fdebdccfaf63590d9ca9a279c22b8baec07c1a669b9f617f25bd857384
2017-04-19 13:25:45 +00:00
dan a059e99ca8 Further modifications and test cases to improve test coverage of fts3.
FossilOrigin-Name: ea8a0d2ce0cb1ca3f4f18c72fb780d1c26792799acc87e6726f9eaccf2f178bf
2017-04-19 07:33:52 +00:00
dan a6ed5a4f39 Have sqlite3_expert_analyze() populate the sqlite_stat1 table before running
queries through the planner for the second time.

FossilOrigin-Name: a157fcfde5afc27ae38e7cf4669fcc8e60e23d9d301ffe2e541dd69f895b493b
2017-04-18 20:10:16 +00:00
dan 0027e98b85 Use sqlite3_table_column_metadata() instead of a SELECT statement to check for
the existence of a %_stat table in fts3. This leads to smaller and easier to
test code.

FossilOrigin-Name: dc2a48020a3c856a8b4cfa2309c290f0508b991e92cc0e4de680d19aae7872fc
2017-04-18 13:50:00 +00:00
dan 7853002c71 Fix sqlite3_expert handling of triggers on views.
FossilOrigin-Name: ff4976da667872614331d88e68fb67d347874f164a1c7950dd738c7c2320b954
2017-04-18 09:04:48 +00:00
dan bda00fbdb7 Refactor the fts3ColumnMethod() function so that all branches can be covered.
FossilOrigin-Name: e47fdb493bd76d85f6f05771ee7a0b3ee31b1eb05839a60d2bdb47149ac692d8
2017-04-18 05:49:23 +00:00
dan 280db65e2c Add support for analyzing trigger programs to the sqlite3_expert code.
FossilOrigin-Name: 159e8022a9d6701532b8b60e0c41154bc434c1bbdb107c8c97a78fb1140fa745
2017-04-17 17:03:08 +00:00
dan 624edacf6a Further improvements to test coverage in fts3.
FossilOrigin-Name: 352413eed469802665e7d2c17b7fe6e3a0b0b2209ce45bdc85fd4243cec50ea6
2017-04-17 16:07:25 +00:00
dan ddf4747053 Improve coverage of code in fts3.
FossilOrigin-Name: 1a08a836fa919524216a16faf5212eebc9ad788c9e15463b68b0576dfccd4387
2017-04-17 13:38:09 +00:00
drh b65b3e429a Add the anycollseq.c loadable extension in etc/misc
FossilOrigin-Name: d7b9813cb17615c3d00afd6994a4309d6d48c8e924b6cd813c543e1fa65c7719
2017-04-16 22:08:31 +00:00
dan 2abf90096f Fix problems with handling constraints on the rowid column in sqlite3expert.c.
FossilOrigin-Name: 2e6308798ae2db30564deb35ba3896597448edabbcac6efc4ff084552e42de30
2017-04-15 16:52:12 +00:00
dan 990b6ceccf Merge latest trunk changes into this branch.
FossilOrigin-Name: 2d0c458e013cb2d02fbeabed8dabd66f55141aac194611f0e599b3c95af1964f
2017-04-15 15:47:19 +00:00
dan 79610f5d09 Fix memory leaks in the code on this branch. Make use of the
sqlite3_index_constraint.usage field. Do not try to handle ORDER BY terms with
explicit COLLATE clauses - they don't get passed to the vtab layer anyway.

FossilOrigin-Name: 0cd75a872c89958a7f418720a0e8c6f638f8284c488f666015c19136feae6be8
2017-04-15 14:16:04 +00:00
dan 0824ccf29b Modify the code in ext/expert/ to use the vtab interface instead of
sqlite3_whereinfo_hook(). Remove sqlite3_whereinfo_hook().

FossilOrigin-Name: 3bb6585004090dbf92dd5e9abdf0fd2c921e64b5b3121c4fb7446db764ab59e5
2017-04-14 19:41:37 +00:00
mistachkin b1ed717f18 Make USE_FULLWARN=1 the default for MSVC and fix harmless compiler warnings.
FossilOrigin-Name: 6bf673767b8e5cedef1acff795cbe524fab8db2525c06424db4e038934a33936
2017-04-14 14:50:34 +00:00
dan 81beb6d115 Update this branch with latest changes from trunk.
FossilOrigin-Name: 5fcd840cf9b6a5c3ee4ef1e8f92f6c30f96a7899a3d774ee9be8a816916f2c3b
2017-04-13 16:19:40 +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
drh 8671538cad Fix a regression caused by the fix for ticket [6c9b5514077fed34551f98e64c09a1] -
control characters allowed in JSON.

FossilOrigin-Name: 8e7b611863247a3bf46a96ec4b47d24c0ae0d60c9cee968a1cfd1da157e7c9bb
2017-04-13 00:12:32 +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
drh 26849e14c2 Improved \n and \r escapes in the ext/misc/dbdump.c utility function. The
implementation of dbdump.c now matches the implementation in the CLI.

FossilOrigin-Name: f2643315bb41a71eebd79f5d671f9163187e299a52ff8a481186f1e8fa7e5262
2017-04-12 17:38:24 +00:00
dan 0e0f5edbb5 Update this branch with latest trunk changes.
FossilOrigin-Name: 0f66a093935100efd731e14aa63b57360ddd517c1ac97edd1ea9a9de95e1f3cc
2017-04-11 19:00:30 +00:00
drh ff6d50e973 Limit the depth of recursion for valid JSON in the JSON1 extension in order
to avoid using excess stack space in the recursive descent parser.
Fix for ticket [981329adeef51011052667a9].

FossilOrigin-Name: 1f68c184596912d742b50b1ca38252a9e783aacf121619a27b17a7ae9f6df041
2017-04-11 18:55:05 +00:00
dan c2309693b9 Fix a formatting issue in the output of the sqlite3_expert program.
FossilOrigin-Name: cc8c3581060ffef02290b680183e6f6bc9837ba3550e74c8aaabdc7c45edc223
2017-04-11 18:29:14 +00:00
dan a4e61024d7 Add header comments to the API functions in sqlite3expert.h. Include a list of
all candidate indexes in the report output by the sqlite3_expert program.

FossilOrigin-Name: 0c45c5eb9f0f171b8d7c5f0d2973f9f59915467506cdff1450f3e4b2134a01ca
2017-04-11 17:43:12 +00:00
dan 96d43a05ec Add ext/expert/README.md.
FossilOrigin-Name: 9318f1b9ed2d8da3a82ea69179e2d56a99d326c7721642665f87f6a4534e7bf0
2017-04-10 20:00:26 +00:00
dan cd84474ece Changes to allow the code in sqlite3expert.c to be tested directly (via the
API in sqlite3expert.h) instead of by invoking the sqlite3_expert application.
Fix memory leaks and other problems.

FossilOrigin-Name: 5dd9831721b70a89a26728adcd49c7f6103ef8266891a79c2db34d913702709e
2017-04-10 16:13:20 +00:00
drh e12e24ded8 Change the JSON extension so that it disallows control characters inside of
strings.  Fix for ticket [6c9b5514077fed34551f98e64c09a10dc2fc8e16].

FossilOrigin-Name: 475d8f82ec61a4ff3e6a7650731230ccecb6cc580d1397d189d0ba479d9bad4d
2017-04-10 12:25:05 +00:00
dan 958151b005 Fix the -file option on the sqlite3_expert program.
FossilOrigin-Name: 0857c48e02a76490fc623364f77363165dea94ec254f93d8f0fd0bac2968c572
2017-04-09 08:38:37 +00:00
dan 2b78dd2359 Merge latest trunk with this branch.
FossilOrigin-Name: e051e8f21b909c5e89a7203eef6501fecd64f82a634c4e10398b5ef7d716eb37
2017-04-08 19:00:37 +00:00
dan e7c3aca601 Rename shell6.test to expert1.test. Have it invoke the sqlite3_expert binary
if it is present.

FossilOrigin-Name: be0deff940bea4f653d644113f42529a32ff7039d1d168119233aaf000a22f40
2017-04-08 18:56:32 +00:00
drh 9fa866a8d9 Disallow leading zeros on numeric constants in JSON.
Fix for ticket [b93be8729a895a528e2]

FossilOrigin-Name: 204e72f0080e8f08f99978870bd3cb9d59b068ecffee82192d707c650548b43b
2017-04-08 18:18:22 +00:00
dan 65e67ed1b2 Use hash tables instead of in-memory database tables for a few purposes in
sqlite3expert.c.

FossilOrigin-Name: bf10e68d9e4d5eae7ae6148a7ad64c9596f2ed8ccd36065adb09a1f9e7dae50b
2017-04-08 17:41:24 +00:00
dan 5b09d13a58 Have the rtree module close any open blob-handle within the xSavepoint method.
This prevents such an open blob handle from interfering with DROP TABLE
operations.

FossilOrigin-Name: fa4416adc2a9a3a80db1d5befc0b95c3d0fc41affe38f7f2f45cdfae3f1b49eb
2017-04-08 13:52:41 +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
drh 297e2bdb8e Make sure the RTree sqlite3_blob handle is reset prior to renaming the table.
FossilOrigin-Name: 1cdae2db3c54970a1811e597065724578408c84d49d75b8fe25d56281ddc2e94
2017-04-08 01:09:14 +00:00
dan 8e0b8e0688 Refactor code to suggest indexes from the shell tool into an extension in
ext/expert. Unfinished.

FossilOrigin-Name: 305e19f976ca064638a294e0817bf547ea745e1eb74746c5855514e6ced9c5fa
2017-04-07 20:14:22 +00:00
drh 2fb79e9b04 Fix two harmless compiler warnings.
FossilOrigin-Name: 32be9c3faaafd736da3f49d475dc9279af4e4ba38070b60033d898345080acf0
2017-03-25 12:08:11 +00:00
drh ba7cce317b Fix a harmless compiler warning in the JSON1 extension.
FossilOrigin-Name: c2c3dd84534bb5ea81c974847b74a166c9cba1545fc749ce625929f303bf22e4
2017-03-24 19:45:05 +00:00
drh 29c9969871 Fix an error in the new json_patch() routine discovered by Ralf Junker.
FossilOrigin-Name: 9d5350418b2f6113e0b50c57e8a872006f27753067baf08ffdfa7943c0c9a148
2017-03-24 12:35:17 +00:00
drh 37f03dfb1f Change the name of the json_merge_patch() function to just json_patch().
FossilOrigin-Name: 04d4100445a3373986ee962618bc03ec304f6ba2f867c8e9eee415daffb593fc
2017-03-23 20:33:49 +00:00
drh 1fe162fd0c Avoid redundant edits in the json_merge_patch() function.
FossilOrigin-Name: 4a8e6437dd610c5376a07867a73e5a7e2ea90357a018e1788ecce6f4e10bc939
2017-03-23 12:56:44 +00:00
drh 0002d246a9 Fix harmless compiler warnings in the new json_merge_patch() logic.
FossilOrigin-Name: 5d2cf5a2f8afd88d041d89b3936042ce5a43629d23c48738cb2791b24da3e6af
2017-03-23 00:46:15 +00:00
drh bb7aa2d85e Various fixes to the json_merge_patch() function.
FossilOrigin-Name: f49fd2554b0723eb7cf2fd765d655c6820833ee7e5f7d7629d98c27a6fffa1d9
2017-03-23 00:13:52 +00:00
drh f07b249f92 Change the name of the new function to "json_merge_patch()".
FossilOrigin-Name: 53bf70f37bbca319ea35f70849e2a34ae628a504486158fdad5c4bb7431c68e0
2017-03-22 21:45:20 +00:00
drh 633647af75 Initial implementation of the json_mergepatch(A,B) SQL function.
FossilOrigin-Name: a267444039af519f088dd8f8ee33f686cc3071c087677075af2364ebc2587514
2017-03-22 21:24:31 +00:00
dan 119fc11eb0 Add short script ext/fts3/tool/fts3cov.sh. To help measure test-coverage of
fts3 source code.

FossilOrigin-Name: ee9588e873ffebcaa177957950cbb14924e154c391ed7f687116065064ff11b0
2017-03-21 17:19:31 +00:00
dan 74869e5e52 Avoid passing NULL as the second argument to memcpy() in fts3.
FossilOrigin-Name: 49b93d972de9649abfd6235b65dda1c9d468956671e50704afde6181ffa56dea
2017-03-20 19:35:30 +00:00
dan 6b904f5e01 Avoid a technically undefined right-shift of a signed value in rtree.c.
FossilOrigin-Name: a144875fe44ff3a30bab299d50b7dbec2ee21f8c73e692a71ee1f7c54b5f0c76
2017-03-20 19:26:27 +00:00
dan 920c83f18f Fix some problems in fts3 found by address-sanitizer.
FossilOrigin-Name: 16a8e84fa7f67a467f824bdd7f72cbd6a6e95dab8cc7aa1e0e751720b98f3e31
2017-03-20 18:53:32 +00:00
drh 6f25936c9c Updates to README files under the ext/ hierarchy. No changes to code.
FossilOrigin-Name: 029bc5d224bcbdcca2307710539b133c39e2a27b971c28b294a1f517b80cb418
2017-03-15 20:27:46 +00:00
drh 9c4527e57d Improved header comment on the shathree.c extension. No changes to code.
FossilOrigin-Name: 84f2e3d5f611b35de16684956d842df6c93d858e8187f17eb27452758a752c57
2017-03-15 13:47:39 +00:00
drh d3bc75fb94 Fixes to the dump logic. All appears to be working in preliminary tests.
FossilOrigin-Name: 007b11e301d444361c8eff8734dc2fb968a64343c177ff30cec74a0cf76099e8
2017-03-13 21:49:48 +00:00
drh 473af4fe03 First draft of the complete dbdump.c library.
FossilOrigin-Name: 84ea4fcc52d0af02648c52989c2e69f4961071e1620382555ec59a39161a7a7d
2017-03-13 21:26:41 +00:00
drh 688633cb9e Infrastructure for an extension C-library to implement sqlite3_db_dump() and
a corresponding "dbdump" command-line utility - both of which do the same
work as the ".dump" command of the CLI.

FossilOrigin-Name: 74c5ace498f72d7f5495203678bedd0bc540211131a4e4db7b62115d5322a288
2017-03-13 19:26:34 +00:00
dan 1ba30db8bd Remove the rbu_round_trip.tcl script. It is now part of project "test-dbs".
FossilOrigin-Name: b5bf2957677e8f2acd7426b302229a966de08fd9
2017-03-10 18:36:34 +00:00
drh 4146b4e34a Improved comments explaining the sha3_query() format. Fix a performance #ifdef
error in the sha3 implementation.

FossilOrigin-Name: 54ef7abd7f5b16f4b29c9519d283e142c9340fbf
2017-03-08 15:03:12 +00:00
drh acc83d2e4f Add the shathree.c extension for implementing SHA3() and SHA3_QUERY() SQL
functions.

FossilOrigin-Name: f7ca9193ddafd3676406bdfeb1b7d21182c2a3c1
2017-03-08 13:50:40 +00:00
dan 5cc95ebf37 Add test script ext/rbu/rbu_round_trip.tcl. Uses "dbselftest" to test that
"rbu" and "sqldiff" work together.

FossilOrigin-Name: 961e79da73b4550b3e5b0f9a617133a76485db67
2017-03-07 20:03:25 +00:00
dan 0e9b43ff85 Before beginning an incremental checkpoint in RBU, sync the directory
containing the target database file. This ensures that the new directory entry
created by renaming the *-oal file to *-wal is synced to disk.

FossilOrigin-Name: 915a9a28783fbb2f4c0794eb4264ce8c0b9d42f7
2017-03-03 16:51:46 +00:00
dan 1d62a66230 Fix another RBU case similar to the previous. This one for systems where the
sector-size is larger than the page-size.

FossilOrigin-Name: 4012bb3aa91927156ba149caa4e5c622b0729d79
2017-03-02 16:56:48 +00:00
dan cb1b0a693a When saving the state of an RBU update in the incremental-checkpoint phase,
sync the database file. Otherwise, if a power failure occurs and the RBU
update resumed following system recovery, the database may become corrupt.

FossilOrigin-Name: edee6a80e1cc7e6a2b8c3c7f76dd794fc8ab9a72
2017-03-02 14:51:47 +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 70cdf38232 Add an 'extern "C"' block to header file sqlite3userauth.h.
FossilOrigin-Name: ffd61fb449a510b2fc90caf86b266733051cc365
2017-02-25 20:57:46 +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 dc5ece86ae Remove the CLANG_VERSION macro, since we have learned that version numbers in
clang are "marketing" and are inconsistent and unreliable.  Builds using clang
will still use the GCC_VERSION macro since clang works hard to be gcc
compatible.

FossilOrigin-Name: 810d29320b853b3a01aa50d8f2a0bceacf79e0aa
2017-02-15 15:09:09 +00:00
drh ac279be98e Avoid a duplication #define in FTS5
FossilOrigin-Name: c447441cff1884d6fe5f0a76d64b3e7d908584a1
2017-02-13 13:20:02 +00:00
drh a39284bfa8 Cleanup the usage of the SQLITE_DISABLE_INTRINSIC compile-time option.
Remove the SQLITE_RUNTIME_BYTEORDER compile-time option.  Use
-DSQLITE_BYTEORDER=0 instead.  Fix a bug in R-Tree that occurs when compiling
on a known little-endian machine without the use of intrinsic byteswapping
functions.

FossilOrigin-Name: 798fb9d70d2e5f95e64237b04d6692360133381a
2017-02-09 17:12:22 +00:00
dan 18fdde21b8 Avoid preparing a SELECT statement each time an UPDATE or DELETE
by docid is executed against an fts3 table.

FossilOrigin-Name: 9962c10a5c6672bd82b2bf640d878fcdac0b815a
2017-02-08 19:10:47 +00:00
dan 9fcb6ddc1e Fix a build problem affecting non-amalgamation rtree builds.
FossilOrigin-Name: bb7f445ba1df53cd4a169612b18fc533016102b7
2017-02-07 14:45:18 +00:00
drh 364ca6a90e Fix SQLITE_BYTEORDER #defines in R-Tree when compiled separately from the
amalgamation.

FossilOrigin-Name: a136609c98ed3cc673c5a3c2578d49db3f2518d1
2017-02-07 13:51:48 +00:00
drh edd9bcb372 Make the cellMargin() routine of R-Tree slightly smaller and faster while also
fixing a harmless compiler warning.

FossilOrigin-Name: 07fe6228208684d579c4f6c334c90eb6262a9233
2017-02-07 12:58:38 +00:00
drh b18bf843f7 Fix a minor typo in a comment in R-Tree. No changes to code.
FossilOrigin-Name: f77ee9e941f22b0b2e88871df4466fdde9cde131
2017-02-07 00:55:47 +00:00
drh 04128ace8d Remove a small amount of unnecessary code from R-Tree.
FossilOrigin-Name: e5aea894267addb4dc9b21de24a20417b0be508a
2017-02-06 16:52:32 +00:00
drh 9630f3ba08 Remove incorrect testcase() macros from R-Tree.
FossilOrigin-Name: 853a58a75ecbd01ebbf7e07fbd8c4fc9bef54a99
2017-02-06 01:19:07 +00:00
dan ff677b20fc Allow sqlite3session_apply() to apply changesets to tables that have been
extended using ALTER TABLE ADD COLUMN.

FossilOrigin-Name: b20ff81ff9c8af500ea96e0ba9d34524220a89f1
2017-02-04 17:33:30 +00:00
drh fe05491b87 In RTREE, use an sqlite3_blob object rather than an sqlite3_stmt object
for reading content out of the %_node shadow table.

FossilOrigin-Name: 97ccf3e4de11ffea46993cb7fb7ab559b9810705
2017-02-04 14:24:05 +00:00
drh 010e312f8f Close sqlite3_blob objects on xSync rather than waiting until xCommit.
FossilOrigin-Name: 95ee745fceb4a48c683f34c404c380fe5e7d684a
2017-02-04 13:12:12 +00:00
mistachkin 07b139b8c1 Fix issues in the sha1 extension seen with MSVC.
FossilOrigin-Name: 5a0da77c22ebc7db5e63b1520d30f3ad97b9bb3b
2017-02-02 19:24:05 +00:00
drh 3accc7e1af Remove the unused pReadNode prepared statement from each RTREE object.
FossilOrigin-Name: e51dc0ec60d45cd57564735b6b2bb254a588533e
2017-02-02 16:30:25 +00:00
drh ce655a2367 Fix a potential uninitialized (though harmless) variable in RTREE.
FossilOrigin-Name: a1c74e09d63aca630d022ed074866433eed6b493
2017-02-02 16:08:27 +00:00
drh 413e207e31 The sqlite3_blob_close() interface can cause recursive invocations of
nodeBlobReset() in RTREE.  Make sure that does not cause problems.

FossilOrigin-Name: 88333441cbf26bfde2acebf2a3f75b5ebbdfb0ae
2017-02-02 15:35:54 +00:00
drh 2033d1c8ca Change RTREE so that the sqlite3_blob object is closed whenever the cursor
count drops to zero and there is not a pending write transaction.

FossilOrigin-Name: 9bb4eafe1a60176ed2e731bb7e3067c0b8a46615
2017-02-02 14:40:06 +00:00
drh 6d683c5c6e Use the sqlite3_blob interface for reading values from the %_node shadow
table in RTREE.  This is a work in progress.  There are still some minor
problems.

FossilOrigin-Name: fc4917d730b29b0bf60fea5e0166728635783e9c
2017-02-02 02:28:45 +00:00
mistachkin 6890d3e458 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 0c66cf0f0a9ada2ddcb8d61001ef791b86226416
2017-02-01 23:06:17 +00:00
mistachkin 2fa517bf2a Fix C99-style variable declaration issue seen with older versions of MSVC.
FossilOrigin-Name: 54d285464a222c59327eb6c917c1cc0125a55a27
2017-02-01 22:59:29 +00:00
mistachkin 2e52532217 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 997f765bc6706769ae15f3e719354473e02bd78b
2017-02-01 22:43:08 +00:00
drh 31a1349515 Unwind the RTREE dimension loop inside of rtreeCallbackConstraint().
FossilOrigin-Name: 4854ea9c18e7d8066c90b41568d0fae97b01ea6d
2017-02-01 17:08:56 +00:00
drh 5db59b33c4 Completely unroll the dimension loop inside of cellArea() in RTREE.
FossilOrigin-Name: 3c4c0126c287f844220b65e00fec17c059fbb7c8
2017-02-01 16:41:30 +00:00
drh 0e6f67b754 Precompute the nDim2 value in the Rtree object and use that to make loops
over coordinates faster.

FossilOrigin-Name: f1f3c8cc733a05c12dd980f2dfa0ab4ccd76c04b
2017-02-01 15:49:02 +00:00
drh 03626e3812 Use compiler intrinsic functions (when available) for byteswapping in RTREE.
FossilOrigin-Name: 82fcd54a5941c20895ffc22d8009c1ebdae44eda
2017-02-01 15:24:32 +00:00
dan f62154d4ac Changes so that the pre-update hook and the sessions module work with WITHOUT
ROWID tables.

FossilOrigin-Name: 964bdc27f8f1b1db2e5c0c2a65c8156614cbe087
2017-02-01 14:10:24 +00:00
drh 14494fa712 More RTREE performance optimizations related to decoding values.
FossilOrigin-Name: c5395e7496d0cd593f5e16ee5f6719d020dc0c66
2017-02-01 02:25:28 +00:00
drh fcbd6cdb41 R-TREE optimization: unwrap the coordinate decode loop in
rtreeCallbackConstraint().

FossilOrigin-Name: 0bf7b51896ec441f62490964c7a44a3c75c6b7e2
2017-01-31 21:22:03 +00:00
dan 610e17bd91 Add a speed-test program for the sessions module.
FossilOrigin-Name: 25f1275fe3e940c1d9a7b013cb3744304b2eda1e
2017-01-31 17:31:30 +00:00
dan cb9a364390 Experimental change to invoke the preupdate hook when WITHOUT ROWID tables are
written.

FossilOrigin-Name: 856f8604c59c8fdd9bfb7d86fc0e212f091ab49a
2017-01-30 19:44:53 +00:00
dan f64ece143c Avoid redundant table b-tree cursor seeks in UPDATE statements that use the
two-pass strategy.

FossilOrigin-Name: dc555b1039c6930f6d15355c698ff917a85e8056
2017-01-28 19:45:34 +00:00
drh cc04dacb85 Add the sha1.c loadable extension that implements the sha1() and sha1_query()
SQL functions.

FossilOrigin-Name: 24e77c1cef163a9822635570b3211789ff23d5c9
2017-01-27 19:27:38 +00:00
drh 9ec82ff2ba Alternative ICU fix (compare to check-in [50e60cb4]) that avoids casting
integers to pointers.

FossilOrigin-Name: d9752c8f7c55426fd7d2b877c5cc3784f93b5349
2017-01-27 13:14:12 +00:00
drh 87f500ce43 Modify the ICU extension to use a static initializer, as VC++ complains about
a dynamic initialization.  Maybe the dynamic structure initialization is a
GCC extension.

FossilOrigin-Name: 50e60cb44fd3687dde5551d02bad60c323beaabc
2017-01-26 00:58:27 +00:00
drh 666d34c791 Fix SQLITEINT_H macro usage in two extensions.
FossilOrigin-Name: 0803390c152141c9ab4e7a28406b2a5d72a5c2fa
2017-01-25 13:54:27 +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
mistachkin 2f31d02049 In the 'vtshim' extension, avoid accessing freed memory when handling errors from xCreate/xConnect.
FossilOrigin-Name: ffd559afd32dcdce9c733ebccdee88fda9b689cf
2017-01-19 18:20:36 +00:00
dan 25fd2e247b Fix a problem that could cause a spurious SQLITE_NOMEM error when attempting
to resume an RBU operation if the previous client failed right after
completing the incremental checkpoint. Also a "cannot vacuum wal db" error
that could occur when resuming an RBU vacuum if an error (OOM or IO error)
occurs during the incremental checkpoint.

FossilOrigin-Name: 681d96eb822e606da53700867191d4738bda20c8
2017-01-17 10:41:42 +00:00
dan ef2f5925d8 Fix a problem preventing resumption of RBU operations after recovering from a
process or system failure that occurs during the incremental-checkpoint phase.

FossilOrigin-Name: 97914266cb4ec63b0c9185ab139673139bd2f0ed
2017-01-13 18:24:37 +00:00
dan 1439a1e80f Improve handling of corrupt data in fts5.
FossilOrigin-Name: 609ac1c73f7c2b48a571c178a72383996a9538fe
2017-01-06 11:55:03 +00:00
dan 895decf6b5 Avoid passing NULL pointers to memcmp() or memcpy(), even when the
"number-of-bytes" argument is passed 0.

FossilOrigin-Name: 56ff72ab44288296efc99a608f7edc4346366a50
2016-12-30 14:15:56 +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
drh c9c81dc6d7 Add the remember(V,PTR) extension function which copies an SQL value into
an application variable.

FossilOrigin-Name: d2d30914d81022d7d4e1670caf9326524520deaf
2016-11-30 16:54:52 +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 9c8753c0a8 Fix a problem in rtreeD.test causing it to fail in OMIT_BUILTIN_TEST builds.
FossilOrigin-Name: d6b3779e6dad038d8bc35139cf314bf1e6e91977
2016-11-17 20:05:00 +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
mistachkin 58282f68d8 Fix typo in the CSV extension.
FossilOrigin-Name: b4889588246c33374ff3758e21ccc4ce246380b6
2016-11-09 01:46:13 +00:00
drh 6850a63393 Fix OOM error reporting in the json1_group_object() SQL function. Remove
an unreachable branch from the JSON1 logic.

FossilOrigin-Name: b54098491531cd26ed461275ef4aae3d3ec9065e
2016-11-07 18:18:08 +00:00
drh 27b2d1b88b Replace some unreachable branches from the JSON1 extension with assert().
FossilOrigin-Name: 145cd13e3c5a42a717807bcc13c0f7212f38bff8
2016-11-07 15:15:42 +00:00
drh ad875e7416 Fix the JSON1 extension so that the JSON validator correctly rejects malformed
backslash escapes within string literals.

FossilOrigin-Name: 7a63539169a384960e30a63e0c8e9b0f07fa431e
2016-11-07 13:37:28 +00:00
drh b1c9633493 Mark the ICU extension functions as deterministic.
FossilOrigin-Name: afbbb6c66a85ff3f4c8dce677e0892a2a51d2b8e
2016-11-04 12:03:26 +00:00
dan e43635aaa7 In the sessions module, avoid recording a change if an UPDATE statement
overwrites a column with REAL affinity containing an integer value with the same value.

FossilOrigin-Name: b861328ab9ceec6926d97658c3606e6ae9ad39bf
2016-10-21 21:21:45 +00:00
dan e24452edef Avoid using the "direct overflow read" optimization to read large blobs if the
pager layer has a wal file open - even if the database header indicates that
the db is not a wal database.

FossilOrigin-Name: b54c15f11796a75683eec4b502a22ccb87d621c6
2016-10-21 10:49:39 +00:00
mistachkin 47d00872fc Escape non-ASCII character from an ICU extension comment.
FossilOrigin-Name: 5ec02ecf3d20ce7e3f5249e9a3684f9b67a7d703
2016-10-17 18:44:11 +00:00
dan ef74652ceb Remove a stray line from session4.test causing a memory leak. No changes to SQLite code.
FossilOrigin-Name: 6624c4964b63e259d5ee006eaa7ec79ddadbd6a6
2016-10-10 14:48:36 +00:00
dan ea5e5f0b89 Fix a case in which the rtree module was ignoring an OOM while generating an error message.
FossilOrigin-Name: 788f86bebe413b5a0ab41ba3d75ba8728827a964
2016-10-10 10:06:59 +00:00
dan 642f0146d7 Fix some compiler warnings in fts5.
FossilOrigin-Name: b066637bb75959267fe6104da323c5112ad78f82
2016-10-05 20:14:29 +00:00
drh 5e769a50ad Two more typo fixes in comments.
FossilOrigin-Name: 40c0fb0af678797c39a99853f9f4102464c16f4b
2016-09-28 16:05:53 +00:00
drh ed204d1f44 Fix typos in comments. No code changes.
FossilOrigin-Name: 5bbd071d57a8048e2ca17bf97761e4f27fc5a6bf
2016-09-28 16:04:22 +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 12c56aa452 Fix a bug in sqldiff causing it to confuse blobs zero bytes in size with NULL values.
FossilOrigin-Name: 264e9c75875796cad773d39b775d4604546bc57a
2016-09-12 14:23:51 +00:00
drh d609bdb9d3 Add the ext/misc/memvfs.c extension that implements a VFS for read-only
database files contained in memory.

FossilOrigin-Name: 12b7782a9af91eab913e159149cb28b3f5a6557c
2016-09-07 18:11:11 +00:00
dan e5a0cfa161 Have "sqldiff --rbu" ignore rows with NULL values in primary key fields. RBU can't handle such rows and the documentation already says sqldiff ignores them. Because the code now uses "=" instead of "IS" to filter on primary key columns, diffs on virtual tables are faster now too.
FossilOrigin-Name: f4ba894a86aa195bcbe2fa69e91cd870ec3fb577
2016-09-01 14:03:28 +00:00
dan a87070a271 Use some of the example code from the sessions documenatation in the sessions test cases.
FossilOrigin-Name: 6602974d17536bcb904a794bddedffd58926794b
2016-08-29 14:18:18 +00:00
drh 2e5c5052fd Fix typos in comments. No changes to running code.
FossilOrigin-Name: a07269f2a0f87e0b736127f528f6caf3b63f9052
2016-08-27 20:21:51 +00:00
dan 6650190891 Fix some comments in sqlite3session.h. No changes to code.
FossilOrigin-Name: 78cd64e202fcbe9ce69070b0f48ccd0c6b48538d
2016-08-27 18:35:55 +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
dan 460d38f15e Fix an fts5 problem with corrupt database handling found by address-sanitizer.
FossilOrigin-Name: e22252e1da4cd9e41b970970a1c4f466aa6cc133
2016-08-13 10:34:12 +00:00
dan 3b96d1e2e4 Fix a buffer overread in fts5.
FossilOrigin-Name: fcfbee6c7d33a9ae7feb46044a0c2fe680460d39
2016-08-13 06:38:31 +00:00
dan 1bf4ca7c42 Add the "modeof=<filename>" URI parameter to os_unix.c - used to specify a file to copy permissions from when a new database is created. Also allow passing NULL as the second parameter to sqlite3rbu_vacuum().
FossilOrigin-Name: ed406d31ff54ee3de8db91690a966e5c561f8f94
2016-08-11 18:05:47 +00:00
drh c73bd0a5cc Fix a harmless compiler warning in FTS5.
FossilOrigin-Name: 2ea0c8b46eefd4874f021f8dfd344be751f2034f
2016-08-11 01:24:56 +00:00
drh 6bada27205 Prototype for the remember(V,PTR) extension function.
FossilOrigin-Name: f0942c362f45ca1e986e142dbdd3ad957626dfb1
2016-08-09 21:08:42 +00:00
drh 8d57d7af23 Fix harmless compiler warning.
FossilOrigin-Name: 9a5a4f6e3bc265fecf79a7f63d14abbf239da636
2016-08-09 21:01:52 +00:00
dan ccf03677a3 Minor update to the way fts5 column filters are parsed.
FossilOrigin-Name: 14864f2b8470fe98dbd17f59963bf1be8d4962f9
2016-08-09 19:48:37 +00:00
dan 882ef0b8c0 Have fts5 interpret column lists that begin with a "-" character as "match any column except" lists.
FossilOrigin-Name: e517545650631d1e8a7ee63c6646a8b183a0a894
2016-08-09 19:26:57 +00:00
drh 6da466e4f4 Fix documentation typos. No changes to code.
FossilOrigin-Name: ebc396a19fa79bea208ecda277ffff5d02166d0b
2016-08-07 18:52:11 +00:00
drh b0df540d7a Fix other harmless compiler warnings.
FossilOrigin-Name: 90d2c490fc2ed4e073711b84f989ca4d496dcfb5
2016-08-01 17:06:44 +00:00
mistachkin c08556844e Add macro necessary for building several extensions when the __stdcall calling convention is not in use.
FossilOrigin-Name: bc8c9b55ddf5227dc6b2116486f4a19bf54fce2b
2016-07-29 01:31:49 +00:00
mistachkin 2d45d7bfab Missed a couple Tcl command deletion callbacks.
FossilOrigin-Name: fc5c187602acceedf7152b6927616d134f779a8f
2016-07-28 23:58:25 +00:00
mistachkin afe18262b4 Use the SQLITE_TCLAPI macro in several extensions that were missed in the previous check-in.
FossilOrigin-Name: df2543652b835353c03956dfbd3e35e5b191372e
2016-07-28 23:54:45 +00:00
mistachkin 44e95d4f02 Make the extension auto-loading mechanism work with the __stdcall calling convention. Also, fix a couple Tcl command calling conventions missed in the previous check-in.
FossilOrigin-Name: 3ea567c4b07b2a7a027b9b5cb8250ab687803698
2016-07-28 22:23:26 +00:00
mistachkin 7617e4a8a4 Make sure the SQLITE_TCLAPI macro is always defined.
FossilOrigin-Name: f2f1323cc4d2ad2d6794dbfae8d50b747213e85d
2016-07-28 17:11:20 +00:00
mistachkin 52b1dbb5fc Allow the 'testfixture.exe' target to be compiled with the __stdcall calling convention.
FossilOrigin-Name: e8be3dfeabaa31b3490793cf8230faae1204be15
2016-07-28 14:37:04 +00:00
mistachkin 69def7ff2f Work in progress on setting a calling convention for all callback functions.
FossilOrigin-Name: 02b8040e1add02734d2dbc6c59737ab74ff8fb18
2016-07-28 04:14:37 +00:00
dan 2900a6222f Ensure that the sqlite3_scrub_backup() extension creates a backup database at least as large as indicated by the database header, even if the last page of the input database is a free-list leaf.
FossilOrigin-Name: 483994a54dee3c7a3801e0e9d3c96fa9dbd8d2fd
2016-07-26 10:46:21 +00:00
drh 07d9a03187 Fix a test case in FTS5 to make it compatible with Tcl 8.5.
FossilOrigin-Name: a495f8e77e14241150f79e746c7303284f04621a
2016-07-25 21:11:53 +00:00
drh 2ce26ff10a Add the json_quote() function to the JSON1 extension.
FossilOrigin-Name: 269892abf6e59c417729669cc764d1f237e093fd
2016-07-23 19:34:53 +00:00
mistachkin a4c07346b7 Revise a warning fix from the previous check-in to improve clarity. Also, fix an incorrect test prefix (typo).
FossilOrigin-Name: f50a3fd6606c14b82c9b938bfca284d54b6c650f
2016-07-22 21:35:38 +00:00
mistachkin 80f2b33a12 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 8bb6e6fcedf7d0ae796b8848593106c921ebf21a
2016-07-22 21:26:56 +00:00
dan 12ca5ac3d2 Fix a problem with upper case module names in the "sqldiff --vtab" command.
FossilOrigin-Name: 87e25fc472604b3978811be53991104c665a95e7
2016-07-22 10:09:26 +00:00
dan 033ac6af7e Add extra test cases to verify the fix in [64ca1a835].
FossilOrigin-Name: bf98a2de7ed41a8acca89d7369b353f12182cfb4
2016-07-21 18:02:20 +00:00
dan 8414e81359 Add the largely untested SQLITE_FTS5_NO_WITHOUT_ROWID compile time option to fts5. For building a dynamically loadable extension that does not use WITHOUT ROWID.
FossilOrigin-Name: d0a1cf1c56c237617fb73cb31f4950365b1f3e9b
2016-07-15 19:17:19 +00:00
drh eb5a549ecf Disable the CSV extension when virtual tables are disabled.
FossilOrigin-Name: ec7180892ac737f0731cf61f2d095a5c1d18ad93
2016-07-15 02:50:18 +00:00
drh ce0442edf3 Fix header comments and remove an unnecessary version restriction from the
carray() table-valued function implementation.

FossilOrigin-Name: 021d0fb8d85e44839d2b4fdb90b15f0e1f2442e6
2016-07-13 00:55:28 +00:00
drh 11499f0ab4 Fix compiler warnings on windows.
FossilOrigin-Name: 8b22f777a11438ab0baadc7d9e471f415b734d1f
2016-07-09 16:38:25 +00:00
dan 2e993288e6 Add the sqlite3rbu_state() API. Used to determine the current state (creating OAL, ready to move OAL, incremental-checkpoint, finished or error) of an RBU operation.
FossilOrigin-Name: 0357875fbb1bb462feef5121287b2f84da88e497
2016-07-04 11:47:48 +00:00
drh 2e3f87ae84 Change the name of the intarray() extension to carray() and give it an
optional third parameter that specifies the datatype as one of 'int32',
'int64', 'double', or 'char*'.  'int32' is the default.

FossilOrigin-Name: a204ba99db34b356acb259189158a32d2df25da0
2016-07-03 02:35:47 +00:00
drh ba637157ca Fix an off-by-one comparison in the intarray() virtual table. Get the
intarray() virtual table tests working using the legacy makefile.

FossilOrigin-Name: 7c3d441f2a9f642f3d91dcee854a4d16d298bc34
2016-07-02 20:57:06 +00:00
dan e336b8914c Add the sqlite3rbu_state() API. Used to determine the current state (creating OAL, ready to move OAL, incremental-checkpoint, finished or error) of an RBU operation.
FossilOrigin-Name: 92e7df0ff5c4c118c63d92a767dc82700438a310
2016-07-01 12:39:58 +00:00
drh 4841624ab9 Add a prototype intarray($PTR,$N) table valued function.
FossilOrigin-Name: 233b33382dc70de45f90b6dfdb5785f20b21489e
2016-06-29 05:00:30 +00:00
dan 9c987a833c Update the sqldiff utility so that if the --vtab switch is specified "rtree", "fts3", "fts4" and "fts5" tables are diff'd directly and the underlying real database tables ignored. Without this switch, all virtual tables are ignored and the diff is performed on the underlying real tables.
FossilOrigin-Name: 5d0a9d4c45730e47576bc77373fa7075a74051a5
2016-06-21 10:34:41 +00:00
drh 2ad96f5880 Add the json_quote() function to the JSON1 extension.
FossilOrigin-Name: 2c3714aebf5e40e3728877a235b3c1f93defa33e
2016-06-17 13:01:51 +00:00
drh c14566aff3 Fix RBU so that it builds with -DSQLITE_ENABLE_8_3_NAMES.
Fix "PRAGMA compile_options" for SQLITE_ENABLE_8_3_NAMES such that it reports
the numeric setting: "1" or "2".

FossilOrigin-Name: 0230ca17ba20ecd3d213788ad6891973d52a7b72
2016-06-13 19:58:46 +00:00
drh a4680a8b19 Add support for virtual tables using a WITHOUT ROWID schema. This merge also
includes enhancements to the CSV extension, which is used for testing of
the new WITHOUT ROWID virtual table mechanism.

FossilOrigin-Name: aa7e9d0cc15c050205b09d5a50f985e4ade571d0
2016-06-03 18:44:43 +00:00
drh c576b27580 Enhance the sqlite3_load_extension() interface to permit extensions to
return SQLITE_OK_LOAD_PERMANENTLY which will prevents unloading when
the database connection closes.

FossilOrigin-Name: 5908aa4dc59925c414b236b6fd3d3ecd7f3da435
2016-06-03 13:35:55 +00:00
drh ac9c3d2c18 Performance optimizations on the CSV virtual table. Disallow WITHOUT ROWID
virtual tables that have an xUpdate method, for now.

FossilOrigin-Name: 3134b3266c36c9d018e8d365ef46ef638c0792f4
2016-06-03 01:01:57 +00:00
drh 35db31b24b Add the CSV extension to the test fixture. Fix a memory leak in the CSV
extension.  Add test cases for the CSV extension, including one that uses
a WITHOUT ROWID virtual table participating in the OR optimization.

FossilOrigin-Name: 95f483e86e30ae68108904400e18ed41d389446b
2016-06-02 23:13:21 +00:00
drh adcba64df4 Add the data= parameter to the CSV virtual table extension.
FossilOrigin-Name: 769191042aa14e6eccdfe2391fc1011171d5c9ad
2016-06-02 17:44:24 +00:00
dan 82a1c0e5bb Fix an issue preventing RBU vacuum from working with virtual tables.
FossilOrigin-Name: 3bd85fa5a9a489fd505c973e37c33a76c1b0e957
2016-06-01 10:37:50 +00:00
mistachkin 9f6e686f59 Fix compilation issues with the VFS stat extension.
FossilOrigin-Name: f6e956525b03fa07190e5521edac4758c386cc80
2016-06-01 05:02:05 +00:00
drh 1fc1a0f280 Add the columns=N parameter to the CSV extension.
FossilOrigin-Name: 28ebeadd6a4c9ff2ce9fc86a0f0fe2f6cf94d3ac
2016-05-31 18:44:33 +00:00
drh abfd272b59 Add the testflags parameter to the csv extension.
FossilOrigin-Name: b93fb2fe0df1b3bea2bc2a4e1528da74ab290593
2016-05-31 18:08:35 +00:00
drh 724b18966d Add the "csv" virtual table for reading CSV files, as an extension in
the ext/misc/ subfolder.

FossilOrigin-Name: 00d3570c8bb96469c984903e20de589e998d4636
2016-05-31 16:22:48 +00:00
dan 0df5024e83 Fix an FTS5 problem (segfault or incorrect query results) with "... MATCH 'x OR y' ORDER BY rank" queries when either token 'x' or 'y' is completely absent from the dataset.
FossilOrigin-Name: 64ca1a835a89fd211078d2cd8f9b649e89be528d
2016-05-30 08:28:21 +00:00
drh 66bf810467 Remove an unnecessary malloc from the vfsstat extension.
FossilOrigin-Name: 24f258c2392290168cf34622b89a4a406a3dd853
2016-05-28 17:45:15 +00:00
drh c1502e2f4f Enhance the sqlite3_load_extension() interface to permit extensions to
return SQLITE_OK_LOAD_PERMANENTLY which will prevent the extensions from
unloading when the database connection closes.

FossilOrigin-Name: d3f99a5e8d0486d0917dfe96987c179a6f63b850
2016-05-28 17:23:08 +00:00
drh 3c40ae7d3a Add the vfsstat.c loadable extension - a VFS shim that measures the amount
of I/O, and an eponymous virtual table that is used to extract and view
the measurements.

FossilOrigin-Name: 0987487dd4ebfcf66ddeec8ceca47775216a0887
2016-05-28 14:53:48 +00:00
drh f1e2c8e1ff Fix the rtreeG.test test case.
FossilOrigin-Name: 9589e9377118efc356c73ea1aab2d7e6c2f7fc36
2016-05-23 18:27:07 +00:00
drh e62c2fe179 Fix RTREE so that it does not run queries against the sqlite_stat1 if that
table does not exist.

FossilOrigin-Name: 48526a2fe5373e3d19e8b813cc8a342d6b7c9c3d
2016-05-23 18:12:04 +00:00
drh daa14559d2 Remove an extra "finish_test" from the end of rtreeC.test.
FossilOrigin-Name: bfbb6dd84b5e1335e1eae857a03fa33a71fd67a5
2016-05-23 18:06:51 +00:00
dan 5782bc27fa Improve the error messages generated by the rtree module when a constraint fails.
FossilOrigin-Name: 3ad2531efb64b7c53b777ddf3681203217052b32
2016-05-23 16:16:13 +00:00
drh 0d2c3a0e11 Enhance the scrub utility program so that it does a FULL checkpoint prior to
starting the backup, to ensure that the database file content matches what needs
to be backed up without having to look at the WAL file.

FossilOrigin-Name: ab1c5ce50f139070d7a322f43132a93c8af2ed68
2016-05-17 21:17:51 +00:00
drh 8884d99926 Merge the latest changes from trunk.
FossilOrigin-Name: 5021dfe1f3f723a5938d547a0308f1d63103702d
2016-05-17 17:11:21 +00:00
dan ba1079ba2a Update a comment in fts5.h. No changes to code.
FossilOrigin-Name: 14e53d0e2f62d82ae1d64a72fd9711548e3bf5ea
2016-05-09 19:03:42 +00:00
dan 170b66493d Fix the FTS5 xQueryPhrase() API function so that it recognizes column filters.
FossilOrigin-Name: 48505cde05d74748454dc135d4ec25954ecf020e
2016-05-09 18:05:44 +00:00
drh 8271630e81 Additional error reporting. Open the source database read/write so that
it can delete the WAL file when done.

FossilOrigin-Name: d2efd3c176f0eba2d78105f0bb3161db38bd4bab
2016-05-05 23:59:22 +00:00
drh e04369e29e Working when run against sqlite.fossil.
FossilOrigin-Name: b0bd9dd6255be161ea289ba6caa3fbd568128f62
2016-05-05 23:39:30 +00:00
drh 2a9bd02645 Finished implementation compiles, but untested.
FossilOrigin-Name: aeb88bdf6fe9e5839b1503ab5740b27bc09d4842
2016-05-05 23:09:57 +00:00
drh da110bfece Initial check-in of the "scrub.exe" utility program prototype. Not yet
fully functional.  In particular, no scrubbing is done.

FossilOrigin-Name: bdf2ec77d1542d4e9b68218f558710a3efc15823
2016-05-05 17:15:23 +00:00
drh 4e80d5fcf1 Disable the session extension API if SQLITE_ENABLE_SESSION is not defined.
FossilOrigin-Name: 71af9ac165ac02272f4886f69bd9ab4770fd7bb6
2016-05-04 21:06:21 +00:00
drh 48cd59a57d Avoid left-shifts of signed integers.
FossilOrigin-Name: 0715ce164333e27671efbec8796f238df98cc287
2016-05-03 00:04:55 +00:00
dan 14faa061fd Fix an almost entirely harmless buffer overread in the sessions module.
FossilOrigin-Name: 89b0ee3351381f7bc666cb206f77a56f2e0d4a0e
2016-04-29 10:13:22 +00:00
dan 05accd2216 Modify the permutations.test script so as to set any permutation specific configuration values before running each individual test script.
FossilOrigin-Name: 2662d8fef791f7b8b3b14f9c27dfedec84620dee
2016-04-27 18:54:49 +00:00
dan ae20690e2c Update the RBU vacuum code so that databases that use custom collation sequences can be vacuumed.
FossilOrigin-Name: 7dd48c10790a7b9c4165214399c261a0aa701297
2016-04-25 19:25:12 +00:00
dan b7a208686a If a call to sqlite3rbu_close() on an rbu handle opened by sqlite3rbu_vacuum() returns other than SQLITE_OK, delete the contents of the rbu_state table. This ensures that if an RBU vacuum operation either completes successfully or encounters an error, the next call to sqlite3rbu_vacuum() with the same parameters starts a new RBU vacuum operation.
FossilOrigin-Name: 6e4ac704f51bdd1e0b16814f6a45ab29f26400ee
2016-04-21 16:44:38 +00:00
dan 2e8bfb67d4 Fix a problem in rbu vacuum on tables with a large sqlite_master table.
FossilOrigin-Name: 23eac52e987996afe8db847921aef434cebd25b5
2016-04-21 15:26:26 +00:00
dan 94d49697b5 Add a documentation comment for sqlite3rbu_vacuum() to sqlite3rbu.h.
FossilOrigin-Name: da5c753ddac3cbfdf03710a82f5fd9fa2e29e819
2016-04-20 20:08:58 +00:00
dan 132dde5cdf Add fault injection tests for rbu vacuum. Fix some problems revealed by the same.
FossilOrigin-Name: f042fdd1ea7febec7228e51efc2b0281805e196a
2016-04-20 17:47:52 +00:00
dan 1aea63032a Updates to ensure the values of PRAGMA settings like "page_size", "auto_vacuum", "user_version" and "application_id" are not lost when a database is RBU vacuumed.
FossilOrigin-Name: 74ffea76b8c9ddd7699ce6ca77dce005bd7922ac
2016-04-19 19:27:09 +00:00
dan 46f0035b48 When an RBU vacuum is started on a db identified using a URI filename, pass the same URI parameters when creating the new version of the db. This ensures that RBU vacuum works with password protected databases.
FossilOrigin-Name: ca021ba88106500f347ed65199a4832bc9eb5ef8
2016-04-19 17:11:05 +00:00
dan bff4b6367c Detect attempts to use rbu vacuum on a wal mode database (not allowed). And attempts to write to a database in the middle of an rbu vacuum (which prevents the vacuum from resuming).
FossilOrigin-Name: 00b2f4b09ffca5156e43c4db2bfe0b2c979c49b0
2016-04-19 16:20:24 +00:00
dan 58e3812988 Another fix to rbu vacuum for a zipvfs case.
FossilOrigin-Name: 29407d70e44ad9ea5ddaf1011d0e212b602a3ddf
2016-04-18 21:00:01 +00:00
dan beccf1d16f Fix some zipvfs related problems in RBU vacuum.
FossilOrigin-Name: d76f4aaa4caab713460421bd27365a82ac986c20
2016-04-18 18:18:18 +00:00
dan 303a094466 Add the -vacuum switch to the "rbu" demonstration program.
FossilOrigin-Name: 9a0078a538c7e73a009960347b8953c5af99fefd
2016-04-18 09:17:05 +00:00
dan 2bb5f4478e Changes so that rbu vacuum works with zipvfs databases.
FossilOrigin-Name: bae7f875f476f6e01112751cb404fef42ba0a01c
2016-04-16 19:02:53 +00:00
dan 977cbe78b3 Avoid creating any extra files ("<target>-vacuum") when running an RBU vacuum. Ensure that the OAL file created is "<target>-oal", not "<target>-vacuum-oal".
FossilOrigin-Name: dc19aacc7e99213edca9bb57b5c11a8a1ac99113
2016-04-16 17:53:14 +00:00
dan f89157653a Add the experimental sqlite3rbu_vacuum() API function. For opening an RBU handle that rebuilds a database from scratch.
FossilOrigin-Name: 0216b48f28042ad86711e00802c2da8ce9be3044
2016-04-15 20:46:41 +00:00
dan 5313f2e12e In the ICU extension toupper() and tolower() SQL functions, avoid calling u_strToUpper() or u_strToLower() a second time if the buffer passed to the first invocation turns out to be large enough.
FossilOrigin-Name: d23e581351fb8eea28e7b13b3dcadfc817c3a05f
2016-04-14 17:29:13 +00:00
mistachkin 02d436b1f6 A couple more compiler warning fixes.
FossilOrigin-Name: 929fa4c31e7c5b8c6cbb1412478ea91b15ad5529
2016-04-12 20:26:51 +00:00
mistachkin c5896b5cbb Even more compiler warning fixes.
FossilOrigin-Name: 7faec9ea335c53953338886398b85aef87348a1c
2016-04-12 20:15:12 +00:00
mistachkin 77fac879d2 More harmless compiler warning fixes.
FossilOrigin-Name: ab69527c1608da0b668f3b49e967661dd99cc3d4
2016-04-12 20:05:06 +00:00
mistachkin 02267cc213 Compilation fix for a C99-ism in the 'fts3view' tool.
FossilOrigin-Name: bedb88a4b9c808ea781ae69058399a1a3a3d15fa
2016-04-12 19:30:31 +00:00
mistachkin 74f598b677 Fix harmless compiler warnings in the 'session' module.
FossilOrigin-Name: a18a6ce2271865d04cd75a8a5baa63798b7393db
2016-04-12 19:20:22 +00:00
dan 0d0a2abc6a Add another OOM test to this branch.
FossilOrigin-Name: 49763fc3ae2fb6117b0443ea28661568467f9bf2
2016-03-31 15:08:10 +00:00
dan 5f5663dc23 Add further tests for the code on this branch. Fix a problem in OOM handling.
FossilOrigin-Name: 195f3340ee4d870420e4f58d44300bab5436b920
2016-03-31 10:50:26 +00:00
drh c8be643733 Enhanced comments describing the sessions file format. No changes to code.
FossilOrigin-Name: 84dc41e2df1092e9724a535b670343181a9cd0dd
2016-03-31 02:44:56 +00:00
drh 7e0765a9ec Fix the return code in sessionRetryConstraints().
FossilOrigin-Name: ea917c14b940f95b20b91dae77567dc25a651ef6
2016-03-31 00:45:58 +00:00
dan d915152677 Have the sqlite3session_apply() function and its streaming equivalent retry any operations that failed with SQLITE_CONSTRAINT after all other operations on the same table have been attempted. New code is largely untested.
FossilOrigin-Name: 1085911afb51744f32fe9db183b50e8e88bdd73e
2016-03-30 21:19:00 +00:00
drh 565d64014b Merge the beta changes into sessions.
FossilOrigin-Name: beb5ea1439995fb8ab112451a8ffcc08fe42d0c4
2016-03-24 14:34:26 +00:00
drh 997de998a8 Remove an unused local variable from FTS5.
FossilOrigin-Name: 0ed693c29f184223cde3b3d51f0e06273e586803
2016-03-23 15:53:45 +00:00
dan 848b190e40 Explicitly limit the size of fts5 tokens to 32768 bytes.
FossilOrigin-Name: 70fc69eed9b09159899d7cbd1416a59d04210a63
2016-03-23 15:04:00 +00:00
dan 0a2f2b546a Fix some errors in fts5 test scripts.
FossilOrigin-Name: e1ab2d376a72786098125a41c1ea8140fcbd15c6
2016-03-22 15:01:54 +00:00
drh 13969f5af0 Fix harmless compiler warnings.
FossilOrigin-Name: 25d776e4523aefeec007943fe29aa17c23ccb301
2016-03-21 22:28:51 +00:00
dan 6737aab5cf Add tests to ensure that fts5 is now deterministic.
FossilOrigin-Name: 3d076094ce411bffcfeb76c0284d15d0f83bd459
2016-03-21 16:25:34 +00:00
drh dbf8a16cb3 Merge 3.12.0 beta changes from trunk.
FossilOrigin-Name: 3296a0ceedef43c2790f0b36471f91138a575243
2016-03-21 15:32:19 +00:00
dan f5268268b7 Have fts5 cache the structure of its index in main memory. Use "PRAGMA data_version" to figure out when this cache should be invalidated.
FossilOrigin-Name: 902f221754f3cc6fb4ae049c135f85efce604ed3
2016-03-21 15:30:50 +00:00
dan 3c6707f72b Rearrange code so that tests pass whether SQLITE_DEBUG is defined or not.
FossilOrigin-Name: 89296a46c3b891ee0b637ff6f89d828d6e46e7b5
2016-03-21 15:18:13 +00:00
dan ef480d37dc Change the way fts5 internally allocates segment ids in order to eliminated non-determinism from the module.
FossilOrigin-Name: d6e2637df16764aa9723a30ea2eb8a631d28cb2b
2016-03-21 09:56:19 +00:00
dan fce07fb944 Fix a problem detecting invalid values in the rbu_control column of an rbu database table.
FossilOrigin-Name: a1132dd9027d1c6dd845be307eeb38e535393f2c
2016-03-19 17:09:30 +00:00
dan febfe02300 Update the sqldiff tool so that it generates an rbu_count table.
FossilOrigin-Name: 1f7afb6e9be9f549a91bf2ab492df15698df89fd
2016-03-19 16:21:26 +00:00
dan f11737fcc8 Merge latest trunk changes, including fixes to test script rbudiff.test, into this branch.
FossilOrigin-Name: 734fc68fb12f06e97026d4637138b82b37809f5b
2016-03-19 15:34:42 +00:00
dan 1e8dae0e43 Fix test scripts sqldiff.test and rbudiff.test so that they work with the --testdir option.
FossilOrigin-Name: 1ffe3cde03f924bb8405a8729c8e1bc01f5b6d3b
2016-03-19 14:53:36 +00:00
dan cf9bce34ab Add test file fts5multiclient.test.
FossilOrigin-Name: 7832466f9177cca59455ba272802145297fcd53d
2016-03-19 14:47:28 +00:00
dan eea627da9e Add further tests for sqlite3rbu_bp_progress(). Fix a problem in handling WITHOUT ROWID tables in the same.
FossilOrigin-Name: 65e02368e2b6cec349ea71af5a456d6783b0d15e
2016-03-18 20:12:28 +00:00
dan 789780d8f6 Change the name of the new API on this branch to "sqlite3_bp_progress". Add tests and documentation for the same.
FossilOrigin-Name: 1a1b69e87eb7d18f76f5b733e44da75136a686b6
2016-03-18 18:56:45 +00:00
dan fe485c0e56 Add tests for the changes on this branch. Fix a problem with calls to the new progress indicator API made after an rbu update has been resumed.
FossilOrigin-Name: bf82321724d3b0feb51e26d9b76090e03cc3964a
2016-03-18 10:29:47 +00:00
drh 860443da10 Fix FTS5 so that it works with SQLITE_OMIT_AUTORESET.
FossilOrigin-Name: b199637d81d7e2a767131ac03c7679b101fd459c
2016-03-18 00:39:40 +00:00
dan e42195b044 Add an API to indicate the percentage progress of an rbu update.
FossilOrigin-Name: ffc58d2c2576a5b6e1c2c7112612c5760e711afd
2016-03-17 21:06:42 +00:00
dan c9460ab989 Fix some OOM-handling issues in the fts5 changes on this branch.
FossilOrigin-Name: 020a0bda59fe93b9361ceeed0d5a8ba4177380c8
2016-03-17 12:39:56 +00:00
dan db8d320d63 Merge the changes on the reusable-pragma branch into this one.
FossilOrigin-Name: 6c4a17b963916d19c9433d7a251338042f32e9fa
2016-03-16 20:53:33 +00:00
dan 377ba38429 Add a cast to an implict (size_t -> int) conversion in fts5_expr.c.
FossilOrigin-Name: d9b5ff7aba3a8f6ca4505eac308fa9d510254c3e
2016-03-16 19:53:58 +00:00
dan f55fb6615b Have fts5 cache the decoded structure of fts5 indexes in memory. Use "PRAGMA data_version" to detect stale caches.
FossilOrigin-Name: 33ef2210ef19e55c8d460bfe9d3dc146034c8acc
2016-03-16 19:48:10 +00:00
drh 47e1842e5b Merge all recent enhancements from trunk.
FossilOrigin-Name: 6a7ee04b0ddac36a87d5ed2ac89a53e537f4d5a3
2016-03-16 01:16:30 +00:00
dan 7d85774da8 Fix a memory leak in fts5 that could occur following a syntax error in a query expression.
FossilOrigin-Name: 54b8968e335760105206b894672213c1d56771a4
2016-03-14 12:16:23 +00:00
dan 5cf98f101e Fix a problem handling 'NEAR("" token)' in fts5 found by fuzzing.
FossilOrigin-Name: 10a827ae5f3f322af836c15e581fdc958a433a5a
2016-03-12 19:33:47 +00:00
dan e8c20120ce Fix handling of strings that contain zero tokens in fts5. And other problems found by fuzzing.
FossilOrigin-Name: 72b3ff0f0df83e62adda6584b4281cf086d45e45
2016-03-12 16:32:16 +00:00
drh 811f17bac0 Update spellfix1_scriptcode() to output 215 (latin) for pure numeric text.
FossilOrigin-Name: df44308b862e932ff0ad25b6328d13be22047b96
2016-03-11 14:30:18 +00:00
dan 1bb85f3ed3 Add tests to cover untested branches in recent fts5 changes.
FossilOrigin-Name: fa0033edf6ddf3c6631fa95b343225dbc8ac9429
2016-03-10 15:12:47 +00:00
drh 6459ca0b8c Remove an unused local variable.
FossilOrigin-Name: 3c343c3d012367942037e64a9855b825cb459844
2016-03-10 14:22:42 +00:00
dan 4dbc65b29a Add an incremental optimize capability to fts5. Make the 'merge' command independent of the 'automerge' settings.
FossilOrigin-Name: 556671444c03e3afca072d0f5e9bea2657de6fd3
2016-03-09 20:54:14 +00:00
dan 57ebc84a6e Fix a problem in fts3/4 that was causing it to discard data cached in-memory if an 'optimize' command is run when there is no data on disk. The usual way this would happen is if the very first transaction that writes to the fts3/4 table also includes an 'optimize' command.
FossilOrigin-Name: 79338b991bf01e81d336790ca87a0fa747da4ff3
2016-03-09 18:17:42 +00:00
drh 15d36c603d Remove an unused goto label in the RBU extension.
FossilOrigin-Name: 2179a106e8dd7943d4f37093e65ce7826720904e
2016-03-08 16:02:37 +00:00
dan d0b8b664bd Add a new row type to RBU (a peer of insert, update and delete) - "delete then insert".
FossilOrigin-Name: 1d9468d2427d2c9b7240b364554ac85a0b62fa44
2016-03-08 15:52:43 +00:00
dan c7dbce0f2a Update fts3/4 so that the 'merge=X,Y' command merges at least, instead of exactly, Y segments from a single level. This matches the documentation. 'merge=X,0' is, as it was in 3.11, an error.
FossilOrigin-Name: 64b3cb29159491cbfab7e01844b54408541ece5e
2016-03-08 15:37:48 +00:00
dan 108b7953ed Update fts3/4 so that the 'merge=X,0' command merges X pages from all segments of the first level in the fts index that contains 2 or more segments.
FossilOrigin-Name: cddf69dbc46f10ee7e87538dd850e086386b544c
2016-03-07 20:14:27 +00:00
drh c5c67abb9a Merge the virtual table query planner enhancement, the RTREE cost estimate
fix, and the statement journal spill delay enhancement from trunk.

FossilOrigin-Name: 17fd8f3cf0ec565e08403dc8e10a1cffc2bbe165
2016-03-07 17:49:17 +00:00
dan e45216fd9d Add a new row type to RBU (a peer of insert, update and delete) - "delete then insert".
FossilOrigin-Name: 169311c85b30f625bdb6986c9cd11db70942d73b
2016-03-07 17:39:30 +00:00
drh 2ea74dc805 Adjust the cost estimates for RTREE such that the expected number of rows and
expected cost is halved for each additional constraint.

FossilOrigin-Name: fd7cd0609381a85673d1f737ebeb19dde3de180f
2016-03-05 20:28:24 +00:00
drh 2606aca80f Merge recent enhancements from trunk. Default page size is 4096. Writes
to statement journals are avoided.

FossilOrigin-Name: 456df3365e2df60e34762f2024bb551538b3f72b
2016-03-04 16:42:43 +00:00
drh 2b33f6e775 Allow the left-hand side of IN operators on virtual tables to have the
aConstraintUsage[].omit flag clear.

FossilOrigin-Name: 3eb74342740cd393e03aa38cd01690ccab173b76
2016-03-03 20:42:18 +00:00
drh 5b38201708 Merge 3.11.1 changes into trunk.
FossilOrigin-Name: 7abc2dd953477797fa05421b061d73596aa025fb
2016-03-03 17:54:30 +00:00
drh 2396fce54e Increase the default upper bound on scope to 30.
FossilOrigin-Name: b1258814f6100f594210775e9e3007b5b0c65025
2016-03-03 15:16:15 +00:00
dan e18ec6acc2 Fix an error in an fts5 test script.
FossilOrigin-Name: b2a03e2d479aec2fc68dfc83a1fa34c740f44e13
2016-03-02 13:26:19 +00:00
drh dbc49161c0 Allow the left-hand side of IN operators on virtual tables to have the
aConstraintUsage[].omit flag clear.

FossilOrigin-Name: 1622623cbbfc4325c53d731aba78ca9c382ec612
2016-03-02 03:28:07 +00:00
drh 47784529cc Add the optional -DSERIES_OMIT_CONSTRAINT_VERIFY=0 option to the series.c
extension that implements the generate_series() virtual table.

FossilOrigin-Name: 3d9daa929c0abe6dc01e800ef343b0eef2f0c76a
2016-03-02 00:58:49 +00:00
dan bce50c734b Do not attempt to run fts5bigtok.test or fts5merge2.test if FTS5 is not compiled in.
FossilOrigin-Name: f7ed373953c2dea0919a85dfb461dfef512cd5fc
2016-03-01 16:56:26 +00:00
drh fb02bad04f Remove a forgotten "breakpoint" command from an FTS5 test script.
FossilOrigin-Name: 61927c8f3156c6e61b768318b3cd3bcc4144e17b
2016-03-01 15:52:41 +00:00
dan b1e8d31edf Fix a problem in fts5 where a corrupt db could lead to a (huge) buffer overread. Cherrypick of [c9a30e117f].
FossilOrigin-Name: daef5869f4d62ebb24eb03b79fe4be0812fa0496
2016-03-01 14:51:36 +00:00
dan 45a0e4eb59 Fix an fts5 problem causing 'optimize' to corrupt the fts index under some circumstances. Cherrypick of [251d6473f7].
FossilOrigin-Name: 5b1b7ab5d67f3d691e52ba57dbc14c52d90c6631
2016-03-01 14:50:55 +00:00
drh 889cb33b8f Better estimatedCost in the xBestIndex method of the generate_series vtab.
FossilOrigin-Name: f2c16094a536e7ef62444d0fe38cbee2a4999426
2016-03-01 02:11:50 +00:00
dan 4e9d0d5418 Fix a problem in fts5 where a corrupt db could lead to a (huge) buffer overread.
FossilOrigin-Name: c9a30e117f2c6c9ef0cc0c6ca5227d2961715b8f
2016-02-29 17:34:16 +00:00
dan 437a54eaba Fix an fts5 problem causing 'optimize' to corrupt the fts index under some circumstances.
FossilOrigin-Name: 251d6473f7c9ad95adbdcc49cb8eaf7c0956764b
2016-02-29 17:16:26 +00:00
mistachkin 62ab810014 Fix typo in ICU error message.
FossilOrigin-Name: 00c8fffd47cec763857389e1e91c026ba3179182
2016-02-27 00:21:16 +00:00
drh 88a1650859 Fix a potential buffer overflow in the ICU upper() function.
FossilOrigin-Name: b8dc1b9f5d413000387bfe784b69f5d0ee5c0489
2016-02-26 21:20:57 +00:00
dan 38c3d3d8a5 Fix the ICU extension LIKE function so that it does not read past the end of a buffer if it it passed malformed utf-8.
FossilOrigin-Name: 424b7aee3310b9782bd312589dc3d9f287aa04b8
2016-02-26 16:03:29 +00:00
drh d42908fb0e Provide the new SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER option to
sqlite3_db_config() that can be used to activate the two-argument version
of fts3_tokenizer() for a specific database connection at run-time.

FossilOrigin-Name: 374b5108087a2eae03676c0f3469b37a272145bf
2016-02-26 15:38:24 +00:00
dan fd37e67b16 Disable the RESTRICT foreign key action if "PRAGMA defer_foreign_keys" is set.
FossilOrigin-Name: 8fea1166016c659ece83e0045bc348f478a9ba6a
2016-02-25 19:52:11 +00:00
drh d3e1af4aa0 Merge all the latest changes from trunk.
FossilOrigin-Name: b86590043e17705ada90562cf30f69b3e3ef65a4
2016-02-25 18:54:30 +00:00
drh 16b7dcc717 LSM1: Fix the integer key encoding so that negative keys are in numeric order.
FossilOrigin-Name: f92dc4187f6046fcb3ab63449efd7f3738594adc
2016-02-24 13:35:22 +00:00
drh 078b99f806 Add support for (variable length) integer keys in LSM1.
FossilOrigin-Name: 32f3daec0a8084b258b2513c8025bc4d95a5d757
2016-02-23 01:37:24 +00:00
drh 7dc1918bbf Merge up to trunk.
FossilOrigin-Name: f9e5fb88a5a14b26e9ea6997f449d0913f27a494
2016-02-22 13:01:22 +00:00
drh e1ee002891 Fix a couple of harmless warnings generated by clang.
FossilOrigin-Name: a1a3ff1f53145c5a9fbf29398cf4a453729e71f0
2016-02-19 15:17:53 +00:00
dan 9e2cfad18a Add an "#ifndef SQLITE_AMALGAMATION" guard around a typedef in fts5_test_mi.c to avoid redefining "u32" if it is compiled as part of the amalgamation. Cherrypick of [f9c49ba1].
FossilOrigin-Name: ce0f1ed517e387ca6a687b805088d7c529cd257b
2016-02-19 10:19:43 +00:00
dan 92b859292d Add an "#ifndef SQLITE_AMALGAMATION" guard around a typedef in fts5_test_mi.c to avoid redefining "u32" if it is compiled as part of the amalgamation.
FossilOrigin-Name: f9c49ba1edf13cb8c48d73f1b2e3f80c46b3c030
2016-02-19 10:18:36 +00:00
dan 557d0383ff Remove SQLITE_TEST macros from fts5_test_mi.c. Add the SQLITE_FTS5_ENABLE_TEST_MI compile time symbol - to make it easier to create builds that include the fts5 matchinfo demo by default.
FossilOrigin-Name: e2ef6667772eeac6eee3aed5d0609c2a0ef5d8cf
2016-02-18 16:16:43 +00:00
dan a0c2d3c155 Remove an unnecessary "include <tcl.h>" line from fts5_test_mi.c.
FossilOrigin-Name: 31d8b69e9e0747e573516570bfe2770384e99134
2016-02-18 13:32:34 +00:00
dan 5e29f38d2c Remove the "#ifdef SQLITE_TEST" condition from fts5_test_mi.c. Update fts5_main.c so that if SQLITE_FTS5_TEST_MI is defined when it is built the fts5_test_mi.c entry point is automatically called. This makes it easier to build versions of fts5 that include the matchinfo() demo by default.
FossilOrigin-Name: 87e6e225aea3a4d10476d16eab4a6403a4a128c9
2016-02-17 14:48:26 +00:00
dan 87d6b35541 Improve test coverage of demo code in fts5_test_mi.c.
FossilOrigin-Name: 8a78050dc0e374a0df0f29716df60250e2c4b4f7
2016-02-17 14:11:06 +00:00
drh 45f31be85d Experimental changes to Lemon for improved parser performance.
FossilOrigin-Name: a65d583ce97b8c08157268bd054479cda3957a94
2016-02-16 21:19:49 +00:00
drh 7ff89807e0 Fix a harmless compiler warning in FTS5.
FossilOrigin-Name: e52c90758c53cbb0f74e0d8582e4c3c1bee04150
2016-02-15 23:46:36 +00:00
dan a66e386225 Fix another test problem in sessionfault.test.
FossilOrigin-Name: f6d1cf79437f892220e93635c377513160ee7fd7
2016-02-13 15:08:25 +00:00
drh 50d348b1e1 Harden sqlite3session_delete() against trying to delete a session that
is not currently on the session list.

FossilOrigin-Name: 6c2d34df76fb7823f307c11a1135ab30674421a9
2016-02-13 14:45:56 +00:00
dan 6fee795885 Fix a problem in sessionfault.test causing it to segfault following a test failure. This commit does not fix the actual test failure - just the subsequent segfault.
FossilOrigin-Name: 582b2ae77d65b1e142ceb5774f37b0aaa3851378
2016-02-13 14:39:46 +00:00
drh d8b7d6e44c Merge the changes for the 3.11.0 release candidate from trunk.
FossilOrigin-Name: 4d7a802e73ef0352f840bc8d74c560afb7666ff7
2016-02-13 14:07:56 +00:00
dan 53ff9c2972 Fix a potential buffer overread provoked by invalid utf-8 in fts5.
FossilOrigin-Name: a049fbbde5da2e43d41aa8c2b41f9eb21507ac76
2016-02-12 18:48:09 +00:00
dan f2d328fa25 Fix a fairly obscure buffer overread in fts5.
FossilOrigin-Name: 130580207ab5cee762b2893808acef7c8afad027
2016-02-12 17:56:27 +00:00
drh 4553f6ea91 Automatically disable FTS3 and FTS4 when building with SQLITE_OMIT_VIRTUALTABLE.
FossilOrigin-Name: 0beb32d20d8dd698138cdb2de6b6056de176754d
2016-02-11 22:41:04 +00:00
drh 5d2e2f1267 Remove the unused fts5BlobCompare() routine.
FossilOrigin-Name: defc762dd11144402abd591278819768a080d5ea
2016-02-11 21:53:57 +00:00
dan df9c59f74d Fix another unused variable warning in fts5 code.
FossilOrigin-Name: 61b4c120540afd80a4021b0d3990f13acc38a059
2016-02-11 18:18:33 +00:00
dan 2a44b3d877 Avoid a buffer overread when reading a corrupt fts5 structure record.
FossilOrigin-Name: facbc424e555061135aced7b134bf6c19f54e484
2016-02-11 18:08:38 +00:00
dan 22e8356368 Handle parser stack overflow when parsing fts5 query expressions. Fix some compiler warnings in fts5 code.
FossilOrigin-Name: bc3f7900d5a06829d123814a5ac7b951bcfc1560
2016-02-11 17:01:32 +00:00
drh df3a907ecc Add JSON1 and FTS5 to the set of extensions subject to close compiler warning
analysis.  Fix some warnings in each.   More (harmless) warnings still exist
in FTS5.

FossilOrigin-Name: cfe2eb88b504f5e9b1351022036641b1ac4c3e78
2016-02-11 15:37:18 +00:00
drh 1a606f8246 Merge enhancements and fixes from trunk.
FossilOrigin-Name: f040a5bb62f3473fba6450c97c68f538d1df21ef
2016-02-09 15:44:18 +00:00
dan c2d0b56e6a Fix a signed/unsigned comparison warning in fts5.
FossilOrigin-Name: 85eb05ddbc3a7cff986af13c3dab6c0063e62171
2016-02-08 20:14:41 +00:00
drh 83d7920e55 Fix a compiler warning when compiling without SQLITE_ENABLE_FTS3_TOKENIZER.
FossilOrigin-Name: 6926f28cd56bf61f7c92877baa54024bee7cbab5
2016-02-08 20:06:52 +00:00
dan e064c4066c Disable the two-argument form of the fts3_tokenizer() SQL function unless the library is built with -DSQLITE_ENABLE_FTS3_TOKENIZER.
FossilOrigin-Name: e0eb217aca7e4aadf9c44ed20822b78139f7c83c
2016-02-08 19:40:17 +00:00
dan d120a1e3ab Add tests for and remove unreachable branches from fts5 in order to restore test coverage.
FossilOrigin-Name: 22589018ac3321f7bd89ce9fa69e57eae395e324
2016-02-05 21:09:26 +00:00
dan b80b8f482c Further streamlining of fts5 prefix query code.
FossilOrigin-Name: ca91bd8ac70a5b3fef127364f73ec675e58bb92c
2016-02-05 19:18:02 +00:00
drh 0ac7cfaf99 Merge enhancements from trunk.
FossilOrigin-Name: a533608cb0de3cbc1e28a794aab99864b8c249f4
2016-02-05 14:15:34 +00:00
drh 4a642b6060 Improvements to the way that OOM errors are processed.
FossilOrigin-Name: c3ef03478a5788c855b3aef385d43ae7f494f440
2016-02-05 01:55:27 +00:00
dan 4786cf5a20 Further improve performance of unindexed fts5 prefix queries.
FossilOrigin-Name: c9c6457d8ea911f6cc63967127e58da3146fd3ef
2016-02-04 19:45:19 +00:00
drh c4703eedab Use sqlite3_malloc64() instead of sqlite3_malloc() in the spellfix extension.
FossilOrigin-Name: 634d008c34bd237fc9cfb88dc291394fc5d31efa
2016-02-04 11:15:57 +00:00