]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
7 years agoMerge in all the trunk enhancements of the previous 7 months. The LIKE est_count_pragma
drh [Fri, 22 Sep 2017 20:18:41 +0000 (20:18 +0000)] 
Merge in all the trunk enhancements of the previous 7 months.  The LIKE
optimization has stopped working when there is an ESCAPE - that problem will
be addressed in a subsequent check-in.

FossilOrigin-Name: 8d2a1cca613f75fb4b1a050cf7ea03b74a4d98f4c56d8079201035d7fdc49e85

7 years agoUse the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT...
mistachkin [Fri, 22 Sep 2017 16:23:23 +0000 (16:23 +0000)] 
Use the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT, et al, as well.

FossilOrigin-Name: 2c03d8b8f028b6a736aaf2cf8b28a51b3434cf341c95cf3a80469e0a24acdd98

7 years agoPartial backout of check-in [e0af9a904076]. It turns out we do need some
drh [Fri, 22 Sep 2017 12:52:31 +0000 (12:52 +0000)] 
Partial backout of check-in [e0af9a904076].  It turns out we do need some
extra space at the end of the record blob as an overrun area to use when
decoding a maliciously malformed record.

FossilOrigin-Name: 403b88a894d877b85bcc33133abad06c3c576e4928de4a4b0c091f74c4015355

7 years agoUpdate the configure script so that it looks for tclsh8.7 ahead of tclsh8.6.
drh [Fri, 22 Sep 2017 00:24:44 +0000 (00:24 +0000)] 
Update the configure script so that it looks for tclsh8.7 ahead of tclsh8.6.

FossilOrigin-Name: 0a12915b373cd0491a58d8f7a645711c620c70efced623e6b40aa01f23284157

7 years agoIn the Windows VFS, when trying to open a database file read/write, if it
drh [Thu, 21 Sep 2017 20:43:48 +0000 (20:43 +0000)] 
In the Windows VFS, when trying to open a database file read/write, if it
fails check to see if the file exists and is read-only and immediately fall
back to a read-only open attempt, rather than running the AV retry loop.

FossilOrigin-Name: 5d03c738e93d36815248991d9ed3d62297ba1bb966e602e7874410076c144f43

7 years agoIn the Windows VFS, do not emit an SQLITE_CANTOPEN error log message when
drh [Thu, 21 Sep 2017 20:03:17 +0000 (20:03 +0000)] 
In the Windows VFS, do not emit an SQLITE_CANTOPEN error log message when
falling back from SQLITE_OPEN_READWRITE to SQLITE_OPEN_READONLY.  Wait until
the open fails completely.

FossilOrigin-Name: fa3f5bcc23d9342f6df8ea15732988d637e9fa5dade85a73b05a9f66136d6964

7 years agoFix harmless UB in the ICU extension.
drh [Thu, 21 Sep 2017 19:08:25 +0000 (19:08 +0000)] 
Fix harmless UB in the ICU extension.

FossilOrigin-Name: 68e9a840d9cfbf4988e1a68c34e809d15d0235998cf0bfa147a1ab88ea842a61

7 years agoFix a potential use of an uninitialized pointer in RTree following an OOM
drh [Thu, 21 Sep 2017 13:11:47 +0000 (13:11 +0000)] 
Fix a potential use of an uninitialized pointer in RTree following an OOM
error.

FossilOrigin-Name: fd4ec0cdbd84f3333dd4c7a4236491bce6b9ab21fb2c088751ca1279b31bd864

7 years agoFix a bug in tool/mksourceid.c:
drh [Thu, 21 Sep 2017 10:24:10 +0000 (10:24 +0000)] 
Fix a bug in tool/mksourceid.c:
The mksourceid.c program was incorrectly including the "# Remove this line"
line of the Fossil-generated "manifest" file in the SHA3 hash.  That means
that all SQLITE_SOURCE_IDs for trunk versions going back to
check-in [30966d56] (2017-08-22) are incorrect.

FossilOrigin-Name: 65765222ef6f4e80c05a24994fcee145f5fbc0ad35c9fab3d75492964b3eb187

7 years agoRevert one performance improvement changes from check-in [3b3e32d4cd07] as
drh [Thu, 21 Sep 2017 01:04:30 +0000 (01:04 +0000)] 
Revert one performance improvement changes from check-in [3b3e32d4cd07] as
it was causing a reference to an uninitialized value.

FossilOrigin-Name: f8b1c64d3eeb8413ca149f34cc00f9154a5446d06ad33bbffa69118e6110f81d

7 years agoFix the rendering of the P4_INTARRAY argument to the OP_IntegrityCk opcode
drh [Thu, 21 Sep 2017 00:49:15 +0000 (00:49 +0000)] 
Fix the rendering of the P4_INTARRAY argument to the OP_IntegrityCk opcode
in the output of EXPLAIN.

FossilOrigin-Name: adc12c83dda8ba93ca220bbff649f763058b9440968ae463621f0cb7de8889cf

7 years agoSize and performance optimization on sqlite3VdbeMemGrow().
drh [Wed, 20 Sep 2017 18:47:51 +0000 (18:47 +0000)] 
Size and performance optimization on sqlite3VdbeMemGrow().

FossilOrigin-Name: 4b3f7eacb862fbb5b75cf50b72fb60dfbd0acb5818e9f83383a6a63c8bbeacdf

7 years agoThe BLOB returned by sqlite3VdbeMemFromBtree() does not need to be
drh [Wed, 20 Sep 2017 18:07:50 +0000 (18:07 +0000)] 
The BLOB returned by sqlite3VdbeMemFromBtree() does not need to be
zero-terminated.

FossilOrigin-Name: e0af9a9040768adf8bba42a8780adeb6304bc442afb1f35d239d019db1624f40

7 years agoSmall size and performance optimization in the bytecode engine.
drh [Wed, 20 Sep 2017 17:49:12 +0000 (17:49 +0000)] 
Small size and performance optimization in the bytecode engine.

FossilOrigin-Name: 3b3e32d4cd07a1d2d1708fffa47819345ae6b39205a9f548280d499c8f481d64

7 years agoImproved resolution of large integer values in "CAST(x AS NUMERIC)".
drh [Wed, 20 Sep 2017 10:47:10 +0000 (10:47 +0000)] 
Improved resolution of large integer values in "CAST(x AS NUMERIC)".

FossilOrigin-Name: 7f2bd4ff45fba29528c18cac6da983bd9b164303525d3965056f5b40f85dc83f

7 years agoUpdates to the "lemon.html" document received from Andy Goth.
drh [Wed, 20 Sep 2017 09:09:34 +0000 (09:09 +0000)] 
Updates to the "lemon.html" document received from Andy Goth.

FossilOrigin-Name: 5b2002f3df1902aaa571a0efd01ab8bae7f4d37ac4819cc51595277f4de93433

7 years agoAdd the sqlite3_mmap_warm() function as an extension in the ext/misc/mmapwarm.c sourc...
drh [Mon, 18 Sep 2017 18:17:01 +0000 (18:17 +0000)] 
Add the sqlite3_mmap_warm() function as an extension in the ext/misc/mmapwarm.c source file.

FossilOrigin-Name: 1b2de41453ac33de82f9cd6cbb92eee4fe184fb282c27e5efa5243c8cb239630

7 years agoFix a typo in the MSVC makefile. mmap-warm
drh [Mon, 18 Sep 2017 18:08:54 +0000 (18:08 +0000)] 
Fix a typo in the MSVC makefile.

FossilOrigin-Name: 3235835babb49b4dd1acaabd1aa6cfb0b7fe19a914db1cb511e8cc872d3c0c39

7 years agoAdd extension "mmapwarm.c". Provides function sqlite3_mmap_warm(), used to
dan [Mon, 18 Sep 2017 16:28:56 +0000 (16:28 +0000)] 
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

7 years agoMinor simplification of error message generation during compound query
drh [Mon, 18 Sep 2017 13:16:10 +0000 (13:16 +0000)] 
Minor simplification of error message generation during compound query
code generation.

FossilOrigin-Name: a944719314e0ac2f1954b65668815769eba3ab3e39a74666293b8dea52a184b2

7 years agoThe out-of-bounds read on recovery fix of check-in [378afa16381a222a] caused
drh [Mon, 18 Sep 2017 09:40:46 +0000 (09:40 +0000)] 
The out-of-bounds read on recovery fix of check-in [378afa16381a222a] caused
problems for some corner-case error conditions.  This alternative fix appears
to work better.

FossilOrigin-Name: 74f399d81fe250e09fde730ac0c17fe8b2b776ed32a3f576adaad56090f2b7fa

7 years agoFix the CSV virtual table extension so that it works when the default character
drh [Mon, 18 Sep 2017 00:18:31 +0000 (00:18 +0000)] 
Fix the CSV virtual table extension so that it works when the default character
is unsigned.

FossilOrigin-Name: 42f07775556758754e92e29a759d200d0d81d16eee83ab982b840db11292f834

7 years agoDo not make the assumption (as check-in [4da49a95c0f07] incorrectly did) that
drh [Sun, 17 Sep 2017 19:45:28 +0000 (19:45 +0000)] 
Do not make the assumption (as check-in [4da49a95c0f07] incorrectly did) that
the ExprList returned by sqlite3ExprListDup() would never be passed into
sqlite3ExprListAppend().  Include a new test case that shows this sometimes
does happen.

FossilOrigin-Name: 29227d00a9999f0f28a0b55ef70183799a667c3b9d81d2e5ac0ab1840bef98b1

7 years agoSimplify the sqlite3VdbeGet() routine. Smaller, faster, and easier to maintain.
drh [Sat, 16 Sep 2017 20:58:41 +0000 (20:58 +0000)] 
Simplify the sqlite3VdbeGet() routine.  Smaller, faster, and easier to maintain.

FossilOrigin-Name: 5dbb255a9377a6c2619fbac519f18caa4d8cb23257dfba0ffb9e36dd9dc16627

7 years agoRemove an unnecessary parameter from selectInnerLoop().
drh [Fri, 15 Sep 2017 17:40:34 +0000 (17:40 +0000)] 
Remove an unnecessary parameter from selectInnerLoop().

FossilOrigin-Name: dd95887f82739d05585edfb70913fdaaab154de46c4d3113dd32d283767fb6fc

7 years agoImproved the header-comment documentation on sqlite3ExprCodeExprList().
drh [Fri, 15 Sep 2017 15:38:01 +0000 (15:38 +0000)] 
Improved the header-comment documentation on sqlite3ExprCodeExprList().
No changes to code.

FossilOrigin-Name: 5dc3ecb5f67968545fb35ceed61ad625e069c4e744c5c3ebaea65e2fee347a5f

7 years agoOptimization to the ExprList object to make it slightly smaller and faster.
drh [Fri, 15 Sep 2017 15:17:48 +0000 (15:17 +0000)] 
Optimization to the ExprList object to make it slightly smaller and faster.

FossilOrigin-Name: 4da49a95c0f07ed7790169e8833c3e2dacda504a3d997f567572020148abe30b

7 years agoFix a harmless comment typo. No changes to code.
drh [Fri, 15 Sep 2017 14:36:13 +0000 (14:36 +0000)] 
Fix a harmless comment typo.  No changes to code.

FossilOrigin-Name: f7f0bf1da03f7fc1647ef172d9cb71a2ac46f136d4dee8e3a24e39313a981eb5

7 years agoAdd another test case for the problem fixed by the previous commit.
dan [Thu, 14 Sep 2017 21:12:07 +0000 (21:12 +0000)] 
Add another test case for the problem fixed by the previous commit.

FossilOrigin-Name: 1a7e0b61c8a6bdd3ed105b9bc8a3732668fd7a897d2ed16c99445498e3c87089

7 years agoAvoid an out-of-bounds read that can be caused by a specially constructed
dan [Thu, 14 Sep 2017 20:41:17 +0000 (20:41 +0000)] 
Avoid an out-of-bounds read that can be caused by a specially constructed
journal file.

FossilOrigin-Name: cf5bf42cad6e019a38dc0a36ff1f53ada619eef5259e175c3554a16669e03202

7 years agoAvoid an out-of-bounds read on a recovery attempt using a carefully crafted
drh [Thu, 14 Sep 2017 02:36:27 +0000 (02:36 +0000)] 
Avoid an out-of-bounds read on a recovery attempt using a carefully crafted
database and rollback journal with mismatched page sizes.  The test case for
this is in TH3.

FossilOrigin-Name: 378afa16381a222aafa6009dbbbc92473a69683537f1c265694678b0595a42c8

7 years agoTest case update due to PRAGMA integrity_check enhancements in [8525c30c].
drh [Wed, 13 Sep 2017 20:20:36 +0000 (20:20 +0000)] 
Test case update due to PRAGMA integrity_check enhancements in [8525c30c].
No changes to code.

FossilOrigin-Name: 43c6023bbf6b808ab4cfdbd1a63a516cbe2f1794c7787f8230632bae12e2ff59

7 years agoDisable FTS3 matchinfo() tests that assume a littleEndian platform when
drh [Wed, 13 Sep 2017 12:55:59 +0000 (12:55 +0000)] 
Disable FTS3 matchinfo() tests that assume a littleEndian platform when
running on bigEndian.

FossilOrigin-Name: 87ccdf9cbb9284553330683d4971be4f523ce922089aee6dffccfc18b3004263

7 years agoImprovements to PRAGMA integrity_check for better detection of malformed
drh [Wed, 13 Sep 2017 00:33:36 +0000 (00:33 +0000)] 
Improvements to PRAGMA integrity_check for better detection of malformed
records.  Integrity_check now avoids returning SQLITE_CORRUPT on a corrupt
record.  Also includes microoptimizations that I stumbled over while working
on integrity_check.

FossilOrigin-Name: 8525c30c1d6676e51b9d9c642450aae3722c129edafdbc39b8435fcfe09b1817

7 years agoPRAGMA integrity_check returns SQLITE_OK even if it encounters corruption improved-integrity-check
drh [Wed, 13 Sep 2017 00:13:05 +0000 (00:13 +0000)] 
PRAGMA integrity_check returns SQLITE_OK even if it encounters corruption
while scanning indexes.

FossilOrigin-Name: 81f62e99f27dedf3dc10fa1593c4cd9fc158680867206aee853e503a0cc8df71

7 years agoFix test script comment. No changes to code.
mistachkin [Wed, 13 Sep 2017 00:01:26 +0000 (00:01 +0000)] 
Fix test script comment.  No changes to code.

FossilOrigin-Name: a5a1949259a26c3330d7b1dcf38a8dd2e9b2c3af8d52f937e8537df138c9a55a

7 years agoRemove use of the rand_s() function (added by [139081bef9f63c3e]) as it appears to...
mistachkin [Tue, 12 Sep 2017 23:58:47 +0000 (23:58 +0000)] 
Remove use of the rand_s() function (added by [139081bef9f63c3e]) as it appears to cause issues with some third-party DLLs.

FossilOrigin-Name: 3a2793aa65727cbbf8c4678d478cf8fb02350f19ff98201934a984727368d64d

7 years agoFix an error in [b22cdd67] that can cause a negative infinity to be (rarely)
drh [Tue, 12 Sep 2017 15:05:34 +0000 (15:05 +0000)] 
Fix an error in [b22cdd67] that can cause a negative infinity to be (rarely)
reported as a positive infinity.

FossilOrigin-Name: 9780b23ca375de6a542516fbc03eb39d5a393ca577718fda231d0d0ccf3b1c7e

7 years agoChanges to (hopefully) get the build working with recent Intel compilers.
drh [Tue, 12 Sep 2017 13:27:43 +0000 (13:27 +0000)] 
Changes to (hopefully) get the build working with recent Intel compilers.

FossilOrigin-Name: b22cdd6734ecda2b2b9749668f353abc2660f192d6a40c5d266309d30e25695e

7 years agoMake sure all connections are closed in the pragma.test script.
drh [Tue, 12 Sep 2017 00:24:45 +0000 (00:24 +0000)] 
Make sure all connections are closed in the pragma.test script.
Test change only - no changes to code.

FossilOrigin-Name: d7b7f038a2c5e81a58c1dd4b556096b58ce10c30eb74fd4b770445927fdb62f3

7 years agoNew test case for ticket [b899b6042f97f52d].
drh [Mon, 11 Sep 2017 23:46:59 +0000 (23:46 +0000)] 
New test case for ticket [b899b6042f97f52d].

FossilOrigin-Name: 9d91ee5ee3f316a8804b02eb3c34b175b8f87b28c22df56f481af708c54e297c

7 years agoAdd support for new operators in virtual tables: !=, IS, IS NOT, IS NULL, and NOTNULL.
drh [Mon, 11 Sep 2017 20:54:54 +0000 (20:54 +0000)] 
Add support for new operators in virtual tables: !=, IS, IS NOT, IS NULL, and NOTNULL.

FossilOrigin-Name: 3b7dbe9da90b7db336eed597a73a5364d8a691e57c1febd60908349f57a539ad

7 years agoRefactor names of constants and functions associated with the auxiliary vtab-extra-ops
drh [Mon, 11 Sep 2017 19:47:37 +0000 (19:47 +0000)] 
Refactor names of constants and functions associated with the auxiliary
operators for xBestIndex.

FossilOrigin-Name: 0fb992af669e765760a94d2b6e2330b21a98f39f18445a94b0a2290560368d58

7 years agoMinor adjustments to indentation and spacing for clarity. No changes to code.
drh [Mon, 11 Sep 2017 18:37:44 +0000 (18:37 +0000)] 
Minor adjustments to indentation and spacing for clarity.  No changes to code.

FossilOrigin-Name: d3153abda6fd48015b007081734738b9cc4622e3564dc78a7a470a72dc2ca236

7 years agoAdd tests to check that affinities work with != operators on virtual table
dan [Mon, 11 Sep 2017 08:53:54 +0000 (08:53 +0000)] 
Add tests to check that affinities work with != operators on virtual table
column values. No changes to code.

FossilOrigin-Name: 8d24e0803d180448e637e33030a4ebf2c20eb1cab1074290c08f2eee0a23f66c

7 years agoSimplifications to the PRAGMA integrity_check code generator.
drh [Sun, 10 Sep 2017 01:06:05 +0000 (01:06 +0000)] 
Simplifications to the PRAGMA integrity_check code generator.

FossilOrigin-Name: 99b9140c795c0c17c4e9d2547477c9dac056edfd443f2b2bd70edecd43c49ab7

7 years agoSimplification and performance improvement to sqlite3_reset().
drh [Sat, 9 Sep 2017 22:46:56 +0000 (22:46 +0000)] 
Simplification and performance improvement to sqlite3_reset().

FossilOrigin-Name: b6425d0170721d803a055a958f1823c9c4be925cd93ac47562ff723daf8ce2ed

7 years agoImproved detection of malformed records by PRAGMA integrity_check.
drh [Sat, 9 Sep 2017 20:38:49 +0000 (20:38 +0000)] 
Improved detection of malformed records by PRAGMA integrity_check.

FossilOrigin-Name: 8fa923caa1535fc9ebed0214d211fc3d09a015d78afd01f288c215a7980d25f2

7 years agoEnhance the vtab interface to handle IS, !=, IS NOT, IS NULL and IS NOT NULL
dan [Sat, 9 Sep 2017 19:41:12 +0000 (19:41 +0000)] 
Enhance the vtab interface to handle IS, !=, IS NOT, IS NULL and IS NOT NULL
constraints.

FossilOrigin-Name: 34c8e952616013deb6fffec701ac5989afac9bef1bf92458a2e4ba92c7ee924f

7 years agoFix harmless compiler warnings seen with MSVC.
mistachkin [Sat, 9 Sep 2017 00:51:36 +0000 (00:51 +0000)] 
Fix harmless compiler warnings seen with MSVC.

FossilOrigin-Name: faa22e29a5a05a16d46a428d838acedfa7d6fad6239495d59a6a1f4764e1b1b6

7 years agoHave the header comment for sqlite3Checkpoint() mention TRUNCATE along with
dan [Fri, 8 Sep 2017 17:48:00 +0000 (17:48 +0000)] 
Have the header comment for sqlite3Checkpoint() mention TRUNCATE along with
the other three checkpoint types. No changes to code.

FossilOrigin-Name: e1e3ca7ea43a68b9b57dc38d8855f63b63a53feb8128b666a1becf87a2c70341

7 years agoPrevent a possible crash when trying to recover using a carefully corrupted \
drh [Thu, 7 Sep 2017 09:56:37 +0000 (09:56 +0000)] 
Prevent a possible crash when trying to recover using a carefully corrupted \
and truncated rollback journal.  (Test case in TH3)

FossilOrigin-Name: 02828d717e2d97b1f59e9279cea9c06eed4accd4e262606bd90d060449c5a1a3

7 years agoUpdate "PRAGMA integrity_check" to detect inconsistencies between a single
dan [Tue, 5 Sep 2017 20:16:19 +0000 (20:16 +0000)] 
Update "PRAGMA integrity_check" to detect inconsistencies between a single
record's header and body.

FossilOrigin-Name: 9e393a0edf1a578ddecc16a72fe3c54b75c2a650d507bcbc37c9724fbede1494

7 years agoFix a comment describing the xRowid method of the "series" virtual table. No
dan [Tue, 5 Sep 2017 17:23:39 +0000 (17:23 +0000)] 
Fix a comment describing the xRowid method of the "series" virtual table. No
code changes.

FossilOrigin-Name: 868cd1960015dc1bf003f911dcc417a94540d1948617ea1838a48b5cff59afda

7 years agoAdd experimental API sqlite3rbu_temp_size_limit(). For limiting the amount of
dan [Tue, 5 Sep 2017 16:24:38 +0000 (16:24 +0000)] 
Add experimental API sqlite3rbu_temp_size_limit(). For limiting the amount of
temporary disk space RBU uses.

FossilOrigin-Name: 7fdd629830679db620d477df3c206bf84598cc935ccb51547c0d8444a186b63e

7 years agoUse the SQLITE_CORRUPT_BKPT return code in a couple more places.
mistachkin [Mon, 4 Sep 2017 19:31:54 +0000 (19:31 +0000)] 
Use the SQLITE_CORRUPT_BKPT return code in a couple more places.

FossilOrigin-Name: 72d22c226bf4311345e8844fd9801ebddf77aceb80a038dce46608bf4ccae636

7 years agoAdd the 'mksourceid' executable to the clean target for MSVC.
mistachkin [Mon, 4 Sep 2017 18:44:54 +0000 (18:44 +0000)] 
Add the 'mksourceid' executable to the clean target for MSVC.

FossilOrigin-Name: 77854694b2da989aa4dbbdbd3ccf61756c46cc368de9731f5fd1c3aa38d7cad5

7 years agoProposed fix for ticket [b899b6042f97f5]
drh [Mon, 4 Sep 2017 00:33:04 +0000 (00:33 +0000)] 
Proposed fix for ticket [b899b6042f97f5]

FossilOrigin-Name: c7f9f47b239fdd99b555fb0a31eb82b22dbe6c821f1612d67a0d6a822288d9f7

7 years agoFix recent test cases in test/indexepxr2.test so that they work even without
drh [Mon, 4 Sep 2017 00:19:29 +0000 (00:19 +0000)] 
Fix recent test cases in test/indexepxr2.test so that they work even without
SQLITE_ENABLE_STAT4 and SQLITE_ENABLE_JSON1.

FossilOrigin-Name: 03f3cc03aaf233ad663d32a0200bfafee24a6c81f6a0ad14094ff014f880f00f

7 years agoAdd the new sqlite3PagerUnrefPageOne() pager method to deal with the special
drh [Fri, 1 Sep 2017 14:50:19 +0000 (14:50 +0000)] 
Add the new sqlite3PagerUnrefPageOne() pager method to deal with the special
case of unreferencing page1.

FossilOrigin-Name: b2e2100cf766da1cb499aec0ca0a9969d7af5d93312ab8cf895fbf4a6ffb9b2f

7 years agoRemove an obsolete optimization in pcache that due to more recent changes
drh [Fri, 1 Sep 2017 12:57:33 +0000 (12:57 +0000)] 
Remove an obsolete optimization in pcache that due to more recent changes
was recently making the code a little slower.

FossilOrigin-Name: c4e7e175eecfd79015f4fae99618dfce6baf97c21bf3c909ea535d4e12dcaaad

7 years agoSmall size and performance improvement in pcacheManageDirtyList() by not
drh [Fri, 1 Sep 2017 12:18:41 +0000 (12:18 +0000)] 
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

7 years agoClarify the documentation about "protected" versus "unprotected" sqlite3_value
drh [Thu, 31 Aug 2017 21:11:52 +0000 (21:11 +0000)] 
Clarify the documentation about "protected" versus "unprotected" sqlite3_value
objects.  No changes to code.

FossilOrigin-Name: 4094a3410e05597d0adc740d161e0358a3041c5a4e73bde35b1e983594c6879a

7 years agoRemove unnecessary "__declspec(dllexport)" qualifiers from generated file
dan [Wed, 30 Aug 2017 13:21:17 +0000 (13:21 +0000)] 
Remove unnecessary "__declspec(dllexport)" qualifiers from generated file
shell.c.

FossilOrigin-Name: bcc20be5b290c563183e82a590cc1fdabadfb13475fd8f6b3d810365cea5d868

7 years agoSmall performance optimization in pcache1.
drh [Wed, 30 Aug 2017 04:44:59 +0000 (04:44 +0000)] 
Small performance optimization in pcache1.

FossilOrigin-Name: ffd437da9541f8a2792e3e07c0a43f388f856fdc211fe42755eb51bfa5995d9f

7 years agoFaster memory allocation from lookaside by not trying to keep track of the
drh [Tue, 29 Aug 2017 20:21:12 +0000 (20:21 +0000)] 
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

7 years agoAdd the --enable-update-limit option to the ./configure script.
drh [Mon, 28 Aug 2017 17:00:12 +0000 (17:00 +0000)] 
Add the --enable-update-limit option to the ./configure script.

FossilOrigin-Name: 64a8ae68381b7fbb29b659901ca7ce8d50510e4753758d5761f7e41539288cef

7 years agoAvoid unnecessary mutexes in the pcache1 implementation in the common case
drh [Mon, 28 Aug 2017 16:11:05 +0000 (16:11 +0000)] 
Avoid unnecessary mutexes in the pcache1 implementation in the common case
where no auxiliary page cache memory is configured.

FossilOrigin-Name: 1ba051e34d7512ab5e8fc969c1b5aaaf827b8e6493ba4235895257aca78b500f

7 years agoRemove the rarely-used scratch memory allocator. This makes the code smaller,
drh [Mon, 28 Aug 2017 15:51:35 +0000 (15:51 +0000)] 
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

7 years agoBackport changes to shell.c into shell.c.in.
drh [Mon, 28 Aug 2017 14:33:27 +0000 (14:33 +0000)] 
Backport changes to shell.c into shell.c.in.

FossilOrigin-Name: 2348045fbc3fc99e2b46095cc86db99815cd1f9254d30a3b72c2b15c02076a84

7 years agoFix the ".dump", ".schema", and ".fullschema" commands of the command-line
drh [Mon, 28 Aug 2017 11:12:57 +0000 (11:12 +0000)] 
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

7 years agoFix a few over-length source code lines. No functional changes.
drh [Fri, 25 Aug 2017 19:51:51 +0000 (19:51 +0000)] 
Fix a few over-length source code lines.  No functional changes.

FossilOrigin-Name: 1783c54ce9dcb4b2c4f2a66f6d3315e646b71b54a8899fc32a7bf0f935a21f7f

7 years agoSize and performance optimization for sqlite3Init().
drh [Fri, 25 Aug 2017 15:43:34 +0000 (15:43 +0000)] 
Size and performance optimization for sqlite3Init().

FossilOrigin-Name: 776d91284a891bec64d6f649ff17de898b6ac6f66dd3d2afccc394a012a40c7d

7 years agoSmall performance optimization in sqlite3WhereBegin().
drh [Fri, 25 Aug 2017 13:34:18 +0000 (13:34 +0000)] 
Small performance optimization in sqlite3WhereBegin().

FossilOrigin-Name: 39f708d1e286931365a8992dbe7f900108ff1dad146032a284ad1dec09b11e06

7 years agoConvert a branch made unreachable by [59560d07] into an assert().
drh [Fri, 25 Aug 2017 13:02:48 +0000 (13:02 +0000)] 
Convert a branch made unreachable by [59560d07] into an assert().

FossilOrigin-Name: 2738b8db3caa6ce48d27cb5749d27b79241e6f6682b694886f6ef663e5443583

7 years agoImprove the internal mechanism used to keep track of what kind of syncing
drh [Fri, 25 Aug 2017 11:44:51 +0000 (11:44 +0000)] 
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

7 years agoAvoid returning duplicate rows in experimental pragmas "pragma_list",
dan [Fri, 25 Aug 2017 09:17:14 +0000 (09:17 +0000)] 
Avoid returning duplicate rows in experimental pragmas "pragma_list",
"module_list" and "function_list".

FossilOrigin-Name: b79cc8dc88c8ae03daff1290fd650b2b0e6f673ec9d83be6a533a57172930190

7 years agoUpdate the mechanism used to keep track of what kind of syncing to do for wal-sync-refactor
drh [Fri, 25 Aug 2017 01:14:43 +0000 (01:14 +0000)] 
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

7 years agoFix an incorrect hyperlink in a comment.
drh [Thu, 24 Aug 2017 20:54:42 +0000 (20:54 +0000)] 
Fix an incorrect hyperlink in a comment.

FossilOrigin-Name: 25292b9a4eb5efc7db551da0b3c9cfd7e79da1594ee14729de44090e188c2b2a

7 years agoFixes to documentation about SQLITE_OPEN_URI.
drh [Thu, 24 Aug 2017 15:43:26 +0000 (15:43 +0000)] 
Fixes to documentation about SQLITE_OPEN_URI.

FossilOrigin-Name: 7ec72314d6b66e4969833194fd032f01963bb861a7bb30d060acdb82dc5d62fe

7 years agoMake sure the sqlite3_result_pointer() interface does not leave a VM register
drh [Thu, 24 Aug 2017 13:55:46 +0000 (13:55 +0000)] 
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

7 years agoPerformance optimization to pageFindSlot() in the b-tree layer.
drh [Wed, 23 Aug 2017 23:09:03 +0000 (23:09 +0000)] 
Performance optimization to pageFindSlot() in the b-tree layer.

FossilOrigin-Name: 59560d079fab4b91ec50855cc60349da178209c38fb6dae674ff874ccfc7f5fa

7 years agoSize and performance optimization to dropCell() and freeSpace().
drh [Wed, 23 Aug 2017 20:36:06 +0000 (20:36 +0000)] 
Size and performance optimization to dropCell() and freeSpace().

FossilOrigin-Name: bc1ec123ce05c9d16b0942f870381145dc9725764e47806939ff207a73066f4d

7 years agoSmaller and faster implementation of the fillInCell() routine.
drh [Wed, 23 Aug 2017 14:45:59 +0000 (14:45 +0000)] 
Smaller and faster implementation of the fillInCell() routine.

FossilOrigin-Name: 77074990edef6c42bdfe7ccce1affc8ed64a86dde3ad4fa50b60ba0a6d851eea

7 years agoUpdate documentation to make it clear that SQLITE_SOURCE_ID and
drh [Tue, 22 Aug 2017 21:23:02 +0000 (21:23 +0000)] 
Update documentation to make it clear that SQLITE_SOURCE_ID and
sqlite3_sourceid() might changes if the source code is edited.

FossilOrigin-Name: e69c0c8770d3cc2fcdc779c6290caf1575644d457326caa00327b9070251d620

7 years agoLess dramatic changes to the source-id following an edit. Modify the way
drh [Tue, 22 Aug 2017 21:07:03 +0000 (21:07 +0000)] 
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

7 years agoModify the SQLITE_SOURCE_ID if the source code has changed in any way since
drh [Tue, 22 Aug 2017 19:54:34 +0000 (19:54 +0000)] 
Modify the SQLITE_SOURCE_ID if the source code has changed in any way since
the previous check-in.

FossilOrigin-Name: 515d6a8377cc1dc76d2e78e242fe256cbeef1c1217ec35367648ddeeb17007ec

7 years agoTrying again to get out-of-tree builds to work correctly. mksourceid
drh [Tue, 22 Aug 2017 19:49:34 +0000 (19:49 +0000)] 
Trying again to get out-of-tree builds to work correctly.

FossilOrigin-Name: a1b3337e949fc431e19a3d977d07a312bb253ab7fec6811c0221abd514985d55

7 years agoAttempting to fix the source-id generator so that it works for out-of-tree
drh [Tue, 22 Aug 2017 19:43:41 +0000 (19:43 +0000)] 
Attempting to fix the source-id generator so that it works for out-of-tree
builds.

FossilOrigin-Name: 5a037ac2da7449be3e26c36910ac5d865d7e74d3c25af0a10578c1f92fe2afea

7 years agoAdd the "mksourceid" program to the build process. That program changes
drh [Tue, 22 Aug 2017 19:19:00 +0000 (19:19 +0000)] 
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

7 years agoFix error tests in seldom-used compile-time branches of the unix backend.
drh [Tue, 22 Aug 2017 15:21:54 +0000 (15:21 +0000)] 
Fix error tests in seldom-used compile-time branches of the unix backend.

FossilOrigin-Name: 885c2b44a44f8d054014e4079b2cac8279c11d13206d5b5215189ef75b9c5254

7 years agoRemove an unnecessary conditional.
drh [Mon, 21 Aug 2017 02:20:57 +0000 (02:20 +0000)] 
Remove an unnecessary conditional.

FossilOrigin-Name: 56d19f9fd7b01d4ed5c3e7309977b43fedffee168c9760d3e3b7e885790f781e

7 years agoMinor optimization to sqlite3VdbeMemSetStr().
drh [Mon, 21 Aug 2017 02:05:22 +0000 (02:05 +0000)] 
Minor optimization to sqlite3VdbeMemSetStr().

FossilOrigin-Name: 6538ef7b6b56c7a6629a0bb7418910c64c8b2e73af2296a116c073ecf2e0d429

7 years agoSpace and size optimization to the printf implementation.
drh [Sat, 19 Aug 2017 20:38:18 +0000 (20:38 +0000)] 
Space and size optimization to the printf implementation.

FossilOrigin-Name: d01d2cffefd1cdb52b386e4983599534c0fbbe6aebda186db53200e4b2283f0a

7 years agoAnother size and performance optimization to readDbPage(). This time we
drh [Fri, 18 Aug 2017 22:30:20 +0000 (22:30 +0000)] 
Another size and performance optimization to readDbPage().  This time we
eliminate some unnecessary local variables.

FossilOrigin-Name: 745bc8decd18d4dc00589474fd3928a3a9f4156d09e05e6f5b8623de6491795a

7 years agoSize and performance optimization the readDbPage() routine in the pager.
drh [Fri, 18 Aug 2017 21:14:50 +0000 (21:14 +0000)] 
Size and performance optimization the readDbPage() routine in the pager.

FossilOrigin-Name: ca9e1875c3a893321d70a131fc4ffc76d169ad05e0b48b7006f53b6b467db4be

7 years agoFor the unix VFS, avoid an unnecessary stat() system call prior to opening
drh [Fri, 18 Aug 2017 16:09:52 +0000 (16:09 +0000)] 
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

7 years agoCombine the OP_CreateTable and OP_CreateIndex opcodes of the bytecode engine
drh [Fri, 18 Aug 2017 14:34:28 +0000 (14:34 +0000)] 
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

7 years agoOnly use indexes on expressions to optimize ORDER BY and GROUP BY if the
dan [Fri, 18 Aug 2017 08:29:37 +0000 (08:29 +0000)] 
Only use indexes on expressions to optimize ORDER BY and GROUP BY if the
collation sequence matches. Possible fix for [e20dd54a].

FossilOrigin-Name: 37e1900880b70be6802eaf43b0e568fda709a1dd6083d8be11e5a7a7d1fda41a

7 years agoUse the __builtin_clzll() function of gcc to improve the performance and
drh [Thu, 17 Aug 2017 20:53:07 +0000 (20:53 +0000)] 
Use the __builtin_clzll() function of gcc to improve the performance and
reduce the size of the sqlite3LogEst() routine.

FossilOrigin-Name: a42a438cbbd721765ca55e71c464552dbaa494050cf472593599b8c7f0249516