Commit Graph

2443 Commits

Author SHA1 Message Date
drh 55a3490cf2 Add the ext/misc/tmeplatevtab.c template for virtual tables. This is a
work-in-progress as it still needs improvements to the comments in order to
be useful as a template.

FossilOrigin-Name: 22358fb5495c727a4dde129128fe409a7b929a5ffa143b1e2879f84d7680ec3c
2018-04-19 16:14:59 +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
dan fe55da387a Add a "flags" parameter to experimental API sqlite3changeset_apply_v2(). Also
add the SQLITE_CHANGESETAPPLY_NOSAVEPOINT flag.

FossilOrigin-Name: 3d29631fa7270b18f51de8cfe1285959e42ad9a673d5d2d5c016126f5f1b31a8
2018-04-09 11:43:58 +00:00
dan 3e259bcd96 Fix a problem in the sessions module causing sqlite3session_apply_strm() to
allocate enough memory for the entire input buffer - which defeats the point
of a streaming interface.

FossilOrigin-Name: 7594e60935b0b5dcf764476dccdf9b403303818a0419a30bc2c16d58e44f6d04
2018-04-06 16:22:25 +00:00
mistachkin 33fc27790a Fix segfault in 'eval.c' extension when used with 'empty_result_callbacks'.
FossilOrigin-Name: e8b87bd4954437041139344d6d1ce3e4aace40ea6891b70f9c20cd95671270e7
2018-04-04 12:21:33 +00:00
drh 92a2ec00eb Fix the generate_series virtual table so that it correctly returns no
rows if any of its constraints are NULL.
Ticket [fac496b61722daf28].

FossilOrigin-Name: 3328e828e28ca7198fd1ce84503e649ab2278913a2cf85a0f0391f31d0c9c8d7
2018-04-03 14:25:51 +00:00
drh 58bd03320d Fix a bug in the spellfix extension causing it to compute suboptimal answers.
The problem was introduced by check-in [afd6fbc01052ccfc9].

FossilOrigin-Name: 3bf28fd9a70ebefc464dceda124d6ed342dd83f71eeeb0568f79e34e731a073e
2018-03-30 16:34:04 +00:00
drh 9f95e48d94 Fix an off-by-one error in the dist3 algorithm of the spellfix extension.
FossilOrigin-Name: 5c34af7b975598bbe20751dfdd346f43031cb2bcb6b78f1bbdb2b51b398de182
2018-03-30 15:59:54 +00:00
drh 43a9385def Fix a typo in the README file for ICU. No code changes.
FossilOrigin-Name: 79c4383b66fee9d43a75eef30ed0364573fc99e6d3be12267a99773ab8f57a9f
2018-03-27 22:58:45 +00:00
mistachkin 43ff906d3e Fix a couple issues in the 'session' module tests.
FossilOrigin-Name: ccf734f7d2bf8f99f3c55124b05c1835e4371bc269f27700f40afc26e7c1bc55
2018-03-24 23:16:05 +00:00
mistachkin 2c42c34df5 Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: e9508ab1f86ac70a3ca5622ce44141bc05186b199bf32fb8739aef36b95aa05c
2018-03-24 20:06:52 +00:00
dan cbeee957e5 Fix typos in sqlite3session.h preventing documentation webpages from being
generated. Also mark all new sessions functions (those related to rebasing) as
experimental.

FossilOrigin-Name: de974235a8fefab0d08673c1b1da4e425e1d8bbfc8c35dac30943c05337b2950
2018-03-23 17:36:31 +00:00
dan 3f2cebb6b4 Fix minor problems with passing NULL pointers to memcmp() and memcpy() found by -fsanitize=undefined.
FossilOrigin-Name: 0b06ce6d8e7cff5cd5d467a94522dfef5593d7c26663ce03c2c2b663a2641551
2018-03-23 16:31:34 +00:00
mistachkin ce2052bc39 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 2f2be1b1811e6b83fc8945da06e57b8b54233ff8a6ebd9d71b22c6bab2e74afb
2018-03-23 00:31:53 +00:00
dan a968e74fdc Add APIs to the sessions module for "rebasing" changesets.
FossilOrigin-Name: 509506c76b7c104961826721013889d6c6b2ed9b563dcd029e0cb5cb5c34693a
2018-03-22 20:35:20 +00:00
dan 8cb83bee0f Remove some unused code from sqlite3rebaser_rebase().
FossilOrigin-Name: 07cc955eab0e993a75be82d58e17ca53c8abbcaf851983d235049599c19e582f
2018-03-22 20:11:14 +00:00
dan f231e18c6b Fix another problem with rebasing updates against multiple remote changes.
FossilOrigin-Name: c8e7b5a061a3f2fbd9072530177b80f917b39ab5d7cd6acb0a221ab33e78a5cd
2018-03-22 19:52:22 +00:00
dan 516c35a72a Fix an RBU problem causing errors when updating tables with default collation
sequences that require quoting (e.g. COLLATE "ICU_root-u-kn-on").

FossilOrigin-Name: eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01
2018-03-22 17:13:44 +00:00
dan fc50a71be1 Fix a test script problem causing rbuvacuum.test to fail when run along with
other tests.

FossilOrigin-Name: 901cb3b6a2c8d0cc33bd34ec1dbeea49c779ae1ac3ed6733dd9826c8e0eb80c8
2018-03-22 17:02:37 +00:00
dan 3fa5463c03 Add tests to ensure that patchsets are handled correctly by the session rebase
APIs.

FossilOrigin-Name: 0e45baaec01947f6cbf47d5d5922a4cabe7d27181c04c0a08259c952fd023947
2018-03-22 14:07:36 +00:00
dan b880a7b1f0 Remove some unused code from the sessions module.
FossilOrigin-Name: a09518ab63a1ef1b7f56b9f9b16269fd83920469d4c4e179b1f68b35df4e0c4b
2018-03-22 11:15:59 +00:00
dan f3f6a5dec3 Merge latest trunk changes into this branch.
FossilOrigin-Name: d00b71ecf857bc6d903442d91418d5a313c584dcdd8e9c8ff3b5d940dd45bcc5
2018-03-21 20:13:56 +00:00
dan 95ccb6dc8e Fix some documentation and other issues with the code on this branch.
FossilOrigin-Name: a9ec68627a4533ca6aa7cc1b73f864db615a80e86eda9e33660f22d269a1ba1e
2018-03-21 19:46:36 +00:00
dan 24a0c4534a Fix rebasing of UPDATE changes against a set of remote changesets that feature
both OMIT and REPLACE conflict resolution on different fields of the same row.

FossilOrigin-Name: d8bc3fdb6ba165ca8d7cab857ede8e7e6e2fac24ad59580c5e1db1a4942d295c
2018-03-21 17:29:53 +00:00
dan bd45374cc8 Add further tests and documentation for the sessions rebase feature.
FossilOrigin-Name: 7475a363ebb272ae23c0796fe7587714a156dc6a3a4a57ed948ed6f69d3c1218
2018-03-20 20:27:03 +00:00
mistachkin de8113c31e For 'zipfile', detect attempts to cause a duplicate entry via UPDATE. Also, fix handling of 'UPDATE OR REPLACE' statements run on zipfile virtual tables. Win32 portability fixes to the 'fileio' extension. Miscellaneous test fixes.
FossilOrigin-Name: b36caeca91647616ac2ccdb281200c1a8bcd15d1f30dda0c1d89440d54607196
2018-03-20 16:56:12 +00:00
dan 93c803e960 Fix handling of "UPDATE OR REPLACE" statements run on zipfile virtual tables.
FossilOrigin-Name: 9a5ef341de2bd2fc4657a510f48159f7876f58d340b457b4272a71d389f88da3
2018-03-20 13:26:01 +00:00
dan d30830e42d Add a test case for the fix on this branch.
FossilOrigin-Name: 7834cf6c28c63f6ca0e29a508c0f6e3ec9c5c48715344c2db99a9866e92ef205
2018-03-20 12:12:06 +00:00
drh 8c1eba75a3 Enhance the command-line completion extension to return the names of
triggers and views along with the names of tables.

FossilOrigin-Name: 10e32204e1850354ff16fc052145726e903f87185a37f172831dddad1955184e
2018-03-19 19:05:45 +00:00
mistachkin 2cc8f4831e For 'zipfile', detect attempts to cause a duplicate entry via UPDATE.
FossilOrigin-Name: cf78a882799424610209e9ac5e76771db3f5e6704ffa181f9598eb0986d93eb8
2018-03-17 02:13:13 +00:00
mistachkin 42a0dbfe92 Win32 portability fixes to the 'fileio' extension.
FossilOrigin-Name: 9d2b0f8b84aac862b0572b183e3ba53ea8c0d8742aaa3c3fbe59f6036054fd1a
2018-03-16 23:54:36 +00:00
dan f01d3a7ef7 Fix a problem with handling rebasing UPDATE changes for REPLACE conflict
resolution.

FossilOrigin-Name: f7bf71f1d47044e3cbc74018294b8af5ad52c2bb84954e99bbd4e9b8c36fc077
2018-03-16 18:02:47 +00:00
dan f1b40e8305 Add simple tests for the sessions module rebase API.
FossilOrigin-Name: cf0d1abb44cf170d747e9c11f49ec03a29f00ab4821c613ca1e05b883a568211
2018-03-15 19:25:40 +00:00
mistachkin 093d63bf34 Draft fix for an fsdir() issue reported via the mailing list.
FossilOrigin-Name: 48641010c24bf37f13d68c4d19c5c3e9b41404af12a4947705cc53a31db04178
2018-03-15 05:25:57 +00:00
dan c0a499eaad Add largely untested APIs for rebasing changesets.
FossilOrigin-Name: 39915b683b3f8d3bf872af1dede96bf2818b488a8638a1d248395023fc4bd0ef
2018-03-14 21:06:58 +00:00
dan a38e6c57bc Add sqlite3_changeset_apply_v2() and apply_v2_strm() to the sessions module.
FossilOrigin-Name: 445bfe977d9f3a891e08ef33237862ed047fe83e134ef3ed8b47ee0f5abd8cd6
2018-03-13 20:31:23 +00:00
drh 42f3c5ff25 Add support for INSERT OR REPLACE and INSERT OR IGNORE on the zipfile
extension.

FossilOrigin-Name: 8ad35d483e4293d5571eeacc20fd26cdc4064fbee7b63d974879d507a0ee5792
2018-03-10 14:17:01 +00:00
drh 41a6f2cb6d Improved error messages from the zipfile extension.
FossilOrigin-Name: f634a7e386918b829389f20c330d312315fdd61125cd2c5f66cf17a5d74bce49
2018-03-10 13:21:41 +00:00
drh 70acb0aa6b Avoid harmless left-shifts of negative numbers in the zipfile extension
when building ZIP archives of files with pre-DOS dates.

FossilOrigin-Name: 16bba8650cc24a0fd606944422bb31f2b8bdbe0a5a483678989e400b751eab4d
2018-03-10 12:53:20 +00:00
drh ef29f73479 Fix the zipfile extension so that it is able to create symbolic link entries
in the ZIP file even on systems like Win32 that do not support symbolic links
on the native filesystem.

FossilOrigin-Name: 2a4493f4ad2d09c1097e98e7086623669f3f252571884d515e51a98b1c6855e1
2018-03-10 12:34:08 +00:00
drh 980e2cd39a Attempt to fix a harmless compiler warning from Clang.
FossilOrigin-Name: bba1bfbde62733e14f458bf3b71cb00d4899a4ebae2553d6ed24d48495cdced1
2018-03-09 12:46:34 +00:00
mistachkin f7c8a35b8d Fix harmless compiler warnings in the 'dbdump' tool.
FossilOrigin-Name: 2b9bb2664c56dd3280b4aad05b7f64dd23e5b992b5621a48dbfdb7c358d0f3ae
2018-03-07 21:39:25 +00:00
mistachkin 23355215fb Fix harmless compiler warning in FTS5.
FossilOrigin-Name: 2d544711c7e9f4c2c3ca7ee7d588948d048da82e63c82f41c999fce947d6661d
2018-03-07 14:49:32 +00:00
mistachkin ac8ba26ecb Fix utility compilation issues with MSVC.
FossilOrigin-Name: 5bd5a79898790bef150b2bc7f275333444b1a723385e595931377ff4d32190bf
2018-03-07 14:42:17 +00:00
dan 6344edda80 Fix another crash in the sessions module triggered by malformed input.
FossilOrigin-Name: 7e70c9b86af557e86152748ddf1da467e62817b35df1da0d7d3b67941b198897
2018-03-05 21:17:20 +00:00
dan 9c42626e43 In sqlite3_checker, wrap the call to "SELECT checkfreelist()" in a
transaction.

FossilOrigin-Name: 02906e55d73ea3521ad1e6807cffed5c759147f7b2d89efc4add984e53e3ad49
2018-03-02 20:00:42 +00:00
mistachkin 5e9825ecc4 Typo fixes in comments. No changes to code.
FossilOrigin-Name: 1293d4f64f322ee57510bdff497c54e0be2c9205217e1fd96887bba1f36bec40
2018-03-01 18:09:02 +00:00
dan e341ec699f Fix further crashes in sqlite3changeset_apply() caused by corrupt changeset
blobs.

FossilOrigin-Name: 2c01c72e357296d761493aac47329f15d87afcada2b39606fc018af0e0011bb5
2018-03-01 15:20:33 +00:00
dan dd8a4af8e7 Fix some crashes in the sqlite3changeset_apply() function that could be caused
by corrupt changeset blobs.

FossilOrigin-Name: 745a9a7fef0f28a57ea3f44899058993f6ecdedda52c81a09a4a9ce09c9004d6
2018-03-01 12:05:51 +00:00
drh bda30ce4d8 Enhance the sessions documentation to show the methods of the various objects.
FossilOrigin-Name: e01177754ad6d9e2d38adddddd2e2e212094dac1154bda5fcee61ca8b678ae0f
2018-02-28 22:21:29 +00:00
drh 6a8a629e6b Use <pre> around code snippets in the documentation for sessions
interfaces.  This is a documentation change only with no changes to code.

FossilOrigin-Name: c949b915e893e917315ce21092d4c4bbd3e1b88d5326928f71dcc2f18f300702
2018-02-28 21:50:00 +00:00
mistachkin 5facffbc70 Fix harmless compiler warnings in the zipfile extension seen with MSVC.
FossilOrigin-Name: 15c587cf6ffc920dc37f67cacb4f0db6a603fb998a22a639f755387910516414
2018-02-23 13:38:54 +00:00
drh f4bc6c43d7 Improve performance of editdist3() by keeping the costs in sorted order.
Also add a new regression test to editdist3().

FossilOrigin-Name: dc734c5b61464dfd6bfa7963f2ecce32e405a0c2ba1ef6f453ec9389da080256
2018-02-15 03:56:33 +00:00
drh 46e835a2c4 Reduce the number of calls to strncmp() required to run editDist3Core().
FossilOrigin-Name: afd6fbc01052ccfc9bd29fb8f934b291b8f56af44fcae870da7e1355fe95c29a
2018-02-15 03:05:56 +00:00
drh d9274a8ae3 Performance optimizations to the editdist3() function in the spellfix
extension.

FossilOrigin-Name: 70d304dcbac4c3fd5e3b96108bffea2ce6c0db19c847397d5c5e268bb90a981d
2018-02-14 20:58:36 +00:00
drh 0fae06fcb6 Disable assert() in the spellfix extension if not compiled with SQLITE_DEBUG.
FossilOrigin-Name: 3c53ee0fdea4cbf2590e2b289b021b0ef8b7ead2945db1bdfc767432d9447acb
2018-02-14 20:25:33 +00:00
drh e2d27e0259 Try to optimize spellfix1 by storing a NULL in the k1 column of %_vocab
if it would otherwise have the same value as the word column.

FossilOrigin-Name: b76ec7cb5841f9ad02b342271e91c5f5a598006f69df7953a6213c706e01f7a2
2018-02-14 14:13:09 +00:00
drh d446e79545 Remove an unused variable from FTS4.
FossilOrigin-Name: 27ea783b281606196ad1e7e6e6dcbd80c75d4bafcf3e58756a71c213320e4db2
2018-02-13 16:30:19 +00:00
dan e84c498be1 Ensure that multiple updates of the same FTS4 row (i.e. the row with the same
rowid) within a single transaction are written to separate segments. Fix for
[d6ec09ec].

FossilOrigin-Name: d2a81a3752a8298ee65fddcf32dee2147ba6467f770315a41966b3533977aa64
2018-02-13 16:21:32 +00:00
drh 510fea885e Add the zorder.c extension implementing zorder() and unzorder() SQL functions.
FossilOrigin-Name: a57a77dc0cc9fbaa9d5b134422f7a8cc8d4c2851ed3c2bdd449800c6a5d2aae0
2018-02-09 20:49:15 +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
mistachkin 001f52ed7d Move variable declaration in zipfile extension to fix MSVC compiler error.
FossilOrigin-Name: ac6a32482e675871c3ce5ecc727e50e4bba649e80e3c55bf99025fed5667da94
2018-02-04 01:29:01 +00:00
dan 3944cf8de3 Remove the "include <io.h>" win32 dependency from the zipfile extension.
FossilOrigin-Name: cb3feb3bc33718625159eddbf8ef608cd641af84e97d433d6b11ba6da94dad2e
2018-02-02 16:28:19 +00:00
dan 1dff328119 Remove the time() dependency from the zipfile extension. Use SQLite VFS
methods instead.

FossilOrigin-Name: 0702fb5611c7cf0154c5490eeada66afc733731dff0fe030375bae6a72123a17
2018-02-02 16:20:41 +00:00
dan 15daa6b53e Fix a problem triggered when a zipfile virtual table is created and written to
within the same transaction. And add other zipfile test.

FossilOrigin-Name: 48f1c556994d7f8f359c649a1da81eec02306106b68946a9a20b276742c4610d
2018-02-01 19:41:23 +00:00
dan c3ef23a1c9 Fix a memory leak that could follow an IO error in the zipfile extension. And
add other tests.

FossilOrigin-Name: e6bb750697c3c7ceb5ce41d216e8ef6a1d556822a3b55e0a007b4a03e194a7d9
2018-02-01 15:19:54 +00:00
dan 44091ed368 When creating a new archive entry, have zipfile store UTC instead of local
time in the legacy MS-DOS format timestamp field.

FossilOrigin-Name: e2114df18383d111dd5fbac902e08b42a7f4b2b2d6f7bf29574a3722e4a4dad5
2018-01-31 19:13:31 +00:00
dan 2f7260deba Add tests cases for the zipfile extension.
FossilOrigin-Name: 13b786dafd308b7aef42328f26fe64981c83d524e4bf82ceb7d58afc7146c7d3
2018-01-30 17:43:22 +00:00
dan fdcd9d4e6c Prevent users from creating zipfile() virtual tables without an argument.
FossilOrigin-Name: 81fdbe0cc5a360f818078d47a5888d0a29d555927da279a9a0213702d74ef09a
2018-01-30 14:07:55 +00:00
dan ea4125bbef Add unix-only tests to check that the "unzip" program can unpack archives
generated by the zipfile extension.

FossilOrigin-Name: 438c5c5237a801ae78809bf324bb9251fb50250addfc1f8e36659442b0e26ab6
2018-01-29 19:47:32 +00:00
dan f8c4b99a02 Add aggregate function zipfile() to the zipfile extension. For composing new
zip archives in memory.

FossilOrigin-Name: e364eeac76a8225146b37d801bc6cabe03e9abede5a1412ebe9d94a32d8838cc
2018-01-29 18:41:07 +00:00
dan a07aa8d397 Fix missing header comments and other code issues in zipfile.c.
FossilOrigin-Name: 6ea8ba312c38365d3e28cfb2a367d729dd2751d1d853843eea0e18126777a320
2018-01-27 18:55:18 +00:00
dan 26333ee3ca If a zipfile virtual table is created with no argument - "CREATE VIRTUAL TABLE
zzz USING zipfile()" - accumulate data in memory. Support "SELECT
zipfile_blob(z) FROM zzz LIMIT 1" to retrieve a zip archive image.

FossilOrigin-Name: e63185edfe0c316aa60c1fa085d032425ecc7db54536dfa5a977772eaf3c240e
2018-01-27 16:29:59 +00:00
drh c86caa58cd Fix compiler warnings in zipfile.c.
FossilOrigin-Name: bed610d99b5322ee209b06966c0086e8c55f8a82be8d7693cfdeb4d728679721
2018-01-27 03:26:10 +00:00
dan 8005d60587 If the argument to table function zipfile() is a blob (not text), assume that
it contains a zip file image to interpret, not the name of a file on disk.

FossilOrigin-Name: 029ebcd30cb261d949f7587ac54c23d7479796b6716fd4ca7512361b8f32de3e
2018-01-26 18:59:25 +00:00
dan 8558ef2e19 Reorganize zipfile.c code to make it easier to add support for in-memory zip
archive processing.

FossilOrigin-Name: 30b9258294e3028ef4ea467e332e013995509544e9a23c8bbf5168772a7e895d
2018-01-25 20:50:46 +00:00
dan 1a0e5b37b2 Reorganize spellfix.c to make it easier to edit automatically (e.g. using a
script). No changes to functionality.

FossilOrigin-Name: 090a64faaac579c6ed1cddb02d14e7089468a4aeaeec11e78d461790bcb6eb0a
2018-01-24 18:28:39 +00:00
drh fe875027d7 Add the normalize.c extension.
FossilOrigin-Name: 16ebe558d2f0982f630c39b6c1b00d14d27011d454cced213f17c26491a2c06e
2018-01-24 15:07:37 +00:00
drh a87f8ce262 Improved error message output when the btreeinfo.c extension is run in
a connection that lacks sqlite_dbpage support.

FossilOrigin-Name: 461b0b81b2acedb1b9ca520657518d6778417c375aeb58c41ead840b75a6d985
2018-01-24 13:15:56 +00:00
drh 61d04974f0 Fix the modification-time setting logic in the fileio.c extension on Windows
so that it works with utf8 filenames.

FossilOrigin-Name: f785b9041556912edbacdbfb3dfc38705058d7c10d874544295c25db54628bc2
2018-01-23 15:26:30 +00:00
mistachkin fa3d785580 Simplify one of the compiler warning fixes from the previous check-in.
FossilOrigin-Name: 012d7d49c571207087bbe24af05d639627b96df526bfcb2098a3e975b74d865d
2018-01-23 00:17:27 +00:00
mistachkin b71aa0955b Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 76a11a80e94d1e9c9645e6e348948f3fd508266d4569c85d80a3879862d0a819
2018-01-23 00:05:18 +00:00
dan 2f94935409 Allow the shell to be built from the configure script with
SQLITE_OMIT_VIRTUALTABLE defined.

FossilOrigin-Name: 136bf323e42dc90e1780199a381bcbb084b069eca5c7343ee6fc6e2550831536
2018-01-20 15:48:45 +00:00
dan cae5b9feac Clarify the handling of the sqlite_stat1 table by legacy versions of the
sessions module.

FossilOrigin-Name: dc7c48cb4126db9e25c73512cc743155293fe1c4c2516f8c84102228695b6e70
2018-01-18 16:56:19 +00:00
dan e3ca3831ba Add comments describing the special sqlite_stat1 handling to sqlite3session.h.
FossilOrigin-Name: 4431a3256f7436e34b3c33edc1f3e53df7eb3c87daec9bac8d038895d93ca7f2
2018-01-18 16:53:41 +00:00
dan d1cccf19b5 Fix sessions module conflict handling for the sqlite_stat1 table.
FossilOrigin-Name: f05ee74e05c401eb075a1ba65179662a08a5c3d5b55fc81f2acc841e841dd055
2018-01-18 16:42:11 +00:00
dan 1611e5a301 Simplify the sessions preupdate-hook logic for transforming NULL to X'' for
column sqlite_stat1.idx.

FossilOrigin-Name: 089d7cecaaa47db58320b216a111a5e56123d022008be6c81bc0746148bbdb58
2018-01-18 15:06:23 +00:00
dan 3739f29807 Fix a problem in the sessions module with logging sqlite_stat1 rows for which
(idx IS NULL) is true.

FossilOrigin-Name: 25bf734be1b3883fccf12ac4d93d50289aa307fb60a52e0e32df12f7ee4edc7a
2018-01-17 20:57:20 +00:00
dan 61c758b53a Fix a problem causing the sessions module to occasionally lose track of rows
with composite primary keys when there are two rows with the same text value
in the leftmost column of the PK.

FossilOrigin-Name: 09aed13678374bf22087cd808808b711dc703b7c18bc8aaf704850611e17f5cd
2018-01-17 17:38:18 +00:00
drh b968518559 Fix harmless compiler warnings, mostly unused parameters for UDFs in the CLI.
FossilOrigin-Name: bfbeffab7735461acb3773242ba31dae15af9f8b0291c54a6734747bb1b36e66
2018-01-17 13:15:23 +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
dan 2879952faa Fix a problem causing zipfile to store 0 in place of the CRC32 value for
uncompressed files.

FossilOrigin-Name: ba44724bcca2e87788b7c6d8c5de7fa388360127bd894ee6a171fd66e794fcae
2018-01-16 21:09:00 +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
dan 194a17bbb7 Change a cat in zipfile.c from (z_const Bytef*) to just (Bytef*). This allows the module to build with older versions of zlib.
FossilOrigin-Name: ac9af91d5a2927e71903461e7bbdd2c0168fde9a042853c8bcd4c7ebd0d51e0d
2018-01-16 17:33:09 +00:00
dan 2d620070b9 Fix a problem in the zipfile module causing it to generate incorrect
checksums. Remove the ability to insert compressed data into a zip archive.

FossilOrigin-Name: b0b7d0363acf38c2178e2d3041d8ce2a0de061a51caa64670dbf539ee6d4356b
2018-01-15 19:00:35 +00:00
dan 89fa746941 Fix a zipfile problem with extracting zero length files compressed using
deflate.

FossilOrigin-Name: cf64087224aff1a2fe169d23996d9e5ed8d86459c655eb5d0bace0466a557ec6
2018-01-15 15:49:46 +00:00
drh eb54500419 Fix harmless compiler warnings in zipfile.c.
FossilOrigin-Name: 8f7a592f8c044d75b4615a95e27454100b10c2b26f4cafee97dec23343821130
2018-01-13 23:28:33 +00:00
dan f42884c307 Support UPDATE statements against zipfile virtual tables.
FossilOrigin-Name: f2d2a5df4f29b47212fd2411eae6545087b901a270655640c87ceb472e02a24c
2018-01-13 19:08:24 +00:00
dan 5871318407 Fix error handling in sqlite3session_diff() when it is invoked for table
"sqlite_stat1".

FossilOrigin-Name: 874285e477dd9bd164e25ddb08b6b80daaa8cfd111b4180ecce59b1ce26f77a5
2018-01-12 19:20:15 +00:00
drh 3f975373ce Fix obsolete comments. No changes to code.
FossilOrigin-Name: ec39c99bea024ffce9b87bbf3d80087ff772f43f7fb7e238754c364f7db2a17b
2018-01-12 18:03:38 +00:00
dan f3e3dfe96c Include changes made to the sqlite_stat1 table in changesets
generated by the sessions module. sqlite_stat1 entries in such changesets are
ignored by legacy clients.

FossilOrigin-Name: 2064233533edec0308d0212fb08e72fd14c760a1c88452424cae298e9eaf4af8
2018-01-12 17:25:25 +00:00
dan 614efe2b4b Experimental change to include changes made to the sqlite_stat1 table in
changesets generated by the sessions module. sqlite_stat1 entries in such
changesets are ignored by legacy clients.

FossilOrigin-Name: bd46c4429693545eb16db85692fc591ac529796aa746f5f21df1ce4380619320
2018-01-12 16:44:29 +00:00
drh 6ac7303e1a Always use utimes() instead of utimensat() since the latter is not available
even on some recent unix systems.

FossilOrigin-Name: 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7148c
2018-01-12 14:34:45 +00:00
dan f225059b8b Add a test to ensure that the sqlite3changeset_apply() function ignores tables
that do not have the expected primary keys.

FossilOrigin-Name: bf2daf06279e46bc37cc92ad1becec1b12d2aa804a14b101fca8b3a7fdb280c3
2018-01-12 12:02:02 +00:00
dan 66a3a91aa6 Change zipfile to be a WITHOUT ROWID virtual table and table-valued function.
FossilOrigin-Name: 931201f64e04247ed613a0301fcc86c3a337c2ed162c6370a80c67a1dd919e7c
2018-01-11 17:33:48 +00:00
dan 5e9bbe1924 Add test cases for running multiple RBU operations within the same process
concurrently.

FossilOrigin-Name: 407b5ed35c178bb0dbc69c8b902652038a0653d55a58a7543f9d4857c6baf3ea
2018-01-11 16:16:03 +00:00
drh e4185bda9a Minor formatting changes in zipfile.c. No logical code differences.
FossilOrigin-Name: 4f68bed3b9a63a349a2a2d7f26609491577e9717034ad86af404cf9eed9d6aaf
2018-01-11 14:50:40 +00:00
drh cc9c26a092 Fix a harmless compiler warning in zipfile.c
FossilOrigin-Name: 60c694c1ab26a7a096f17ccea5a93ecda0f9f2113ab5fdc8b17dbffc787724fc
2018-01-10 19:50:40 +00:00
drh e15c5e532a Add the lsmode(MODE) function in the fileio.c extension and use that function
in the .archive implementation.  Add the --append and --dryrun options to
the .archive command and remove the --zip option, making it automatic.

FossilOrigin-Name: 38f28029d16df8489772c27867de8888dd1c26b170861acdc977fd4023939dde
2018-01-10 17:44:03 +00:00
dan 4bfd182939 Return an SQLITE_CONSTRAINT error if an attempt is made to insert duplicate
entries into a zip archive.

FossilOrigin-Name: 1f099b2b45074c89eeff8ff241aa49489c95c2221b25c305fcda670ebf63fb4e
2018-01-10 17:37:58 +00:00
drh 410cad975f In the fileio.c extension, change the filetype(MODE) function into lsmode(MODE).
Use the new lsmode(MODE) function in shell.c.

FossilOrigin-Name: 52d12ba9f33c1f2620776e189c81f3bf991759344ecdd167ea2a6107f0972b9d
2018-01-10 17:19:16 +00:00
dan f2ed70e4de Have the zipfile module automatically append "/" to directory names that do
not already end with such a character. This is required for info-zip
compatibility.

FossilOrigin-Name: 94bc3c60e7d2ec849b90444b06e3057ed645edf3af334f2737252960602868e5
2018-01-10 16:30:40 +00:00
drh 6c237b1fa7 Add the "filetype()" SQL function for interpreting file modes to the
fileio.c extension.

FossilOrigin-Name: 58c0c74c407d93f48930a4964b6cc48f008b522d193a62a559de0e6a319a8bd0
2018-01-10 15:53:06 +00:00
mistachkin dc006e05aa When disconnecting from the 'swarmvtab' extension, close each database prior to invoking the 'openclose' function on it.
FossilOrigin-Name: 3e5647cb6c4553683e24b9cb62548f16c79c4e2ac9e39cf135ea52a623f7cc33
2018-01-09 22:23:42 +00:00
mistachkin 7026bd6753 Fix harmless compiler warnings.
FossilOrigin-Name: 0fb42090cb2c785e044abe273a00da134927db191fea7b0c67ba4028944bce3a
2018-01-09 20:49:33 +00:00
dan 2c4df97591 Return SQLITE_CONSTRAINT if a user attempts to update a zipfile table.
FossilOrigin-Name: 64c9ccf6c5598a68135e78dad128ec070afa49416e1d1f35745a24276e7aeeea
2018-01-09 20:44:04 +00:00
dan c48e0271f6 Fix a potential crash in sqlite3expert.c caused by a missing sqlite3_reset()
call.

FossilOrigin-Name: f6355970f04a3c4d85801c806366788139d8d5ad29383ec7faa81e2176ffe987
2018-01-09 18:31:11 +00:00
drh 4297584d66 Updates to the README.md file for the ext/misc directory. No code changes.
FossilOrigin-Name: 6b3f4349d7156501f05270d494d6002ee03a0860b6e77b46d17effcab027b753
2018-01-09 15:28:25 +00:00
dan f87ae41f52 Do not attempt to build the code in ext/expert/sqlite3expert.c if
SQLITE_OMIT_VIRTUALTABLE is defined.

FossilOrigin-Name: ba967ad2e38590fe2a51e814a087140089be5e6a06a795a958e70a8a47f6350f
2018-01-09 14:30:49 +00:00
drh 8ee5d0fc05 Attempt to fix the fileio.c extension so that it builds on MinGW-64.
FossilOrigin-Name: a7446d3217d39c96c884fbfb294dd320378255f3bfb34e35d15ba6d7c6698f53
2018-01-09 14:27:58 +00:00
dan 128011a258 Fix a zipfile problem with adding new directories to an archive.
FossilOrigin-Name: 5fed67033c9dd4492bf8cfcf98874284581f448d8cc84fa5470dde239f218375
2018-01-09 10:29:34 +00:00
dan cc234a4b66 Fix a problem in zipfile.c found by -fsanitize.
FossilOrigin-Name: 4fe697fa6c2b45aec60c33eff1ce2ea97b8a2ca124ef0c0059930269d25cdb2e
2018-01-09 07:16:51 +00:00
drh a8691309dd Avoid a compiler warning when building with newer versions of MinGW
FossilOrigin-Name: cba0206a15f30313e16a08634995ebfd5d325d83affb859a215e72509f539b4e
2018-01-09 02:27:13 +00:00
mistachkin 88a1d6b92c Fix harmless compiler warnings.
FossilOrigin-Name: 1adf4e60391326ba699260402c06604ea25b456e903157ecb05017e7ea954fc4
2018-01-09 00:26:39 +00:00
drh 91694dbdd2 Test cases for sqlite3_normalize().
FossilOrigin-Name: 658f42257d56a3562dfa8e55023c6e497f55c565cd751d942de3a9e0cb2fa708
2018-01-08 20:04:57 +00:00
dan 7c15ac1ada Update the zipfile module so that it matches the documentation.
FossilOrigin-Name: 7e7e472fa91a2bad2e521d4d67f176c8eb9edc1a07b283e425ea0fa2b6abba1f
2018-01-08 19:59:59 +00:00
drh d19866bb98 Special handling of the NULL keyword. Sometimes it is a literal, and sometimes
it is a keyword.

FossilOrigin-Name: db5d138e97f22ad4d4d11dbef96df93696ba0e557809066bc263ca3c3898f349
2018-01-08 19:29:28 +00:00
drh ef42481224 Add IN-operator normalizating and the SQLITE_NORMALIZE_CLI compile-time
option for generating a stand-alone program.

FossilOrigin-Name: d77dbb398afa80c1b3373c55f278491e83d5c80ddc22dbc303876bdcbc127df9
2018-01-08 19:18:27 +00:00
dan d4bb7c180b Fix problems in the sqlite3expert.c code revealed by -fsanitize.
FossilOrigin-Name: 7a93dd784bfdbf01927979a61643796e0901d9ac285fe4214677838def93a9a4
2018-01-08 17:34:15 +00:00
mistachkin 1bc1e2fb5d Remove a superfluous define from the 'fileio' extension when compiled for Win32.
FossilOrigin-Name: 6dcba6693f064b0e21360c5eab18abe4a1534f6699b5d7b92e60eab6be14c347
2018-01-08 17:09:05 +00:00
drh a41f2855e9 First code for an auxiliary function that will normalize an SQL statement.
FossilOrigin-Name: 84814aac81e54f03430f180926156ab0fc01e22bbce2bb228b698ea0d4a588ea
2018-01-08 16:54:26 +00:00
drh a5da4ef4ad Avoid the use of utimensat() on older unix platforms.
FossilOrigin-Name: 90cb01d8d6ac12d0b88f2952a75aeefa81ba66f5e4a5377fdd8b9f86aec8e927
2018-01-07 23:28:10 +00:00
drh 8682e12190 Modify the sqltclsh startup script to look for a properly formatted
SQLAR at the end of the executable.  Fix the CLI so that it automatically
links against appendvfs and so that the --append command-line option works.

FossilOrigin-Name: 67c4a8c6881e33b830aa27c80e7e3d697a4222939edd77cd5ca77ece16471ea4
2018-01-07 20:38:10 +00:00
drh acd6fdee98 Improved comments on the sqlar.c and compress.c extensions that describe
the differences between the "zlib format" used by SQLAR, the raw deflate
format used by ZIP, and the custom format used by compress.c.  No changes
to code.

FossilOrigin-Name: c13415c5caf06eaa73086c500907451dfcdfd1354ac4a9ab63edb7255edbfa1b
2018-01-07 19:52:28 +00:00
drh 4574db78a4 Add the appendvfs extension and code for the sqltclsh.exe executable.
FossilOrigin-Name: b0a43e325c53ec0df50fd41acffbbee65eac47b9318868e6959cd39da66fa8d6
2018-01-06 13:42:27 +00:00
drh 6b9986e84a Fix the appendvfs so that it leaves sqlite3_file->pMethods as NULL if it
fails to open.

FossilOrigin-Name: 46b341e3ad11b807ae50f001b970299de7ea0d523dbb639ee10f1d5aca5d958b
2018-01-06 13:33:21 +00:00
drh b2b7274e10 Add the ".ar" command to the command-line shell.
FossilOrigin-Name: 148b8aee78e40cab9a758a920589bd3ca8fc1c45cc93598bc50d96b85cd17e6c
2018-01-05 19:01:05 +00:00
drh 7ee8836e08 Fix a bug introduced by efforts to reduce compiler warnings in
check-in [364ac333b030f0]

FossilOrigin-Name: 1d6cee9ad448b10e69f351ef9dbec09110c5b189cba8734e637f41abe8f35bf8
2018-01-05 18:51:25 +00:00
mistachkin 9a5efdec70 Fix compiler warnings.
FossilOrigin-Name: 19aabccfe34c956599f33cd3ddc846816adc06784c2496838f1ef53059e038e5
2018-01-05 17:10:49 +00:00
drh af2770f842 Fix compiler warnings.
FossilOrigin-Name: 364ac333b030f0e3372937df723f1098183da87913ba0e8ae162864ee24a50d3
2018-01-05 14:55:43 +00:00
dan 303b02cc0b Fix an LSM problem causing the wrong amount of "auto-work" to be performed
under fairly obscure circumstances.

FossilOrigin-Name: a4876672edea4e96103efd2463ce9a34a0b994a8744c941660940578aafbd454
2018-01-05 11:34:18 +00:00
dan 8503d6451b Fix an LSM crash that could occur if LSM_CONFIG_AUTOFLUSH was set to 0.
FossilOrigin-Name: 05346f83d587e6049da0e8ec5f62c749daa9e80359cf48f8c37e333e6a1e7d2a
2018-01-05 07:57:54 +00:00
mistachkin 104958cab0 In the 'fileio' extension code for Win32, use the FILE_FLAG_BACKUP_SEMANTICS flag when setting the file times, just in case the file is actually a directory.
FossilOrigin-Name: 4f3444060057127bce81787ed83cb5225cdbdd577596bc3fb06a40be2208f238
2018-01-04 23:49:08 +00:00
mistachkin dfdfd8c7f2 Get the shell enhancements compiling with MSVC.
FossilOrigin-Name: 335387f9e0d4569097d34cd99cd332b38a282e9b7ae25f088eb47df5c25837ef
2018-01-04 22:46:08 +00:00
drh c76ed3d57d Merge in all recent trunk enhancements.
FossilOrigin-Name: 406f79183736b6ad360169b837172afef2c82a4312f5787db08c54167a44b15e
2018-01-04 19:54:55 +00:00
drh 595a0e2a4a Enhance the memvfs extension so that it can be read/write.
FossilOrigin-Name: 04c9197d589666299aef86ee6a56df63448c050274c9fba4af94f932752be237
2018-01-02 16:02:50 +00:00
dan 0cde0c62b1 Have zipfile support DELETE commands.
FossilOrigin-Name: 01d4e866fb7b01aeada537d41c4a47747c7810e2028f51077ee5b8b78c348954
2017-12-30 18:32:27 +00:00
dan db0cb303ad Rearrange things a bit so that writing to a zipfile does not invert the order
of objects it contains.

FossilOrigin-Name: f69e8194bfa7de436c96028730ebd57f186d2e6207792e172e1aa38c7f4211c9
2017-12-30 14:26:29 +00:00
dan 373dc3bb3f Update ext/misc/zipfile.c to support creating and adding entries to existing
zip archives.

FossilOrigin-Name: 2dec2dec592c0726ebe87b841b9c8d493dea7074a99f278eb1bf0b744d658a9d
2017-12-29 20:19:03 +00:00
dan b5090e4897 Improve the shell tool ".ar --list --verbose" command.
FossilOrigin-Name: b64681a644c419bb98d00980a6cb56ef5a0aff5ef5321955631f0b4c88aac283
2017-12-27 21:13:21 +00:00
dan 5a78b81b1b Have the shell tool ".ar --list" and ".ar --extract" commands support zip
files. Currently the "-zip" switch is required.

FossilOrigin-Name: a532a0f6fd59e81086d46f09151ba7fb26725198231d902c71d0f95cb01dbe91
2017-12-27 18:54:11 +00:00
dan 9ebfaad25d Add new file ext/misc/zipfile.c, containing a virtual table for read-only
access to simple zip archives.

FossilOrigin-Name: 8e366b99b13d765d8bf000a7ec5919e582702e51dc07c27a746b6002898a2302
2017-12-26 20:39:58 +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
drh 844cf56bc6 Merge recent enhancements from trunk.
FossilOrigin-Name: edceaccd66a65d6b36e53ce33d760a7bd9c2261a592d12189f5f55417b5d5d74
2017-12-23 18:40:39 +00:00
drh 60ba57d9c5 Merge enhancements from trunk.
FossilOrigin-Name: 150f07fec1e6d1fc0601820d717d8712fc513fe0d4bed67c8679eb51bca30d53
2017-12-23 18:34:49 +00:00
drh efc88d020c Modify the new sqlite3_vtab_collation() interface so that it takes a
pointer to the sqlite3_index_info object passed into xBestIndex rather than
an sqlite3 connection pointer, which the xBestIndex method might not have
access to.

FossilOrigin-Name: 5c1fe6666019147a26480b5db1bf2f474a5d072c234c736f16ed5d2a9a040b3f
2017-12-22 00:52:50 +00:00
drh 36e31c6915 Change the name of SQLITE_DBCONFIG_FULL_EQP to be SQLITE_DBCONFIG_TRIGGER_EQP
(which we can do without breaking compatibility because the former name has
not yet appeared in an official release) and streamline its implementation.

FossilOrigin-Name: fffc7685d19f78ec322a4e834ad727af20a17e2e1c35680e4b1c4162c4786f60
2017-12-21 18:23:26 +00:00
drh fafd6fbb49 Add the experimental ".expert" command to the sqlite3.exe shell.
FossilOrigin-Name: 0821bae7afefed98102c81104b4a477e81816bb1f43353c80865411771e3c5a7
2017-12-21 02:17:02 +00:00
drh 0872e268ab Lowercase local variable names in the SHA3 extension in order to avoid
collisions with macros in termios.h.

FossilOrigin-Name: 3ec7371161bd617e40328aa015b09acc2b37b0b5d269a87050a0c57163f92801
2017-12-20 23:46:29 +00:00
dan e42e1bc594 Fix crash in sqlite3_vtab_collation() when called for an IS NOT NULL
constraint.

FossilOrigin-Name: ad38d2c4f073705c02c7b38675e8ae86fe4a794d54eb796e7ed51a905824d5f5
2017-12-19 18:56:28 +00:00
dan 43efc18669 Experimentally add the SQLite expert functionality to the shell tool.
FossilOrigin-Name: 51068dbaeaef13bb80af8126b8c4f3a454dee63de5127d706db50bf789533e60
2017-12-19 17:42:13 +00:00
dan 11546779b7 Merge latest trunk changes into this branch.
FossilOrigin-Name: d5b597b52a1213cdf382d96f4df3535727be0852b25bafd12bbef54da946c5f2
2017-12-16 19:16:24 +00:00
dan d1b51d4955 Do not use the compress() and uncompress() functions in ext/misc/compress.c -
they are not quite compatible with the spec. Instead use new functions in
ext/misc/sqlar.c.

FossilOrigin-Name: 7652b3c2374084047b6c1da3e525e0cac34fe220597f81e793bc4fd9f33358da
2017-12-16 19:11:26 +00:00
drh 468c649331 Add unnecessary initializations to some local variables in the rtree module
to suppress false-positive compiler warnings coming out of MSVC.

FossilOrigin-Name: 64487d658cb3b6c8c67f1e198c70813c963de52599f3ea974bdc2aa432e74de9
2017-12-16 04:37:15 +00:00
dan 2c44e370f1 Enhance the "swarmvtab" extension. See header comments in ext/misc/unionvtab.c
for details.

FossilOrigin-Name: 01c173651ab22b7b0c139eded6f2ad8504efd09088df8ae6a3471230ebf2306f
2017-12-15 20:21:17 +00:00
drh dd2a43a225 Fixes to the appendvfs.c extension. Add the "sqltclsh" application that
uses appendvfs.c to find its scripts.

FossilOrigin-Name: ee248b529c2396c5480fb99b0a1dc31032627ec8241eca4a8c0fff257bb4a088
2017-12-14 19:24:00 +00:00
dan ac15e2d7cc Have the writefile() function optionally set the modification-time of the
files it writes or creates. And many small fixes to the new code on this
branch.

FossilOrigin-Name: 7b51269caebe1492885fe9b965892f49a3f8bdb1d666b0203d594c30f9e83938
2017-12-14 19:15:07 +00:00
drh 233ff96ec5 The "apndvfs" VFS shim now appears to be working for both reads and writes.
FossilOrigin-Name: 7f7b72d83633922e2b5dbf0d3455d0fea72cc6b8925ffcb78dfbad7b3c4b26e9
2017-12-14 16:57:11 +00:00
drh e483d349ab Add the ability to write to an appended database. This check-in compiles
but is otherwise untested.

FossilOrigin-Name: e343c63cbd754f37c33c939cd0b6f1ecc6202e60c6e66cd65c23cc8d571a994e
2017-12-14 16:28:27 +00:00
drh 32b5fdcaea Bring in the latest trunk changes.
FossilOrigin-Name: 75d8517703f7efa33437079108e2c4ef0de1a118bbe1f4a86afdc34da09d3008
2017-12-14 14:50:49 +00:00
dan 7d935ab46d Merge latest trunk changes into this branch.
FossilOrigin-Name: 803156cba8b056a1cb8d1bb186a57454afe72341abe7de1dfe529234c3415cd2
2017-12-14 13:55:01 +00:00
dan 34aebb88da Change some LSM code internal typenames from "Blob" and "Pgno" to "LsmBlob"
and "LsmPgno". This allows the LSM code to be compiled as a single unit with
sqlite3.c.

FossilOrigin-Name: 30bf38d589adf0b2eb613e184ffb03ed7e625736cb04fd5c341328f72bc5ef4d
2017-12-13 15:32:33 +00:00
dan 62128540ef Add script to amalgamate all LSM files into "lsm1.c".
FossilOrigin-Name: e32b69d73062e233b0ac853611d10b24546a346a603289ab0e339a3604ae2af4
2017-12-13 14:22:48 +00:00
dan d4b56e5901 Add support for parsing options in non-traditional tar form to the ".ar"
command. Have writefile() attempt to create any missing path components. And
not to throw an exception if it is called to create a directory that already
exists.

FossilOrigin-Name: 38dbeb1e777aa7ec742aa27002ad4dcee28af520dc43de96e5c56c39f16574ff
2017-12-12 20:04:59 +00:00
dan 1ad3f61b81 Enhance virtual table "fsdir" in ext/misc/fileio.c. Add support for "-C" to
the shell command's ".ar c" command.

FossilOrigin-Name: 0394889afed2479773af594e2d9659cf58b8959004ebcdeaff8e08e5dae684ef
2017-12-11 20:22:02 +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 21540ae479 Add compile time switch SQLITE_ENABLE_ICU_COLLATIONS. For enabling ICU
collations without also enabling the tokenizer, the LIKE operator, the
REGEXP operator, or the unicode aware upper()/lower() scalar functions.

FossilOrigin-Name: a079f914522d7bc4b3d27d70114eb09adedfac936a64883e6ed8d382c428dd0e
2017-12-08 16:23:38 +00:00
dan 25c1218e73 Add the ".ar x" command to the shell. For extracting the contents of sqlar
archives.

FossilOrigin-Name: 0cc699d14adfe8c7b7be50c180186562861806c47425c80c935bce43ee5c5c12
2017-12-07 21:03:33 +00:00
drh 70fedc584d Fix harmless compiler warnings in the rot13 extension.
FossilOrigin-Name: 113470772b04210b9300803124c06af2c0b33278313b311fefe6f80594b24e4a
2017-12-07 16:51:25 +00:00
dan fd0245d771 Begin adding support for the sqlar archive format to shell.c. There is no
"extract" command so far, only "create".

FossilOrigin-Name: c9827a01a6e107f38f85c2b2c1c7a599e443067b106217e965b6936441ca619d
2017-12-07 15:44:29 +00:00
dan 3d9c7c3a4f Merge latest trunk changes into this branch.
FossilOrigin-Name: 373fa21bffd37053bb1a741d3ace2f003a5639bf373c20ea7bb24a31080888b3
2017-11-29 16:16:29 +00:00
dan d37ce8396a Add the "^" syntax from fts3/4 to fts5.
FossilOrigin-Name: 24d7058e2799133dd681d2fef341025ca50554861bb4cd39e93ee87ae1d8a605
2017-11-24 19:24:44 +00:00
dan cda185d3a2 Ensure that empty space on pages is zeroed before they are written to disk.
This helps with compressed databases, and stops valgrind complaining about
uninitialized bytes and write().

FossilOrigin-Name: 5ffec5db33137251090d45e2ca7e3e7823e3215ae89822d905923424ceba2ac2
2017-11-16 20:48:47 +00:00
drh 7e8cf76c8a Merge all the latest changes from trunk.
FossilOrigin-Name: 1a1a73b821eb1a22ca335f582a0aea31c71ca9f5b09d54f26409691c90e38c4a
2017-11-15 16:29:02 +00:00
dan 3e846cb81f Fix a problem causing LSM to add unnecessary padding to empty segments in
compressed databases.

FossilOrigin-Name: 1bc2d04645c5239ba9a30a13f6fb3c8cc46461c864e7927012bc0ad305eb705e
2017-11-08 11:14:53 +00:00
dan 0e90ad6a37 Fix handling of partial indexes in checkindex.c (sqlite3_checker).
FossilOrigin-Name: 31932a9eb8dbb33d5535715ae8bbfdc55ce66b1a1a0abd57cefe720eeb31e231
2017-11-07 19:02:00 +00:00
drh 0714a0dee1 Add the --trace option to the sqlite3_checker utility program.
FossilOrigin-Name: dc217b7cfe680044d8742e317701abd0269162da8f5cb097361ae7f47fd9ba2d
2017-11-07 16:54:20 +00:00
drh 7031b12c57 Enhance the checkindex.c virtual table so that it will output the
index_name and after_key parameters.  Also add a new diagnostic output
column named scanner_sql which shows the SQL statement used to implement
the current index scan.

FossilOrigin-Name: 32e2520ce91351acceda845d81c9567f7a634257dc2b5b90fe6fb6583d8c0f87
2017-11-07 16:23:24 +00:00
dan a3bc84255a Fix an LSM problem with read-only connections and compression (not
compression-factory) callbacks.

FossilOrigin-Name: 51ee5188b03c4b9508e94afaee4bf1f224aef28875efabda8ce09a5ab641d99e
2017-11-04 08:53:37 +00:00
drh 537e70289f The extensions functions in spellfix are all deterministic.
FossilOrigin-Name: 29ec855e13e0dcd675dcf12948b42f9e669d0a31c5d9efb95857888aba0beeee
2017-11-03 08:46:48 +00:00
drh a48a290bcc Fix harmless compiler warnings in sqlite3_checker.exe
FossilOrigin-Name: 491f867b377b3b9e00bd713fb07df00207673f9eca0e7d5b7af7974082c8e3f0
2017-11-01 19:58:25 +00:00
drh 7dcde38f59 Make sure the JSON1 extension is available to sqlite3_checker.exe
FossilOrigin-Name: a946a8ed46ba76b9a09bcbac58000d3d92db1f08a98f6cc12365be696d8921de
2017-11-01 19:50:11 +00:00
drh 9b37b366c2 Adjust page numbers in the ext/repair/test/checkfreelist01.test module due to
the fact that the pending-byte page is no longer shifted down to a low-numbered
page but is in its rightful place.

FossilOrigin-Name: c1641affae31a4350727ce940c92499263880e672dc2c3f47e78e1c23ae99b78
2017-11-01 19:22:08 +00:00
drh 3680e89b1e Add the "sqlite3_imposter DB SCHEMA ROOT SQL" command to sqlite3_checker.
Use it to fix the checkindex01.test module.  There are still errors reported
by the checkfreelist01.test module.

FossilOrigin-Name: 0593a2ba74c886afe8a65cea1310025bb9777c320d093278044719210c9f6ba2
2017-11-01 18:31:34 +00:00
drh 37ab9523fa Move the test scripts for checkfreelist and checkindex over into the
ext/repair/test directory.  Run them now using the sqlite3_checker utility
with the --test option.  Some tests are currently failing due to an
incomplete port.  This is an incremental check-in.

FossilOrigin-Name: 17f8d5e111a9fe5b074f946e23936ae5a2a7a8d8018bad4212660d8eb81c04b7
2017-11-01 18:05:32 +00:00
drh 02c21b7e34 Minor cleanup in checkindex.c. Add progress displays when checking a
single index in the top-level TCL script for sqlite3_checker.

FossilOrigin-Name: 3ca31cc3ffe1cce4a9961d29801eebd47f0093d1b53d0ea63386338a1d434fd3
2017-11-01 13:09:02 +00:00
drh 24fa4d57a7 When sqlite3_checker finds a problem, show the row key as part of the error
message, not the row index number.

FossilOrigin-Name: 6ffe917d10e298cd80cd3a8c8c5116a2819145a176fb8cfccd5dbd88b10f39df
2017-11-01 01:05:41 +00:00
drh 1fae37319e Actually perform index checks when running sqlite3_checker
FossilOrigin-Name: 54530020260ea9e4cfd021f5ffccb74d78c469b717dce377d3df6eaf84b63719
2017-11-01 01:01:20 +00:00
drh 4e8ad3bc14 Begin putting functionality into the sqlite3_checker binary.
FossilOrigin-Name: e82e883b93128e4d1105a82abe8d1860c0a15505b6ca421e187b9bbbc2fdc659
2017-11-01 00:10:34 +00:00
drh 927dd51fce Add the checkfreelist extension to the sqlite3_checker binary.
FossilOrigin-Name: 0c22f0d6d19e595c0577b0bad416522e71647f54d2eb5cda587e2ccc5f63dd6a
2017-10-31 18:09:40 +00:00
drh 2737fa0376 Add build infrastructure for the sqlite3_checker command-line utility.
FossilOrigin-Name: 429e3c3c85d6b677038be93567f93e69eb756442bb421bb02ee5d5d69290fa09
2017-10-31 15:49:19 +00:00
dan 7eded5925b Fix a couple of issues in incremental_index_check to do with CREATE INDEX
statements that contain embedded SQL comments.

FossilOrigin-Name: 2aef41815a9f1786ebdf09d8f6cfa59a8e7d733253eafeae24fa6e2a093bb1d8
2017-10-31 12:01:01 +00:00
dan e7a579d27d Add support for indexes on expressions to incremental_index_check.
FossilOrigin-Name: 8c1c701fdbe0d56ee7f6f7d7b583aafde9fa14acc93ee8ecaddc8bb311e2bf52
2017-10-30 19:38:41 +00:00
dan 75650d4f94 In checkindex.c, use C code instead of SQL/group_concat() to compose various
SQL clauses. This is to make it easier to support indexes on expressions.

FossilOrigin-Name: 940606b3af059eb3f79d71fec871ea88df8bce0349f5b33b79c147a85610e269
2017-10-30 17:05:18 +00:00
dan 6fc6617909 Fix an issue in incremental_index_check with indexes that use non-default
collation sequences.

FossilOrigin-Name: 3ebb2351e2650d263029d2c0042683cba3529c9d3f76b5f994f2e737b84d3f67
2017-10-30 08:04:38 +00:00
dan 19465e7380 Fix "after" parameter handling in the incremental_index_check code.
FossilOrigin-Name: c40c3c62e996044f31ca49ffc2edb2cc0320e69956f7ee6fe3e9012200e0d9a0
2017-10-28 20:31:25 +00:00
dan bde13e2694 Add the start of the "incremental_index_check" virtual table in
ext/repair/checkindex.c. For incremental verification of index contents.

FossilOrigin-Name: d5b9dada471358a2864727759648b763bf6890fc2521fac53c0d8216017d39b7
2017-10-27 20:53:16 +00:00
dan 7e2b38c53b Add tests cases and fix minor issues in the rtreecheck() function.
FossilOrigin-Name: d6130cd226c0ca95e02f0cbabfdc27071acdcf83e0d0cb0eaa47d992479ed9a1
2017-10-25 18:17:24 +00:00
mistachkin 8c66e5b73e Fix compilation issue (C99-ism) seen with MSVC.
FossilOrigin-Name: 61870b42b033189509b244c76d28932f7a447b887ffe04a3c81461148e54cfb5
2017-10-25 18:00:58 +00:00
dan 1917e92fdb Add SQL scalar function rtreecheck() to the rtree module. For running checks
to ensure the shadow tables used by an rtree virtual table are internally
consistent.

FossilOrigin-Name: dde0bb3eab1316c3247b1755594527ca70955aab4ad4907190731f7ec092b327
2017-10-25 16:38:34 +00:00
drh 98d529b541 Add the sqlite_btreeinfo eponymous-only table for introspecting the schema
and estimating the sizes of various btrees.

FossilOrigin-Name: 1e30f4772db1e1086096f72d32e87c552923be8b264aa13cf822fae754eb083d
2017-10-25 01:34:24 +00:00
dan b5ef728db6 In lsm (not SQLite), avoid opening the *-shm file before the database file is
locked. Otherwise, there is a race condition whereby a connection in another
process process may unlink() it while it is still in use.

FossilOrigin-Name: c8b8b9b573665c2b4d278bb679a48ac407374b8d860f0c3f4d50a303043464ad
2017-10-23 11:48:00 +00:00
drh 3be8b1a4f7 Initial implementation of the appendvfs extension. Untested.
FossilOrigin-Name: 063a03a3779e8c032dd006712facaaa6d60964425701ea10c753ff981a8f2bd9
2017-10-21 12:59:27 +00:00
drh 277ee81bab Create the new ext/repair folder and move checkfreelist.c there. Remove
checkfreelist.c from the command-line shell (undoing check-in [48418f2e]).

FossilOrigin-Name: dfdebd12bfc80b91d234ab328cb6106d5d37ccb79b58e36e556c1a8af640a4ab
2017-10-12 19:50:28 +00:00
dan 518e3f0673 Merge latest trunk changes with this branch.
FossilOrigin-Name: 2719cf5c5bbe8e31d18368d54d968af3878ad2e15f0666e18d7b567d7439c451
2017-10-11 20:26:07 +00:00
drh f294ce648b Add the checkfreelist extension to the command-line shell.
FossilOrigin-Name: 48418f2ed5ab1cb270776166141ce32ed3ebf22ed4e33a66a204d4fde9d11f52
2017-10-11 18:26:26 +00:00
dan 7d157f91f4 Check that the leaf count on each freelist trunk page is in range as part of
checkfreelist processing.

FossilOrigin-Name: 4e89406248f51d3b83d61e5472fb493f3d3b4ff2a69bf256c7e15445eeb2f3ec
2017-10-11 18:21:44 +00:00
dan 36187fe8c2 Add new extension "checkfreelist", which uses sqlite_dbpage to check that
there are no invalid entries on the database free-list.

FossilOrigin-Name: 21930ef5376261d95fa325be7761d327a350d4ae6b4573c83ddb4d294dea51c4
2017-10-11 18:00:34 +00:00
mistachkin 94ea27f808 Fix harmless compiler warnings in FTS5 seen with MSVC.
FossilOrigin-Name: 5594a121bf132a98d0ecb4cf86d9f2681925c9416206096bf11c9370a5dae22f
2017-10-08 02:22:06 +00:00
drh 5aa1e7cd30 Disable the delta checksum verification in RBU by default. Reenable it using
-DRBU_ENABLE_DELTA_CKSUM, if desired.

FossilOrigin-Name: d22c99b6ba997179ef3ccd341d9c36d5213d699305d15942d82587a0bfd16f9d
2017-10-05 11:29:37 +00:00
mistachkin 3dfbe9b3fc Fix typos in session extension header comments. No changes to code.
FossilOrigin-Name: 182ec9d6f6c44938de0a2cd542e259d082deeeabc12a1815fff35e3ed1e524ef
2017-10-04 16:35:01 +00:00
drh 8dfde89bc6 Fix harmless UB in the ICU extension.
FossilOrigin-Name: 68e9a840d9cfbf4988e1a68c34e809d15d0235998cf0bfa147a1ab88ea842a61
2017-09-21 19:08:25 +00:00
drh 9616805728 Fix a potential use of an uninitialized pointer in RTree following an OOM
error.

FossilOrigin-Name: fd4ec0cdbd84f3333dd4c7a4236491bce6b9ab21fb2c088751ca1279b31bd864
2017-09-21 13:11:47 +00:00
dan 460f1fa55c Add extension "mmapwarm.c". Provides function sqlite3_mmap_warm(), used to
"warm up" the memory mapping used by SQLite in mmap mode to access db file
content.

FossilOrigin-Name: d4a30b91f9aad93510baead8c04ee51b82c98763be5a224ed4873298214c963a
2017-09-18 16:28:56 +00:00
drh 2acd24d90c Fix the CSV virtual table extension so that it works when the default character
is unsigned.

FossilOrigin-Name: 42f07775556758754e92e29a759d200d0d81d16eee83ab982b840db11292f834
2017-09-18 00:18:31 +00:00
dan 1273f8dafe Fix a comment describing the xRowid method of the "series" virtual table. No
code changes.

FossilOrigin-Name: 868cd1960015dc1bf003f911dcc417a94540d1948617ea1838a48b5cff59afda
2017-09-05 17:23:39 +00:00
dan f21124f251 Add experimental API sqlite3rbu_temp_size_limit(). For limiting the amount of
temporary disk space RBU uses.

FossilOrigin-Name: 7fdd629830679db620d477df3c206bf84598cc935ccb51547c0d8444a186b63e
2017-09-05 16:24:38 +00:00
drh 6362bbe68d The RTREE extension should return SQLITE_CORRUPT_VTAB, not just SQLITE_CORRUPT
when it encounters incorrectly formatted shadow tables.

FossilOrigin-Name: 0712f057ef3dcd907984dda30f6d961a29b61c1d2b25627028c4e227ec85dbba
2017-08-17 18:17:24 +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
drh 140efc90ea Improved comments in the header of the LSM1 vtab module. No code changes.
FossilOrigin-Name: aa49926dbffaae4f7c486be72ad814f381cca65c549f9d2605f47540a5f4be84
2017-08-11 18:55:04 +00:00
drh cb96d2a79c New test cases for LSM1.
FossilOrigin-Name: cb0c49cbd1eede157c5bd60d1e28e02c642aefe1ff82553eac1117a4c73dd9db
2017-08-11 13:51:41 +00:00
drh 037a2bacb0 Convert the LSM1 virtual table to be WITHOUT ROWID and get UPDATE and DELETE
operations working on it.

FossilOrigin-Name: 2164031b509dc6eae367ffb9d915f3e1d33d26210506b2de8b2bfca38c53465f
2017-08-11 12:49:59 +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 6fa9375c01 Add a first draft of the "vtablog" extensions that implements a generic
virtual table useful for experimentation using the command-line shell.

FossilOrigin-Name: e49279e65169a939b6058a0960dc1fe09ce4ee2d78992a1969773cbc7ce1043b
2017-08-10 03:27:27 +00:00
drh 7524b613c5 Preserve the error code from xConnect or xCreate methods in virtual table
implementations when they are encountered during parsing.

FossilOrigin-Name: dcdf091388251292ff9939bdff920708320bc64dacfe0fa1878c5ffd11b679c9
2017-08-09 22:55:09 +00:00
drh 73e00cf056 Various bug fixes for the new LSM1 virtual table design.
FossilOrigin-Name: 94434a252f0f2b57f325fd8fb82534f20cc1340ff13076cd88deeb47740ef6a2
2017-08-09 19:27:24 +00:00
drh 2e27d28fec Work toward redesigning the interface to the LSM1 virtual table.
FossilOrigin-Name: 313df946668b943b0a9a9a91fd7bafa7212d05765c7714fa6c0de46aa9062a74
2017-08-09 18:40:35 +00:00
drh 4f57352937 Enhance the CSV virtual table extension so that it accepts the last row of
the CSV file even if the last row omits the closing \n, as long as the last
row has a full set of columns.

FossilOrigin-Name: 537e3be2e9503183799afffcd91defc751fea2c779e9b77b77f9485f7de5d170
2017-08-08 20:03:10 +00:00
dan 226744d11b Fix a segfault in swarmvtab that could occur if there was an error in the SQL
statement passed to the constructor. Add other test cases.

FossilOrigin-Name: 6ce8b7ca62fcf97875395fc1a989179309e0abb48d4465658ef0d871434ea057
2017-08-05 16:15:33 +00:00
dan 7d90417733 Fix memory leak in swarmvtab.
FossilOrigin-Name: 002a9c7baccf3417c56ec7d16755ea32fdd70a654ffc75f2fc4624fd2b688aed
2017-08-05 15:30:46 +00:00
drh 1451778a88 Add the swarm virtual table to the existing union virtual table module.
FossilOrigin-Name: 0f6f6f03deaba2f4bdd168980647136e8ddff4907863b62b3056b8e4665599df
2017-08-04 20:27:13 +00:00
drh a5aed4b10b Add the optional non-found-callback to the swarm-vtab.
FossilOrigin-Name: a94e2f600bc766fb459418e674b842628ba21e27cf9942c00cd533507d7b35fe
2017-08-04 20:15:08 +00:00
dan d83e082524 Add further test cases for swarmvtab. And minor code changes.
FossilOrigin-Name: 0f82d3b9dd5bd2e34a984c78e4a4a87921cf3e15b01b611133378c0ea9901010
2017-08-04 17:39:13 +00:00
dan 0ff2217035 Add test cases and associated fixes for swarmvtab.
FossilOrigin-Name: 7ae20eac83fc053dc1bbc42501dd41f77445a6b9a33cfa42b899fc7a18c637ab
2017-08-04 16:16:32 +00:00
dan a64d1fbc23 Modify swarmvtab to use a separate database connection for each database file.
FossilOrigin-Name: 1f05ad29c3a540408470da7f8111f1319f961539c1a96b1a81abf1423af90f15
2017-08-03 20:13:00 +00:00
dan f48d4ef8bc Add SQLITE_API qualifiers to public API functions in header file sqlite3rbu.h.
FossilOrigin-Name: d8637badf63b90b650e9d6dc970c7e1ce46669ce8272f46f01fac9bd97c1b0fc
2017-08-03 15:50:10 +00:00
dan 0c2e5cfda5 Fix some problems in RBU test cases. Also update RBU source code to better
handle the trivial case where an RBU update is applied to a database zero
pages in size.

FossilOrigin-Name: 7676b39bc120ae23da0c6a14452eb99a58901ee45c3d43b8beae426f9e4dc0c3
2017-08-03 15:43:55 +00:00
dan 63331b1af3 Enhance the code in unionvtab.c to also provide the "swarmvtab" virtual table
module. There are still several problems on this branch.

FossilOrigin-Name: 03d94388d62fd0f1fae377d273bbd5561208adc34bd97f7ce27783b30a369fd7
2017-08-02 19:59:56 +00:00