Commit Graph

18256 Commits

Author SHA1 Message Date
dan 7834551c1e Have the header comment for sqlite3Checkpoint() mention TRUNCATE along with
the other three checkpoint types. No changes to code.

FossilOrigin-Name: e1e3ca7ea43a68b9b57dc38d8855f63b63a53feb8128b666a1becf87a2c70341
2017-09-08 17:48:00 +00:00
drh 05f1ba0ef8 Prevent a possible crash when trying to recover using a carefully corrupted \
and truncated rollback journal.  (Test case in TH3)

FossilOrigin-Name: 02828d717e2d97b1f59e9279cea9c06eed4accd4e262606bd90d060449c5a1a3
2017-09-07 09:56:37 +00:00
dan 3841372350 Update "PRAGMA integrity_check" to detect inconsistencies between a single
record's header and body.

FossilOrigin-Name: 9e393a0edf1a578ddecc16a72fe3c54b75c2a650d507bcbc37c9724fbede1494
2017-09-05 20:16:19 +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
mistachkin 88a7973057 Use the SQLITE_CORRUPT_BKPT return code in a couple more places.
FossilOrigin-Name: 72d22c226bf4311345e8844fd9801ebddf77aceb80a038dce46608bf4ccae636
2017-09-04 19:31:54 +00:00
mistachkin 050dc5cff4 Add the 'mksourceid' executable to the clean target for MSVC.
FossilOrigin-Name: 77854694b2da989aa4dbbdbd3ccf61756c46cc368de9731f5fd1c3aa38d7cad5
2017-09-04 18:44:54 +00:00
drh 7e6f980bd4 Proposed fix for ticket [b899b6042f97f5]
FossilOrigin-Name: c7f9f47b239fdd99b555fb0a31eb82b22dbe6c821f1612d67a0d6a822288d9f7
2017-09-04 00:33:04 +00:00
drh 70739addc2 Fix recent test cases in test/indexepxr2.test so that they work even without
SQLITE_ENABLE_STAT4 and SQLITE_ENABLE_JSON1.

FossilOrigin-Name: 03f3cc03aaf233ad663d32a0200bfafee24a6c81f6a0ad14094ff014f880f00f
2017-09-04 00:19:29 +00:00
drh 3908fe90b1 Add the new sqlite3PagerUnrefPageOne() pager method to deal with the special
case of unreferencing page1.

FossilOrigin-Name: b2e2100cf766da1cb499aec0ca0a9969d7af5d93312ab8cf895fbf4a6ffb9b2f
2017-09-01 14:50:19 +00:00
drh dfcdc663f2 Remove an obsolete optimization in pcache that due to more recent changes
was recently making the code a little slower.

FossilOrigin-Name: c4e7e175eecfd79015f4fae99618dfce6baf97c21bf3c909ea535d4e12dcaaad
2017-09-01 12:57:33 +00:00
drh f0dae6d0a2 Small size and performance improvement in pcacheManageDirtyList() by not
zeroing the PgHdr.pDirtyNext and PgHdr.pDirtyPrev pointers for PgHdr objects
that are not on the dirty list.

FossilOrigin-Name: 919863b14859d958d6c078097faae02070c7bd082e2814cf3f84bd84921e4419
2017-09-01 12:18:41 +00:00
drh 38688b0b1d Clarify the documentation about "protected" versus "unprotected" sqlite3_value
objects.  No changes to code.

FossilOrigin-Name: 4094a3410e05597d0adc740d161e0358a3041c5a4e73bde35b1e983594c6879a
2017-08-31 21:11:52 +00:00
dan 9c1cf3235c Remove unnecessary "__declspec(dllexport)" qualifiers from generated file
shell.c.

FossilOrigin-Name: bcc20be5b290c563183e82a590cc1fdabadfb13475fd8f6b3d810365cea5d868
2017-08-30 13:21:17 +00:00
drh 617b7b42e3 Small performance optimization in pcache1.
FossilOrigin-Name: ffd437da9541f8a2792e3e07c0a43f388f856fdc211fe42755eb51bfa5995d9f
2017-08-30 04:44:59 +00:00
drh 52fb8e1945 Faster memory allocation from lookaside by not trying to keep track of the
number of outstanding allocations, and rather computing that value only
when requested.

FossilOrigin-Name: a06263f1efd2d45eac88b8d59e8fe8e458670fa3808c795feaa7f247fc36cbe9
2017-08-29 20:21:12 +00:00
drh 83bebddbd9 Add the --enable-update-limit option to the ./configure script.
FossilOrigin-Name: 64a8ae68381b7fbb29b659901ca7ce8d50510e4753758d5761f7e41539288cef
2017-08-28 17:00:12 +00:00
drh 52df6f5e5c Avoid unnecessary mutexes in the pcache1 implementation in the common case
where no auxiliary page cache memory is configured.

FossilOrigin-Name: 1ba051e34d7512ab5e8fc969c1b5aaaf827b8e6493ba4235895257aca78b500f
2017-08-28 16:11:05 +00:00
drh b2a0f75c06 Remove the rarely-used scratch memory allocator. This makes the code smaller,
faster, and easier to maintain.  In place of the scratch allocator, add the
SQLITE_CONFIG_SMALL_MALLOC configuration option that provides a hint to SQLite
that large memory allocations should be avoided.

FossilOrigin-Name: 54b000246cfb5c7b8adb61a17357ef5a49adddde9e48e8937834d5ba0beb8a6b
2017-08-28 15:51:35 +00:00
drh b3c4523c58 Backport changes to shell.c into shell.c.in.
FossilOrigin-Name: 2348045fbc3fc99e2b46095cc86db99815cd1f9254d30a3b72c2b15c02076a84
2017-08-28 14:33:27 +00:00
drh 20554381d9 Fix the ".dump", ".schema", and ".fullschema" commands of the command-line
shell so that they work even if PRAGMA empty_result_callbacks is enabled.
Fix for ticket [02f0f4c54f281].

FossilOrigin-Name: cf0d3715caac9149e65bb4802fd179d0952cfaf9add17ac243c6ca87cbd6e6b7
2017-08-28 11:12:57 +00:00
drh f49759bf03 Fix a few over-length source code lines. No functional changes.
FossilOrigin-Name: 1783c54ce9dcb4b2c4f2a66f6d3315e646b71b54a8899fc32a7bf0f935a21f7f
2017-08-25 19:51:51 +00:00
drh 36494b8bc6 Size and performance optimization for sqlite3Init().
FossilOrigin-Name: 776d91284a891bec64d6f649ff17de898b6ac6f66dd3d2afccc394a012a40c7d
2017-08-25 15:43:34 +00:00
drh 83e8ca54d1 Small performance optimization in sqlite3WhereBegin().
FossilOrigin-Name: 39f708d1e286931365a8992dbe7f900108ff1dad146032a284ad1dec09b11e06
2017-08-25 13:34:18 +00:00
drh 6034846eb6 Convert a branch made unreachable by [59560d07] into an assert().
FossilOrigin-Name: 2738b8db3caa6ce48d27cb5749d27b79241e6f6682b694886f6ef663e5443583
2017-08-25 13:02:48 +00:00
drh 95b46c85e2 Improve the internal mechanism used to keep track of what kind of syncing
to do for WAL transaction commits and checkpoint operations. 
Use the checkpoint-style of syncing to sync the header of a new
or restarted WAL file.

FossilOrigin-Name: e8d23afe8478e42779ec1dd602ca2d77d4f3c26c4d54f52112c5aaa928536538
2017-08-25 11:44:51 +00:00
dan 1c305122a2 Avoid returning duplicate rows in experimental pragmas "pragma_list",
"module_list" and "function_list".

FossilOrigin-Name: b79cc8dc88c8ae03daff1290fd650b2b0e6f673ec9d83be6a533a57172930190
2017-08-25 09:17:14 +00:00
drh daaae7b9d1 Update the mechanism used to keep track of what kind of syncing to do for
WAL transaction commits and checkpoint operations.  Use the checkpoint-style
of syncing to sync the header of a new or restarted WAL file.

FossilOrigin-Name: bf65dae8d4297c57ac63228ccf0100f9fabf2fb600438c9f2e10a29c4b118168
2017-08-25 01:14:43 +00:00
drh 9c6e07d2fa Fix an incorrect hyperlink in a comment.
FossilOrigin-Name: 25292b9a4eb5efc7db551da0b3c9cfd7e79da1594ee14729de44090e188c2b2a
2017-08-24 20:54:42 +00:00
drh 09e16491f6 Fixes to documentation about SQLITE_OPEN_URI.
FossilOrigin-Name: 7ec72314d6b66e4969833194fd032f01963bb861a7bb30d060acdb82dc5d62fe
2017-08-24 15:43:26 +00:00
drh 526740b1b9 Make sure the sqlite3_result_pointer() interface does not leave a VM register
in an inconsistent state.  Fix for ticket [7486aa54b968e9b5].  Test cases
are in TH3.

FossilOrigin-Name: d2f9230c5c7ad6166e7d2b649f77960fa58b1cb583e529a43882753ab348413c
2017-08-24 13:55:46 +00:00
drh 87d63c900d Performance optimization to pageFindSlot() in the b-tree layer.
FossilOrigin-Name: 59560d079fab4b91ec50855cc60349da178209c38fb6dae674ff874ccfc7f5fa
2017-08-23 23:09:03 +00:00
drh 5e398e4cbd Size and performance optimization to dropCell() and freeSpace().
FossilOrigin-Name: bc1ec123ce05c9d16b0942f870381145dc9725764e47806939ff207a73066f4d
2017-08-23 20:36:06 +00:00
drh 5e27e1dc49 Smaller and faster implementation of the fillInCell() routine.
FossilOrigin-Name: 77074990edef6c42bdfe7ccce1affc8ed64a86dde3ad4fa50b60ba0a6d851eea
2017-08-23 14:45:59 +00:00
drh 489a224bea Update documentation to make it clear that SQLITE_SOURCE_ID and
sqlite3_sourceid() might changes if the source code is edited.

FossilOrigin-Name: e69c0c8770d3cc2fcdc779c6290caf1575644d457326caa00327b9070251d620
2017-08-22 21:23:02 +00:00
drh 0a02c72e79 Less dramatic changes to the source-id following an edit. Modify the way
that the amalgamation is constructed to give it the opportunity to detect
changes and modify the source-id.

FossilOrigin-Name: 564c7340a3368501c3da885afde52123ed7f558801f6190cbe6173dfe9704b70
2017-08-22 21:07:03 +00:00
drh 48b9a6dd6b Modify the SQLITE_SOURCE_ID if the source code has changed in any way since
the previous check-in.

FossilOrigin-Name: 515d6a8377cc1dc76d2e78e242fe256cbeef1c1217ec35367648ddeeb17007ec
2017-08-22 19:54:34 +00:00
drh c9aed7f891 Trying again to get out-of-tree builds to work correctly.
FossilOrigin-Name: a1b3337e949fc431e19a3d977d07a312bb253ab7fec6811c0221abd514985d55
2017-08-22 19:49:34 +00:00
drh a172254742 Attempting to fix the source-id generator so that it works for out-of-tree
builds.

FossilOrigin-Name: 5a037ac2da7449be3e26c36910ac5d865d7e74d3c25af0a10578c1f92fe2afea
2017-08-22 19:43:41 +00:00
drh f39e0ed4de Add the "mksourceid" program to the build process. That program changes
the SQLITE_SOURCE_ID if the source tree has been modified in any way.

FossilOrigin-Name: d4c05e04f7e1325a3260808ee17252876f678e78bf0cf6569a18a52ff674bd7a
2017-08-22 19:19:00 +00:00
drh 2e2338101a Fix error tests in seldom-used compile-time branches of the unix backend.
FossilOrigin-Name: 885c2b44a44f8d054014e4079b2cac8279c11d13206d5b5215189ef75b9c5254
2017-08-22 15:21:54 +00:00
drh b40f06c62d Remove an unnecessary conditional.
FossilOrigin-Name: 56d19f9fd7b01d4ed5c3e7309977b43fedffee168c9760d3e3b7e885790f781e
2017-08-21 02:20:57 +00:00
drh b32c18bf42 Minor optimization to sqlite3VdbeMemSetStr().
FossilOrigin-Name: 6538ef7b6b56c7a6629a0bb7418910c64c8b2e73af2296a116c073ecf2e0d429
2017-08-21 02:05:22 +00:00
drh c84ddf14c5 Space and size optimization to the printf implementation.
FossilOrigin-Name: d01d2cffefd1cdb52b386e4983599534c0fbbe6aebda186db53200e4b2283f0a
2017-08-19 20:38:18 +00:00
drh 251866d07c Another size and performance optimization to readDbPage(). This time we
eliminate some unnecessary local variables.

FossilOrigin-Name: 745bc8decd18d4dc00589474fd3928a3a9f4156d09e05e6f5b8623de6491795a
2017-08-18 22:30:20 +00:00
drh 56520ab848 Size and performance optimization the readDbPage() routine in the pager.
FossilOrigin-Name: ca9e1875c3a893321d70a131fc4ffc76d169ad05e0b48b7006f53b6b467db4be
2017-08-18 21:14:50 +00:00
drh c68886bb9e For the unix VFS, avoid an unnecessary stat() system call prior to opening
any file in the common case where there are no unused file descriptors.

FossilOrigin-Name: 3075cfa07489eaf13cb9a2760e2391e79dd73181fe1730fae7bdcd6ad66d2a1f
2017-08-18 16:09:52 +00:00
drh 0f3f7664f0 Combine the OP_CreateTable and OP_CreateIndex opcodes of the bytecode engine
into a single OP_CreateBtree opcode.  This simplifies the implementation and
makes the bytecode programs clearer.

FossilOrigin-Name: eb1202b5e43f1f029ad2bdf845509e7f31361e4dc189943e5e2bd4462e2ef3f3
2017-08-18 14:34:28 +00:00
dan 62f6f51ae1 Only use indexes on expressions to optimize ORDER BY and GROUP BY if the
collation sequence matches. Possible fix for [e20dd54a].

FossilOrigin-Name: 37e1900880b70be6802eaf43b0e568fda709a1dd6083d8be11e5a7a7d1fda41a
2017-08-18 08:29:37 +00:00
drh ceb4b1dbdd Use the __builtin_clzll() function of gcc to improve the performance and
reduce the size of the sqlite3LogEst() routine.

FossilOrigin-Name: a42a438cbbd721765ca55e71c464552dbaa494050cf472593599b8c7f0249516
2017-08-17 20:53:07 +00:00
drh dceed86d07 Small optimization in the Expr tree walker.
FossilOrigin-Name: 264a5e1b75ee073bd019483e289c3d8d79abcf5a765435be23ac3c21b1db8246
2017-08-17 19:23:16 +00:00
drh 6f7fbcf0bb Size optimization in the authorizer error message generation logic.
FossilOrigin-Name: 0367a4d58682a64d7ed4c5a4b4377899e22432851587c649d419efb6d7bac250
2017-08-17 18:54:27 +00:00
drh efaffb64fd In sqlite3ViewGetColumnNames(), return the number of errors, not an error code.
FossilOrigin-Name: f13682ea2350ba366026a4a58e59591af378c496b92da60803c4c642c3bfc8de
2017-08-17 18:23:46 +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
drh 967f8f9e07 Remove an unnecessary branch from the [be436a7f4587ce517ddc] fix.
FossilOrigin-Name: fb6ca99b88c67414eab425e2b4ddb6a5e2fd48a6b2cd96a34627c86a5b568c9b
2017-08-17 14:47:56 +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
drh dc6b41ed47 Defer schema resets when the query planner is running.
Proposed fix for ticket [be436a7f4587ce517].

FossilOrigin-Name: a7bc7752ba0266684f5317e424a4ee9add4af002272082183519e708ab9ffc79
2017-08-17 02:26:35 +00:00
drh fe0cf7a18c Avoid a test for CURTYPE_BTREE in sqlite3VdbeCursorMoveto() in order to reduce
the size and improve the performance of OP_Column.

FossilOrigin-Name: f078deb25149b7b1881b7f3374b343d0677e82336d8fdd7f1cdd06d926b5dd57
2017-08-16 19:20:20 +00:00
drh 1f613c4df3 Remove an unnecessary local variable from OP_Column, for a small size
reduction and performance increase.

FossilOrigin-Name: 39543903282409ad3f139f8a0bb376661e7595a33af4f647945b1513a028ccb4
2017-08-16 14:16:19 +00:00
drh 95b225a46d Performance improvement in the OP_Column opcode.
FossilOrigin-Name: dc98a92f32511ee322b0207bd286e967248a8e59b418f11168eb31e34b0fa0fa
2017-08-16 11:04:22 +00:00
drh 6cd8c8c57a Small size and performance in the OP_Column opcode.
FossilOrigin-Name: 2cf3f3de8a48465bd6b0af7763bfe905f3bb0151488f63c9ecc3147bcb345094
2017-08-15 14:14:36 +00:00
drh 352a35abf5 Btree optimization: New field BtCursor.pPage that points to the current page,
saving a single pointer dereference on each access.

FossilOrigin-Name: 373b71d19cad785922d5a80828f2fee0cbe7dff6594743e625bbdfa31b1ca131
2017-08-15 03:46:47 +00:00
drh f38dd3b68f Minor size and performance optimization to sqlite3BtreeCloseCursor().
FossilOrigin-Name: 16969338841734d00ab906a94b82480c7e1e426eb0ddf7b9e6aed722aee5d91f
2017-08-14 23:53:02 +00:00
drh 44548e7218 Change the internal btree routine moveToRoot() to return SQLITE_EMPTY if
the table is empty or if it has pgnoRoot==0.  This simplifies the callers,
making them smaller and faster.  The SQLITE_EMPTY result code is intercepted
and changed into SQLITE_OK before surfacing in an API.

FossilOrigin-Name: 240d57143d943eaddd5f7c2d473f47a1d29417e61d28142f70f3d960bb9b30df
2017-08-14 18:13:52 +00:00
drh f0357d8b2c Fix harmless indentation error.
FossilOrigin-Name: 25e92baaaeb9e8a2650b3083d3febf3661ecf1e05d9d24b26fe9f87a03bdd8fa
2017-08-14 17:03:58 +00:00
drh 4dd89d5a24 Sometimes a TK_COLUMN Expr node can have Expr.pTab==0 if it is a reference
to an expression column in an index on and expression.  Fix for ticket
[aa98619ad08ddcab].

FossilOrigin-Name: d0da791ba0edfb65186459345e43500d8364a086a5a1651d828fecc1a1dd1edb
2017-08-14 14:53:24 +00:00
drh 1112cc797b Properly dequote column names in tables constructed by an aggregate SELECT.
FossilOrigin-Name: 7e0d3e9cb071873564b7916c022aba5cd9f3b8ebab9dba787ecd7113c5b7816a
2017-08-14 01:33:07 +00:00
dan 3c77a1e9f1 Add new test file fts5vocab2.test.
FossilOrigin-Name: 02174842c353bfaa747019cb3dcdee5bca6551d0a06d83fc1ac6d4569e16bc34
2017-08-12 18:31:31 +00:00
drh dccf4f2b15 Update the speed-check.sh test script to append log output to the end of the
cout-NAME.txt file.

FossilOrigin-Name: 14d262d6aa4e281dfe0490988f0c1965c4babf98038a1a96b9bb5772a61521a3
2017-08-12 02:16:34 +00:00
drh 3f18e6d7a9 Remove the zBase field from the StrAccum object. Resulting code is slightly
smaller and faster.

FossilOrigin-Name: 6e52fa5fd79988a433bae0152ceae036edab4bb18d2b48ed04c1f53f141728b0
2017-08-12 02:01:55 +00:00
drh 8abc80b294 Size and performance micro-optimization on sqlite3SrcListIndexedBy().
FossilOrigin-Name: 28a5aec118f9d078c9e7225f85cd48a91920b13908c540771e309557c3f15f84
2017-08-12 01:09:06 +00:00
drh b7f4b6ccca Fix compiler warnings that arise if the PAGERTRACE macro is turned on.
This changes does not affect production builds.

FossilOrigin-Name: 831156a4bd7c4408085f7c5584cdeebd1953c539972f80c5ef29bc147008630e
2017-08-11 18:59:00 +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
drh f41a8d3d9a Simplification to the like optimization logic. Remove unnecessary branches.
FossilOrigin-Name: 9466d952e169a6a60f6e575e679a61f05887b51c693505764edaf10f62cd829f
2017-08-11 03:47:21 +00:00
drh 21f6b626f5 Allow WITHOUT ROWID virtual tables to be writable as long as they have
exactly one column as their PRIMARY KEY.

FossilOrigin-Name: c601d128ff1f1dd6d221ee9f55595a95b58ba07d043e1d530743ea913731560e
2017-08-10 20:43:07 +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
dan 5b156b2bb4 Fix a typo in csv01.test introduced by the previous commit.
FossilOrigin-Name: f38ff718278c8ff477d1c6379ced32167063de15f0666c8eac2e4dd30cbd975c
2017-08-10 19:12:04 +00:00
dan 09fc79bd6f Add extra tests to this branch.
FossilOrigin-Name: b0e3b88a792623f7761586d8bfac058ddf939f49944ff0c4376627ff920895db
2017-08-10 19:10:23 +00:00
drh 4dd176eaab Test case for writing to a WITHOUT ROWID virtual table. The TCLVAR virtual
table is modified to add a "fullname" column which is the primary key, and
to accept update operations against the primary key.

FossilOrigin-Name: 6997e00c3221f266f4d9187501d8a9e5bafb85551e88a744cdc8ffe3b75ec2a4
2017-08-10 17:53:11 +00:00
drh e3740f272b Experimental changes that allow a WITHOUT ROWID virtual table to be writable
as long as it has only a single-column PRIMARY KEY.

FossilOrigin-Name: ab9ee4c1e64c09c7130e385a23d043d78bad95dff5509c7adc9b992350a4a537
2017-08-10 15:19:39 +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 ca03bdaf6e The identifier "vsnprintf" appears to be a reserved word in recent versions
of XCode, so avoid using it as a structure field.

FossilOrigin-Name: 795eede331b832a53e886318466dedc12504f7181c1d7295af7935864a04b72c
2017-08-08 21:40:23 +00:00
drh b8313cc998 Fix a faulty signed/unsigned character comparison in the LIKE optimization
logic.

FossilOrigin-Name: f4a4b1497355c1b27d3d0770550fffcc3b2d2d51ab284101f19e8fc4264ee675
2017-08-08 21:30:43 +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 b46dfdb81c Avoid casting a value larger than 2^31 to a (size_t) or (SIZE_T) on systems
where it is a 32-bit type.

FossilOrigin-Name: b26d7a1c7b5d59a2ceabc3716ccea32e26de729eb164a9c0e47f2d8f6ad3df37
2017-08-07 19:12:49 +00:00
mistachkin e35395a45a On Windows, avoid casting a value larger than 2^31 to a (SIZE_T) on systems where it is a 32-bit type.
FossilOrigin-Name: f08d63b413601b22726e8b96ff8eb779857321b9df30db0333f71e50ffb5077d
2017-08-07 19:06:54 +00:00
dan 089df50687 Fix a problem with handling SQLITE_FCNTL_MMAP_SIZE requests with a negative
parameter in os_unix.c.

FossilOrigin-Name: 4249fcf7b0c0233f9b3ba5139702738d5221c5309240e6e91dc139eff59471fe
2017-08-07 18:54:10 +00:00
dan 010a016ac9 Update bigmmap.test to account for builds that use
"-DSQLITE_MAX_MMAP_SIZE=<integer-constant>LL".

FossilOrigin-Name: 7c8b6f1cace42ee1182c252c8e66e5679f523f4248c27d38c075ae21e7c25374
2017-08-07 18:27:19 +00:00
dan 43c1e622cd Avoid casting a value larger than 2^31 to a (size_t) on systems where it
is a 32-bit type.

FossilOrigin-Name: 46c3085dcad6372ac20eff499e17fe11680fdf4adb9186bf8b12221a5047e485
2017-08-07 18:13:28 +00:00
mistachkin 54640de156 Fix an out-of-order test number.
FossilOrigin-Name: 38f30091f9b1e2c393396da7257f3487fa374e1ee6d610577291909768ff9626
2017-08-07 17:28:18 +00:00
dan 969012e534 Add new test file "bigmmap.test". For testing builds with
-DSQLITE_MAX_MMAP_SIZE > 2GB.

FossilOrigin-Name: 17447062799239ee978bedbf7fcc67f4c7d2cad2e82dcf9349a966fc8f67d390
2017-08-07 17:14:30 +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
drh eabb67fb61 Microoptimization in pcache1.c makes the code slightly smaller and faster.
FossilOrigin-Name: 422cd9f39403feeacd70133c7a147e23572c75d617ac564344f016ae6611162c
2017-08-05 15:49:03 +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 f12228fa23 Add SQLITE_API qualifiers to public API functions in header file sqlite3rbu.h.
FossilOrigin-Name: e11e6eb1d98518ba3f0361efa1c274084c5d6325b52e8470b6873e14e00c4eff
2017-08-04 08:24:52 +00:00
dan f5f0e43a6d Update script tool/mksqlite3c.tcl to avoid duplicating the SQLITE_API
qualifier when copying sqlite3rbu.h into the amalgamation.

FossilOrigin-Name: 61ab112f326a51d2d524a6371d8c93851ca2c6917414a802ac72d7cf5a2413fb
2017-08-04 08:23:33 +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
drh 5859636fb1 Optimization to the comparison opcodes in the byte-code engine.
FossilOrigin-Name: 654935c7737f1a9e08fde9b220c543e86ff6e05910e2f08973a2f93ab2b3e028
2017-08-03 00:29:23 +00:00
drh a485ad191f In the KeyInfo object, refactor the nField and nXField elements into
nKeyField and nAllField, which are more useful and run a little faster.

FossilOrigin-Name: aea5990eab5e85f92df966aa641db2271c81052010ad2d80982475c4275a1284
2017-08-02 22:43:14 +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
drh 754ee285fa Avoid redundant calls to sqlite3ApiExit() in sqlite3_step().
FossilOrigin-Name: 527974d4caba8bce7c89a28ea04a573b14c558657c14d9ad3c64bf1e0884caf8
2017-08-02 19:04:37 +00:00
drh 59533aa5e0 Only attempt to invoke WAL callbacks when a transaction has committed.
FossilOrigin-Name: bcc6dacb9114df709ef1bde24264c2193d9e39fc7fab024d5ebfc6056033274c
2017-08-02 18:28:26 +00:00
drh 60172a5a93 Minor optimization on clearCell()
FossilOrigin-Name: f3c39c2986be08683c2af4df610bc12e3c6bc6bec265c94ce01b94a950723524
2017-08-02 18:27:50 +00:00
drh 85ef630fde Optimizations associated with error handling in btree cursors.
FossilOrigin-Name: 49ba54e26731ed371745d4bdd9dd1dfeb73357b6d206c85a4252ec866be971d0
2017-08-02 15:50:09 +00:00
drh 57498ae9cf Remove unused token codes.
FossilOrigin-Name: c45078c062f41f43c71965b2e5a97932ff79123eeb017ba853314987bebc2bca
2017-08-02 12:38:10 +00:00
drh 13aa88d956 Rearrange some of the added token codes for a very slight size decrease and
performance increase.

FossilOrigin-Name: cb3742f51f4b3aa0fd8dc373af771e93ddb4100787115705955f2008aef92745
2017-08-02 11:36:16 +00:00
drh 6a8700b97b Rearrange integer token values in the parser and logic in the
resolveP2Values() routine for a small size reduction and performance increase.

FossilOrigin-Name: 1cad2926ad88b83becab1326bd189d7bac8ba6d470b36ba5d29af5c9fb016014
2017-08-02 11:04:00 +00:00
drh a02860511d Show which opcodes are jumps in the comments when generating
the opcodes.h header file.

FossilOrigin-Name: eef643a369250f1acac4c01a9b3d29068a510e5bf7fa843d565df5e2523e4dd9
2017-08-02 03:21:52 +00:00
drh 59c435a015 Add the "%token" control to the lemon parser. Not currently used by SQLite.
FossilOrigin-Name: a6e4c5ae8f29bc2e7f2088426341254e9281d19db9dc9a14abc376d56dad4c4b
2017-08-02 03:21:11 +00:00
drh 0019881e08 Faster implementation of resolveP2Values().
FossilOrigin-Name: 82e46fe0d497f871e652a579f25e77de7ef05d56484418961a1296f65f19415e
2017-08-02 02:46:43 +00:00
drh 6903bf6d49 Slightly smaller and faster by allocating Parser objects on the stack.
FossilOrigin-Name: 436a89b91901851ce21bf0cb997291b48888c52788b904822083d8dfac32b84b
2017-08-01 20:59:41 +00:00
drh 86b40dfd33 Split the OP_Last opcode into OP_Last and OP_SeekEnd. Use OP_SeekEnd to
position a cursor prior to appending.  Ticket [cb91bf4290c211d].

FossilOrigin-Name: 3e02474c7bbe16891a7cfc8771cf72f64cd2c0692779037982d7d307512a4f23
2017-08-01 19:53:43 +00:00
drh b7673ede37 Take advantage of atomic-write capabilities in the F2FS filesystem when the
database is stored on such a filesystem.  This is a compile-time option
activated using SQLITE_ENABLE_BATCH_ATOMIC_WRITE.

FossilOrigin-Name: 24190b221f73472dafaead6de101b4debc2c91c1ca28d70b45a38df5bb61fb39
2017-08-01 14:16:15 +00:00
drh e9e1074d27 Allow ATTACH and DETACH inside of a transaction.
FossilOrigin-Name: 95e8f31658254dd2df3eeaae337aff0fe2125d170ae966c74f4fc70400e099b1
2017-08-01 00:20:34 +00:00
mistachkin 334d163e41 Recognize 'AMD64' as 'x64' in the TclKit batch tool for MSVC.
FossilOrigin-Name: 0c77935cf9949099d834ec51384c1d4dcdaf7b4422c859c9fce6d3cb3bde2645
2017-07-31 19:39:34 +00:00
mistachkin 5b54259873 Sync up the MSVC autoconf makefile.
FossilOrigin-Name: b3b89f4ff92ee4b76f467d4e70fb42267470aef77af645f1ce71f9b1a675aabb
2017-07-31 19:26:06 +00:00
drh ab2eca0965 Fix a windows-compatibility issue in the recently added schema6.test script.
FossilOrigin-Name: 14e6c302ec3bc0e012b3c01aabee2d32e81389e1a4d834d1c57dd60bfbc97f29
2017-07-31 17:51:49 +00:00
drh 93bbfbe539 Prevent OSSFuzz from using debugging pragmas that are disabled in default builds
and which generate lots of excess output.

FossilOrigin-Name: cdc6494c050d821908087e6fd9b1e44ba92d81f363494a80b54647f19e5675f7
2017-07-31 17:06:34 +00:00
drh c644980c4d Move the generation of output column names earlier, to right after
name resolution and before query transformations such as flattening. 
This prevents the names from getting mangled by query transformations, 
and obviates hacks in the query flattener that attempt to work around 
the name mangling. The resulting code is smaller and faster and gives
more consistent output. Fix to ticket [de3403bf5ae5f72ed].

FossilOrigin-Name: ade7ddf1998190b2b630715774963150d86bed3211b7fd600cbf3068427e1531
2017-07-31 16:42:46 +00:00
drh ea2844f153 Add the schema6.test module for demonstrating schemas that generate identical
and different content.

FossilOrigin-Name: ac1da06a829051d393ccb8bb986e78f5bd35b060687688f6b3661913b13c9a5a
2017-07-30 19:50:42 +00:00
drh df94966c8b Correctly handle an "INTEGER PRIMARY KEY UNIQUE" column in a WITHOUT ROWID
table.  This is a fix for ticket [bc115541132dad136], a problem discovered
by OSSFuzz.

FossilOrigin-Name: 5216bfb73f1a49bdd879d470de139bf46a212474eaf6f38ad2390536d66a2afd
2017-07-30 18:40:52 +00:00
drh ce00d05a7b New test cases for column name generation interacting with the query flattener.
FossilOrigin-Name: 0c38dde4543d6183a6ab0b7b3b75819f56c47704756a2426d54d3f20468d78d8
2017-07-29 17:02:22 +00:00
drh f35f2f92ed Move the generation of output column names earlier, to right after name
resolution and before query transformations such as flattening.  This prevents
the names from getting mangled by query transformations, and obviates hacks
in the query flattener that attempt to work around the name mangling.
The resulting code is smaller and faster and gives more consistent output.
This is an alternative fix to ticket [de3403bf5ae5f72ed].

FossilOrigin-Name: 09834279aeca3bda63de684a369ed64f2cbf587b5f5df1454c0a3c009a1337ad
2017-07-29 16:01:55 +00:00
mistachkin 7751deb3e2 Update Tcl version used by the TclKit batch tool for MSVC.
FossilOrigin-Name: bcec155e0d6c6b17ae09d5a366c080723d01ff40dbc1a0ad0bb669a91db1b850
2017-07-28 22:22:15 +00:00
mistachkin f6285fab68 Fix harmless compiler warning.
FossilOrigin-Name: 3286e1a07b0693049a07f0865bf93749c461ea8f6d1175ec2d1642886673d8ac
2017-07-28 22:13:26 +00:00
drh 2fc2f92ed6 Disable the writecrash.test module on Windows.
FossilOrigin-Name: 4c0520d4df7473eb4cc764774df7d99bb96cf067ac224755e09f0df47fb2a810
2017-07-28 20:49:02 +00:00
drh 9e61104c68 More precise determination of when an in-memory journal needs to be
spilled to disk.

FossilOrigin-Name: 6a505bdd9347783d3d8105cb8185aa787801bad0c855b623cfd780fb406f0e7b
2017-07-28 18:16:14 +00:00
drh 344f763f72 Add new extended error codes for the atomic write file-controls.
FossilOrigin-Name: 94a2004756ffe027b3495be91366750135c294a9c460edc9a1b4b9422dcc33bd
2017-07-28 13:18:35 +00:00
dan 2912da0283 Add new test file test/atomic.test.
FossilOrigin-Name: f9213e4864d0542be5489e03cf40c47d9127a86bbbbbabd963aa08525d5dc97b
2017-07-28 11:05:33 +00:00
drh a66632d83a Add the SQLITE_ENABLE_BATCH_ATOMIC_WRITE macro to ctime.c
FossilOrigin-Name: 67bad7fb9b2fdb29b63308f22062444084dc28191a542e08076dc2e39caf6f62
2017-07-28 01:53:32 +00:00
drh 1d42ea71c2 Enhance the like optimization so that it works with an ESCAPE clause.
FossilOrigin-Name: f5d330f495d07a704e115595bbdf5422ddb68fd8191114c5a12c9c873d983f7c
2017-07-27 20:24:29 +00:00
drh 01d837df9c Increase the version number to 3.21.0 in anticipation for changes to go
into the next release.

FossilOrigin-Name: 0645f25c79c1b2af1fd3a02b44090329d456e373d91f6c284b8fbcb929e03a5d
2017-07-27 19:59:37 +00:00
drh 2036833a66 Merge the pointer-passing interface changes from the 3.20 branch.
FossilOrigin-Name: c63903a4c5d52a490e3f26707aa85fb54d4e2e8a3ce31ca26a9c615fe7a51e97
2017-07-27 18:49:19 +00:00
drh 761decbb50 Simplified documentation for the pointer passing interface.
FossilOrigin-Name: 2dfcd9a8ecdf0ddd8e044d820639830c6171141c588cf0224255af85c64cf79c
2017-07-27 18:43:13 +00:00
dan 77b4f528fa Do not set device-capabilities flags SEQUENTIAL or SAFE_APPEND for f2fs
file-systems.

FossilOrigin-Name: 4477e60cd801dab7a8aec12c5bc5e81e774bedbfed38abbc8eb8b37336141a44
2017-07-27 18:34:00 +00:00
drh 05cccc2848 Add destructor functions for the pointer argument (NB: not the type string)
to the sqlite3_bind_pointer() and sqlite3_result_pointer() interfaces.  Use
this new capability to resolve a pointer leak in the custom geometry function
mechanism of the RTREE extension.

FossilOrigin-Name: 5a2340b81faf0a29deb5b7c9a2ba6a7697d646de6cc4e9b2e6e5e6463fa394bd
2017-07-27 17:45:08 +00:00
drh 34fcf36d62 In sqlite3_bind_pointer(), invoke the destructor if the bind index is
out of range, like sqlite3_bind_blob() does.

FossilOrigin-Name: d6684d2a744e6e04b8796c3b5ecb81c6577728b698c1ab5f4a828b2ac114b8a2
2017-07-27 16:42:36 +00:00
drh a0024e6c99 Improved implementation of the destructor on pointer-passing interfaces.
FossilOrigin-Name: 601ad6795927fff8c3cc1711a2fd90912499573e94aa5bc8f18cbd4b89778f58
2017-07-27 15:53:24 +00:00
drh 22930062d5 Add a destructor argument to sqlite3_bind_pointer()
and sqlite3_result_pointer().

FossilOrigin-Name: 3d9e841f6011480ebb8a6d860da72af7fa545983e08835ddef2cac96e5f5cd4b
2017-07-27 03:48:02 +00:00
drh 8257aa8dbe Add the new sqlite3.mDbFlags field. Factor out bits of sqlite3.flags that
do not interact with PRAGMA statements into sqlite3.mDbFlags.

FossilOrigin-Name: 3808a00f06d372cc531da039d97bd974e4a6576a30cf63bf562f83f186b313b3
2017-07-26 19:59:13 +00:00
drh cf201488a5 Allow ATTACH and DETACH to occur inside of a transaction.
FossilOrigin-Name: ac1fd6beb6c804af5faf1e06a51177a8316007ff9e718c398bd7a24d2ecc4ed3
2017-07-26 18:26:44 +00:00
drh 61ffb2cda6 Fix a comment on the UnpackedRecord.r1 and UnpackedRecord.r2 fields.
No changes to code.

FossilOrigin-Name: 622b108915c7982b29ca9920abde941fff55234b70af9ac4122e4827b35d985c
2017-07-26 10:04:51 +00:00
drh 1fc376bfd1 Release candidate 2 for 3.20.0.
FossilOrigin-Name: f39cb76b3347baba22f2c329e74036710b64620414433a952de8d44da79ba8d9
2017-07-25 15:12:01 +00:00
drh e8cf1ab9aa Fix a bug in the deterministic date/time function logic that can only appear
with STAT3 or STAT4.

FossilOrigin-Name: 1ca707a4fb8db7aa85430413164265607ce727fc8a5afc3424b3abfb59921b39
2017-07-25 01:34:05 +00:00
dan b67abfc463 Do not attempt to run test file unionvtabfault.test with SQLITE_OMIT_VIRTUAL_TABLE builds.
FossilOrigin-Name: 1a632a9a6c85b78abe0351ef91c7478b26299c4c1c269d5796afb1e172084517
2017-07-24 20:01:36 +00:00
dan fb920e7eb0 Do not attempt to run test file unionvtab.test with SQLITE_OMIT_VIRTUAL_TABLE
builds.

FossilOrigin-Name: 9a5a3d60a5c6ce23bbdab5832f706bee8acdc4b1767aeed82b1aceb294f050f7
2017-07-24 19:25:45 +00:00
drh e8e0eda95d Handle a real OOM condition when incrblob2.test is run on a low-memory machine.
FossilOrigin-Name: f483d06a9af8d6771090551d911831e1df13bb05a6b7780499594703c28ebbb2
2017-07-24 17:37:35 +00:00
drh 1d8536bc0f Additional documentation on sqlite3_bind_pointer() and sqlite3_result_pointer().
No changes to code.

FossilOrigin-Name: b1572d4e05934a0dc1b73092acba652fa50e97552eb6e9a1cedea7c71055804b
2017-07-24 15:29:16 +00:00
drh caf8cc1b4b Compiler warning fix associated with date/time functions.
FossilOrigin-Name: a98f07d942f0b8cc15da57b84e6340efae72ff19516fa04624242240af43a697
2017-07-24 14:44:15 +00:00
dan 33447e7793 Add a test for the outcome of a process crash within an xWrite VFS method
call.

FossilOrigin-Name: eb8718006cb23ba9304da5c30d19863d688495f0eaae3794c5ad870e481866f8
2017-07-22 20:12:31 +00:00
dan 4da30f8888 Add the "atomic-batch-write" permutation to permutations.test. This
permutation fails if not run on a file-system that supports
atomic-batch-writes.

FossilOrigin-Name: 9f1b83fae9c973eee80eefefe7bd3a1eb7bba8af4cd919d7a2ce911900dd9087
2017-07-22 16:58:47 +00:00
drh 2df9478f5f Keep batch-atomic-writes turned on for journal_mode=MEMORY, but turn them
off for synchronous=OFF.  Refuse to compile with both SQLITE_MMAP_READWRITE
and SQLITE_ENABLE_BATCH_ATOMIC_WRITE.  Fix up some comments in the commit
logic.

FossilOrigin-Name: 2e80e19e4faac30947ed56aa3601c45c758cafb27f84780df255fdbcdc9a6999
2017-07-22 16:32:33 +00:00
drh d76dba7eb5 Omit unused batch-atomic-write code if SQLITE_ENABLE_BATCH_ATOMIC_WRITE is
not defined.

FossilOrigin-Name: a89b62c4966cd297326e8712da40e0962d2328d7ba1f201d5abcec911eeef347
2017-07-22 16:00:34 +00:00
dan 9d70954094 Use ioctl(F2FS_IOC_GET_FEATURES) to determine whether or not atomic batch
writes are available.

FossilOrigin-Name: 532bbf1f2b1028db4e581c756533aa660e482d833caaed4eafb299ef9b584f3a
2017-07-21 21:06:24 +00:00
mistachkin 07c3a1a358 Remove stray (and incomplete) comment from a test file. No changes to code.
FossilOrigin-Name: 8de20fc72a9b55fabd2444b2d73c88c65658430d6d182da9f0e2f3432373ab51
2017-07-21 20:31:31 +00:00
mistachkin 172861be76 Fix typo in comment. No changes to code.
FossilOrigin-Name: 65ec077ba63ab84ab8da91033adcf4a57bb9269ebcdd10f9e6c97c265512a80c
2017-07-21 20:29:06 +00:00
drh d080e3d7ac Additional documentation on the new VFS interface. No changes to code.
FossilOrigin-Name: 83077ec8b5804e6c709fa4f0b50afec9eae6d5b603cc4c3e8a408ed6b2bfaf28
2017-07-21 14:49:58 +00:00
drh 35270d2604 Add the documentation text for the new VFS interfaces used by batch-atomic
writes.

FossilOrigin-Name: 5e944eea5a32cb4d27a2d5ae283b9ce6fe08c1bc584256e8e8c78583c415eb2a
2017-07-20 21:18:49 +00:00
drh 94e32acb56 Transform two #ifdef statements into #if statements.
FossilOrigin-Name: f2c6b5845028ef25dcd17e23e11b93c9f7296c26c7a21718fdae8f4b48c4e1da
2017-07-20 21:01:53 +00:00
dan d67a97705c Split SQLITE_ENABLE_ATOMIC_WRITE into two options - the original and
SQLITE_ENABLE_BATCH_ATOMIC_WRITE.

FossilOrigin-Name: 7eb9bf2c5b42c39901fd571553c1f70aa5a9dac71fdc8e318b3063b928ad58f7
2017-07-20 21:00:03 +00:00
drh 5acc3bdbdf Fix a harmless typo, but one that would show up in the documentation if not
fixed.

FossilOrigin-Name: e4b1dd36838c4a35913b393b5aad948db9eccfb89b2cd456a0227470d7ac4a26
2017-07-20 20:49:41 +00:00
dan efe1697191 Add support for F2FS atomic writes. Untested at this point.
FossilOrigin-Name: 416973ede3bde8567d1f2699728f72352979e054ef988d1c1e1cfe4290f6f8b8
2017-07-20 19:49:14 +00:00
drh 4562d0db0d Enhance the built-in date/time functions so that they can be used in
CHECK constraints, in the WHERE clause or partial indexes, and index
expressions, provided that none of the non-deterministic keywords
("now", "localtime", "utc") are used as arguments.

FossilOrigin-Name: a90c062d46c63a1e6f83064b1c5afb26a16e93b6ee8620ca46d169fdb325c488
2017-07-20 15:08:43 +00:00
drh 2fbeb7e8f0 New test cases for date/time functions in indexes on expressions, in the
WHERE clause of partial indexes, and in CHECK constraints.

FossilOrigin-Name: b7f70c7fcabc10b8b3e62fe5ac68476cec23acaee037c7250ff70bca3f3ab541
2017-07-20 14:36:26 +00:00
drh 6e97f8ec84 Combine the Parse.ckBase and Parse.iSelfTab fields into just Parse.iSelfTab.
This fixes a problem with date/time functions in check-constraints.  Add
some test cases for date/time functions in index expressions and check
constraints.

FossilOrigin-Name: 22eda0985ecd1f456c073e6ad735a8417f3ff1fb6aaad1640e1cec01e50c51d8
2017-07-20 13:17:08 +00:00
drh 3e34eabcdf Allow indexes to be created on date/time functions as long as the 'now'
date and the 'localtime' and 'utc' modifiers are not used.

FossilOrigin-Name: 0a5e1c04d9d07bb7fd6546a9ddac1bf42b19ea19c2b79570aea6cd4226887a27
2017-07-19 19:48:40 +00:00
mistachkin 885f410472 Remove some 'breakpoint' commands in test files.
FossilOrigin-Name: d14fc621e918915bbf8e04597eb238ea78dff3d9c5eb4402cb88692d00dbdfee
2017-07-19 18:01:42 +00:00
dan d4603a2cab Add further tests to unionvtab.test.
FossilOrigin-Name: c93284cd65b6471bffc38696e14dc24a2170698faf566cf91b727ba272f88c25
2017-07-19 11:52:25 +00:00
drh 466004d5a4 Add VFS interfaces needed to make use of batch atomic write capabilities
in the underlying filesystem.

FossilOrigin-Name: 929bc46b8be0111a7b6e3d6fe129f0cad869c6a551bd47569c122742597b9f1c
2017-07-19 11:20:32 +00:00
dan 7f3d20acec Fix a crash in unionvtab caused by a misconfiguration. Add other test cases
for the same.

FossilOrigin-Name: 255d6b99de2bb210c09ebee9f9481ba3d1130fda47e6e01b4cc8411d00679d09
2017-07-18 21:19:17 +00:00
drh 5a75dd86c1 Fix shell.c.in so that it aligns with shell.c.
FossilOrigin-Name: 505fdc8ff5150276d3c6ab6135a542b791e9e79e2f76323e592b73b3fdc9bc2a
2017-07-18 20:59:40 +00:00
dan ff0a4edb72 Add test cases and fix minor error-handling issues in unionvtab.c.
FossilOrigin-Name: deadaad2a0801b3c30d2a076d8eb006b62d8557cff820e0939741c078477c83f
2017-07-18 20:49:15 +00:00
mistachkin aecd438737 Fix duplicate test name. No changes to code.
FossilOrigin-Name: 47b80ecc679e656ef865e73809d6a9aa485eceeacab86d10d405881c5d9872bd
2017-07-18 20:30:55 +00:00
drh 3935ce8e28 Fix another harmless compiler warning. Get the MSVC makefile working with unionvtab.
FossilOrigin-Name: d49639c208ac366f6c675ac5671accc2a597558b62a51520194276c61f32d406
2017-07-18 20:28:34 +00:00
drh 65e0f11451 Suppress harmless compiler warnings in union-vtab.
FossilOrigin-Name: 4d147a1e28b93e267889fcb01b538d6a2a58d6b1655512c883fa5b53ddcc60a4
2017-07-18 20:22:12 +00:00
dan a18532353c Remove an unused variable from unionvtab.c.
FossilOrigin-Name: a447fdf182c9090ca5b6c9c13147ae4b78d22d67f416ee7a0436ca408284c8fe
2017-07-18 20:17:52 +00:00
dan 859e4a73b7 Improve the readability of the unionvtab code.
FossilOrigin-Name: 5bcf0f86ea7fbbc31a13b2d5b1cf93a92e46fb65fe8e779b3d7e4a98d60d7061
2017-07-18 20:03:49 +00:00
dan 090f68a390 Have unionvtab support constraints on the column that corresponds to the
INTEGER PRIMARY KEY field of the underlying source tables in the same way as
rowid.

FossilOrigin-Name: 4a6c416fa025a34116ea30923a673cbb108b251b2676734ec8f603600e38e50e
2017-07-18 19:51:11 +00:00
dan 8342aa0d81 Add test cases to unionvtab.test.
FossilOrigin-Name: 6c9128e1a53f8cf26de9ef1bc07051f2c94287531edacfcfb69d3cd7590240b3
2017-07-18 18:50:37 +00:00
drh 53e86ab36f Add the union-vtab extension - still experimental and under active
development.

FossilOrigin-Name: 948f95046b7eaa8c68617b36625a7500dd0e69e52425ac6d748f2a311eb2474a
2017-07-18 18:19:35 +00:00
dan 46133d98a6 Do not use the flattening optimization for a sub-query on the RHS of a LEFT
JOIN if that subquery reads data from a virtual table. Because it prevents the
planner from creating an automatic index on the results of the sub-query, the
flattening optimization sometimes slows things down in this case.

FossilOrigin-Name: 9dbae1df75219e2accd8993015ce0ffc21966d7e69d04178b1a2cc46207fe260
2017-07-18 17:34:41 +00:00
dan bbccd52143 Avoid creating an automatic index on the RHS of a LEFT JOIN to optimize an IS
term. Fix for [ce68383b].

FossilOrigin-Name: d2f0b2e859a8a413ee4e4bd7040e450ccd604069e4ea8dbc9ff924718c2b14d7
2017-07-18 17:13:41 +00:00
drh 80f134c8aa Change the default command-line shell history depth to 2000 lines.
FossilOrigin-Name: 0b69aa7e37495f15c3fcc36969b650262b5aa5500fb40800de9a5c56a03f309d
2017-07-18 14:41:44 +00:00
dan 16bab5a7d9 Add test cases to test/unionvtab.test.
FossilOrigin-Name: f2c4a584e83ffcc1cedd39460eb06d6f231a1a87f269bb3e75055232a866067e
2017-07-17 21:03:13 +00:00
dan bcd303ac7d Enhance error detection and fix other issues in unionvtab code.
FossilOrigin-Name: 9c3f1b9a82e500e015deb0cc669fbb32e7f0cdc69f926ceff383ab946f8d8d18
2017-07-17 20:25:21 +00:00
drh b98ca04529 Merge all changes from branch-3.20. Improvements to the fts5() extension
interface.  Work around a gcc/valgrind bug in the sqlite3_value_pointer()
interface.

FossilOrigin-Name: e0aca7d2c60d9859750a6e98d3e3b87f79779a45920348fc1bda7f1cb93ef996
2017-07-17 18:45:23 +00:00
drh 06d4940a48 Interchange to branches within an "if" statement in sqlite3_value_pointer()
in order to work around a bug in gcc.

FossilOrigin-Name: 8a606e4abab4efa03f2e5ffc33d7c5faa3c663f339da87b4ce9f3feed5dc7194
2017-07-17 17:46:29 +00:00
drh 72495b44e0 Improved the interface to the fts5() extension mechanism for enhanced
security.

FossilOrigin-Name: bc78235f547977f1a821342ca8f3e03103a0eb351f8b3115ac10b43dd9c7044d
2017-07-17 15:38:57 +00:00
drh bd3028d7e3 Merge the pointer-type enhancement from the 3.20 branch.
FossilOrigin-Name: 9e8e1c4aa14bcda165b392d1d8af2ce394a56a8e7b67e4c73c742d8da75e73e2
2017-07-17 13:37:07 +00:00
drh aabebc27b7 Comment changes clarifying details of the pointer-type parameter. No
changes to code.

FossilOrigin-Name: e4579e50a1ece4f65dfdae39d5c1670f0e3f7d4824e7d242f07ec9859d15155f
2017-07-17 12:41:29 +00:00
drh 0357713225 Add the pointer-type parameter to sqlite3_bind_pointer(),
sqlite3_result_pointer(), and sqlite3_value_pointer().  The pointer type is
a static string that must match (according to strcmp()) or else the pointer
is passed as a NULL.  This is a security measure to prevent crossing pointers
between different extensions.

FossilOrigin-Name: e1196567fcbc313657836262ed9f71668b1c47f26e4bc57c7880ff40079d66cc
2017-07-17 12:27:43 +00:00
drh 9a541c0361 Improve the sqlite3_result_pointer() interface so that it cannot be faked
using sqlite3_result_null() and sqlite3_result_subtype().

FossilOrigin-Name: c13264d5ef0470fb24e09f7bc12f19be3b77eab06d41f55607b38dddb532a132
2017-07-17 11:39:46 +00:00
drh ae3ec3f920 Add an experimental "pointer type" parameter to sqlite3_bind_pointer(),
sqlite3_result_pointer(), and sqlite3_value_pointer().  The pointer type is
a string that must compare equal using strcmp() or else the pointer comes
through as a NULL.

FossilOrigin-Name: 211cce04e97d2e325a6ea3e99738fc71115d673dc13daeffb03ac3140deb11de
2017-07-17 00:40:19 +00:00
dan d8ecefa5ab Add the "unionvtab" virtual table extension in ext/misc/unionvtab.c.
FossilOrigin-Name: 62a86aa6c0519cf1fa232169122d3d6ae8d2f66b20530fb934a82a15712bd2f0
2017-07-15 20:48:30 +00:00
drh fe8eadc94d Merge the fix for ticket [a4e06e75a9ab61a12] from trunk.
FossilOrigin-Name: b64d64c84484162d1822430036ba0483365a39ef4cf82cd6a7b9436d9e9f50c8
2017-07-15 20:44:33 +00:00
drh 3963e584b4 Fix a register allocation problem in PRAGMA integrity_check that caused
the same register to be used for two different purposes on the first
ATTACHed database if the schema for the ATTACHed database was noticable
more complex than the schema for the first database.
Fix for ticket [a4e06e75a9ab61a1].

FossilOrigin-Name: 253945d480b052bfe311888022b5eb0be91c8c80cda05036e58207d57520262c
2017-07-15 20:33:19 +00:00
drh e7c6f97b1d Fix a missing \n at the end of a comment causing a line to be too long.
No code changes.

FossilOrigin-Name: 687bd478710eb827e041533eea67115464f5a0de767bb6cfdbe36a0d3c597fa1
2017-07-15 20:25:22 +00:00
drh a4e54e868e Enhance the showstat4 utility program to show the full precision of
floating point values in sqlite_stat4 tables.

FossilOrigin-Name: 5ec37c62f65b2870dcd7a906912da787367f3912a96b6f3536355fad65903575
2017-07-15 17:57:31 +00:00
drh a4d770cf60 Minor change to one of the command-line shell test scripts to make that
script compatible with Tcl 8.5.

FossilOrigin-Name: 47cf83a0682b7b3219cf255457f5fbe05f3c1f46be42f6bbab33b78a57a252f6
2017-07-15 13:49:56 +00:00
drh 13c6fc5c6c First release candidate for version 3.20.0.
FossilOrigin-Name: 035a86ec3e4abd2173bfd0d8666ec86bd85af414cb791e68e6334447ecd35b84
2017-07-15 13:35:17 +00:00
dan cb0d3ba862 Fix another minor problem in test file like.test.
FossilOrigin-Name: 0953e74612358f48a9c9e3772876b514bc79784f277497121c59302a3106110c
2017-07-15 08:02:10 +00:00
dan a50b309187 Fix test problems causing the "prepare" permutation test to fail.
FossilOrigin-Name: b61cc5a0f9f2c2d2175ad30fc3fa4cb2086dbb948d5a5cc538ac43b871bb5221
2017-07-15 06:35:15 +00:00
dan 04ed43d64d Fix test problems with stmtvtab1.test under some permutations.
FossilOrigin-Name: ad6699d476b93131887e30475517764e281647f94df4a8248e2b88f1f14da91d
2017-07-14 20:53:21 +00:00
drh 858205d8bd Fix a typo in a comment used to generate documentation. No code changes.
FossilOrigin-Name: 65f9f29c58f61646d700eee6610ce85b572306f0ce2f19bebfd37632523019e5
2017-07-14 19:52:47 +00:00
drh 749e4a9fd1 Identify requirements text in the SQLITE_DBCONFIG_ENABLE_QPSG documentation.
Add some implementation marks for SQLITE_DBCONFIG_MAINDBNAME requirements.
No code changes.

FossilOrigin-Name: ab165dcf35ae7385c9366853ce5648294bf5dc9aa9ffe1af84243e6fac3472fc
2017-07-14 19:47:32 +00:00
drh 3cef364966 Add requirements marks for some of the new features in the 3.20 release.
FossilOrigin-Name: 264238671379306b14d62a6ddaefd2a20acd34ca77276b6ce872253160fe0146
2017-07-14 19:22:08 +00:00
dan 380c7ce460 Tweak Makefile.in so that testfixture can be built with the
--disable-amalgamation configure switch.

FossilOrigin-Name: 394c6f4f4376bc3d7796ea4157ba2ae230b0ca950774eff127ae6ef8a7b08602
2017-07-14 19:12:26 +00:00
dan 0e6b83088f Modify mkopcodeh.tcl so that it can handle "same as" opcodes with values
larger than the total number of opcodes.

FossilOrigin-Name: 1eb56fe0305f0841b14865b7560add3da529b211328f5fa171b9628418a6ed49
2017-07-14 17:50:11 +00:00
drh c9fb27bfa8 In the LSM1 virtual table, dequote the filename before opening the file.
FossilOrigin-Name: 6ed4ef03ff6f22ae83a14facc48ce594911d7d7b37446436b68af3a822578fae
2017-07-14 15:57:56 +00:00
mistachkin 59541d70a8 Changes to the LSM1 Tcl tests to make things work on Win32.
FossilOrigin-Name: 7dc5e70ef1faa0b51a04abdfe1ee2f9ea5c2d0f99ea8ef6260b9de02500cf8b2
2017-07-14 15:45:27 +00:00
drh a199ffca58 Include a hint in the header comment of the LSM1 makefile about how to
set the LSMOPTS variable.

FossilOrigin-Name: b5e3b264814cde9572130b70fc0d21ccebc2d7f5f0e7db50b6395cb63723383e
2017-07-14 15:42:11 +00:00
drh aa15168983 Update the Makefile for LSM1 so that the LSMOPTS can be set prior to
including the Makefile, in order to add platform arguments such as -fPIC.

FossilOrigin-Name: fe319bcd7f85e9997babdb024ab350514524f5901903600fa9780bdcd1805098
2017-07-14 15:32:11 +00:00
drh 3eddffd8bb Fix a typo in the header comment to the remember extension. No code changes.
FossilOrigin-Name: 604b9664f4dd6e8d188b5c57407edbbe0639345f8d30bf2d19016f8324934840
2017-07-14 15:18:51 +00:00
drh e83b847b75 Change the name of the STMT virtual table to SQLITE_STMT. Also remove the
first column of that virtual table, which was a pointer leak.

FossilOrigin-Name: 1bc4e93407b7894b0271fbde3720930dcaadda6070e871d9719c4e8dc65b915f
2017-07-14 15:14:21 +00:00
drh 923260c865 Minor updates to requirements marks and documention. No changes to code.
FossilOrigin-Name: 8f6dd5e2907d6df230fcbceadd226496bcc35a33c117da58215f7d333c1cc7b8
2017-07-14 13:24:31 +00:00
dan 4b8035e69b Add very simple tcl tests for the lsm1 extension.
FossilOrigin-Name: 5e0a97930b08fff1c3a29f5c8b2962b856e3302209228c0e71b9f1a1bd2a4be3
2017-07-14 11:40:48 +00:00
drh 17ca22616b Minor tweaks to documentation. No code changes.
FossilOrigin-Name: d8cd0434f3451e27aefe38a1a9efdc4dfded2ea33baf25d82814c89264f3afff
2017-07-14 04:16:03 +00:00
drh 968d8715fd Fix harmless compiler warnings in the readline tab-completion logic of the
command-line shell.

FossilOrigin-Name: 271ca4acfcff448cf863045595d2c2616decd13b6015d7db481c91e2ad5bb92a
2017-07-14 00:28:28 +00:00
drh 33b46eeb35 Improved documentation for the new sqlite3_bind_pointer() interface and its
cousins.

FossilOrigin-Name: 889968bdbf1c258238cb68d82f059e16366c4a40c2d541dd4a1811ab72e693cb
2017-07-13 22:39:15 +00:00
drh 4ba5f33f39 Improvements to the documentation for SQLITE_PREPARE_PERSISTENT.
No code changes.

FossilOrigin-Name: 265778142485882f39edfb5756175b2675c1993f0d6395dabbcbbb3767c6ec77
2017-07-13 22:03:34 +00:00
drh 06aecf0954 Fix documentation typo. No changes to code.
FossilOrigin-Name: 9319f7b71f68c9dc64c22c60b90650955b72f6bd9852d5ea86fa96a5c6fede37
2017-07-13 20:11:52 +00:00
drh c9407508b1 Update header comments on the carray() and remember() extensions to bring
out the fact that the pointer arguments must be bound using
sqlite3_bind_pointer().

FossilOrigin-Name: 55f5396576d186f310cb0fa66fbdb8ea68c18a3d0fe5de4b395ea03c7aa04c9e
2017-07-13 19:11:13 +00:00
drh 96b10030e9 Add new interfaces sqlite3_bind_pointer(), sqlite3_result_pointer(), and
sqlite3_value_pointer() used to safely move pointer values through SQL without
exposing underlying memory address information.

FossilOrigin-Name: 72de49f204277191f62601cce70d5013ec30b564a01063f1e841019c78ae6c77
2017-07-13 18:09:36 +00:00
drh 4c997c6e75 Fix an incorrect type signature for the loadable extension pointer
for sqlite3_result_pointer().

FossilOrigin-Name: 0bd7875bd9948836a14061275eb8ddac627f562a49f59f400ec98c00e2be82c5
2017-07-13 17:56:52 +00:00
drh 5587d86ddd Add the three new pointer interfaces to the loadable extension mechanism.
Update sqlite3_value_subtype() documentation to remove the statement about
it not being used internally.

FossilOrigin-Name: e5a518038fcb23376d2b17d4d70648320bc5540c5bd8b164201044ebe1ce45c5
2017-07-13 17:54:12 +00:00
drh d43748aa98 Update the FTS3 extension to use sqlite3_result_pointer() and
sqlite3_value_pointer() for passing FTS3 cursor objects from the table
into functions such as snippet().

FossilOrigin-Name: 0fa2e170e5e078d155c98b212ade36bd8424502ae07f2d82ebf77a76f57586ba
2017-07-13 17:48:14 +00:00
drh 3fb406083a Merge the latest changes from trunk.
FossilOrigin-Name: a54be6e041a9185787a22b86603dcb0654e5e4af71225b556d1b6279f8520ad8
2017-07-13 17:34:46 +00:00
drh 0c2433003d Smaller and faster implementation for vdbeFreeOpArray() and freeP4().
FossilOrigin-Name: 0c80593520d30958231be41fc443209eb39e0b3ee0e66308c3ef3a0f4cb8ea66
2017-07-12 20:43:23 +00:00
drh 7ccf95dbab Fix harmless compiler warnings about incomplete structure initializers.
FossilOrigin-Name: 604c11d1a39f09e47b6fcee0f8b1c1054f9dbbc7b2c1cf93312aeaa4b7095018
2017-07-12 18:05:54 +00:00
drh 980a89e630 Remove unnecessary EP_Leaf settings on the Expr object.
FossilOrigin-Name: f951c8b71b2369da62a329c792af5e3d3087bbe020f38c68ca1d0a594b904c08
2017-07-12 17:26:44 +00:00
drh 971ecd7eaa The EP_Resolved flag on the Expr object is not required for correctness nor
performance, so remove it.

FossilOrigin-Name: 54f55d3b7973e326541a81bfb2e752a2f6618e4fec9a3631b95f28e12e9c6e34
2017-07-12 17:08:24 +00:00
drh ec360a8d01 Clarification and simplification and result column naming logic.
FossilOrigin-Name: 68824a439b76a4cca05609a02de7abdc42bd1d26afbfcd047b90001c610d3c56
2017-07-12 14:10:19 +00:00
dan 47ebd4cadd Fix a problem in an lsmtest test case caused by writing data in "text" mode
instead of "binary".

FossilOrigin-Name: 3e56a79ad8754e6da3181883154fa1c8b227a8d16c9b2a3eba925371595ae1f9
2017-07-12 14:03:13 +00:00
drh f0f44b79c9 Compile cleanly with SQLITE_OMIT_UTF16.
FossilOrigin-Name: 783100b801703577e35ec12fe7623e1797e49699f3b8deb0694ef061a142b844
2017-07-12 12:19:33 +00:00
dan 1cd523cf0f In lsm, attempt to unmap the database file before truncating it when
disconnecting. A mapped file may not be truncated on win32.

FossilOrigin-Name: 39069941e98605bc8c7c736819781761760ee2b83363471ceb6f19e5eb06b13a
2017-07-11 20:36:35 +00:00
dan 416b8694fa Simplify the way in which the database file is truncated when the last
connection disconnects. Also ignore the error code from the xTruncate call -
as truncating a database file is always optional.

FossilOrigin-Name: b0a49d90fc91acca1306cf6145adc83acd368686768b7eb4a3b27515b3237396
2017-07-11 19:55:38 +00:00
drh 8999798e60 Fix harmless compiler warnings in the core.
FossilOrigin-Name: 55e93f256018757e5e1cb3b10ef48abf5914e7687419eae58b00998a37061261
2017-07-11 18:11:33 +00:00
mistachkin ba334bb20d Make win32GetTimeOfDay() in the lsm1 test code more portable.
FossilOrigin-Name: 2fe3a84330063378ca9fc5bfc8efe486c52d50b5c40be4f402a4f2318be69436
2017-07-11 17:54:27 +00:00
drh db3e0456d2 Enabled the new sqlite3_prepare_v3() and sqlite3_prepare16_v3() interfaces
for loadable extensions.

FossilOrigin-Name: b9debd626a68c4bc0e5fdeb8d15a991cfe6f62f9586eda76c07a1c18e498e3c2
2017-07-11 17:28:27 +00:00