]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
5 years agoCrazy experimental change to refcount the AggInfo objects. refcount-agginfo
drh [Tue, 9 Jun 2020 14:56:01 +0000 (14:56 +0000)] 
Crazy experimental change to refcount the AggInfo objects.

FossilOrigin-Name: 9a4cc1dbf2a605ccda495ceb8e33cdc95f3436dbc11a1fa8aee4918b125fae90

5 years agoGive the expression pointer fields of AggInfo distinctive names in order to
drh [Tue, 9 Jun 2020 13:38:12 +0000 (13:38 +0000)] 
Give the expression pointer fields of AggInfo distinctive names in order to
simplify tracking of all their uses.

FossilOrigin-Name: a53bdd311c4154fd5e1131efbb9665362f79db5a35ce9f7b1547f74b8ee2d8ba

5 years agoImproved tree-view debugging output for aggregate functions.
drh [Tue, 9 Jun 2020 11:59:15 +0000 (11:59 +0000)] 
Improved tree-view debugging output for aggregate functions.

FossilOrigin-Name: b5711b4eead10ef4b0b61f2e2c54768d215a4105f6d47d2ea78991b6e53a6831

5 years agoFix a case where a corrupted fts3 record could cause an assert() failure, or spurious...
dan [Mon, 8 Jun 2020 14:43:41 +0000 (14:43 +0000)] 
Fix a case where a corrupted fts3 record could cause an assert() failure, or spurious SQLITE_NOMEM error in builds with assert() disabled.

FossilOrigin-Name: d48af4d2cfff3d5f4ccc3db5d658e8b503255b577e6e62b5c2b4a4437875b895

5 years agoWhen an Expr object is changed and that Expr is referenced by an AggInfo, then
drh [Mon, 8 Jun 2020 11:34:40 +0000 (11:34 +0000)] 
When an Expr object is changed and that Expr is referenced by an AggInfo, then
also update the AggInfo.  Also, persist all AggInfo objects until the Parse
object is destroyed.  This is a new fix for ticket [c8d3b9f0a750a529] that
avoids the follow-on problems identified by tickets
[0899cf62f597d7e7], [1f6f353b684fc708], [e5504e987e419fb0], and
[f7d890858f361402].

FossilOrigin-Name: 6e6b3729e0549de028f6c5bf494b2d69d621c81b61a1dc0a329d3950039342fb

5 years agoFix minor OOM problems. persist-agginfo
drh [Sun, 7 Jun 2020 22:44:23 +0000 (22:44 +0000)] 
Fix minor OOM problems.

FossilOrigin-Name: 8b23d80271aab38abe42ee8b3ca4b746572ecef26c2a37b094b01560e6be9d45

5 years agoAggInfo objects might be referenced even after the sqlite3Select() function
drh [Sun, 7 Jun 2020 20:18:07 +0000 (20:18 +0000)] 
AggInfo objects might be referenced even after the sqlite3Select() function
that created them has exited.  So AggInfo cannot be a stack variable.  And it
must not be freed until the Parse object is destroyed.

FossilOrigin-Name: 3c840b4df306e2db1da08673e9ede973b4cb6d2b3f9eeeab5835e39452ee3056

5 years agoAlternative fix to ticket [c8d3b9f0a750a529]: Prior to deleting or modifying
drh [Sun, 7 Jun 2020 17:33:18 +0000 (17:33 +0000)] 
Alternative fix to ticket [c8d3b9f0a750a529]:  Prior to deleting or modifying
an Expr not that is referenced by an AggInfo, modify the AggInfo to get its
own copy of the original Expr.

FossilOrigin-Name: 7682d8a768fbccfe0cc956e9f6481637146e1ab9763b248ff11052761ce32e32

5 years agoIn the debugging treeview output, change the name of "SELECT-expr" expression
drh [Fri, 5 Jun 2020 04:01:50 +0000 (04:01 +0000)] 
In the debugging treeview output, change the name of "SELECT-expr" expression
nodes to be "subquery-expr", so as to not confuse them with actual SELECT
nodes.

FossilOrigin-Name: c1c8937a30feff6aa4385b0c264fd8e70d54422a0629c2ce38082d85d3334a57

5 years agoAlways use ?...? to indicate optional arguments in the output of ".help"
drh [Fri, 5 Jun 2020 00:54:27 +0000 (00:54 +0000)] 
Always use ?...? to indicate optional arguments in the output of ".help"
in the CLI.  Change ".mode column" so that it automatically activates
".headers on" if headers have not been previously turned on or off.

FossilOrigin-Name: 2827c0a186596299e43eb3e7378eea462d2b060b2c3388ce5cb2bc8e0b43999e

5 years agoAdd support for "box" mode in the CLI: Like "table" except that it uses
drh [Thu, 4 Jun 2020 18:05:39 +0000 (18:05 +0000)] 
Add support for "box" mode in the CLI:  Like "table" except that it uses
unicode box-drawing characters instead of ascii-art.

FossilOrigin-Name: 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72

5 years agoImproved display of ".mode table" output for empty result sets.
drh [Thu, 4 Jun 2020 16:54:10 +0000 (16:54 +0000)] 
Improved display of ".mode table" output for empty result sets.

FossilOrigin-Name: 7efabd683b79743b407ad71dda56db00fb0d668828bdc342145816b4f1c3bf3a

5 years agoUse __has_extension(c_atomic) instead of __has_feature(c_atomic) to detect support...
dan [Thu, 4 Jun 2020 16:34:49 +0000 (16:34 +0000)] 
Use __has_extension(c_atomic) instead of __has_feature(c_atomic) to detect support for atomic load and store operations with clang.

FossilOrigin-Name: 362255791f8801e0d9869e36239b8b2cb29c38bf0b86894bd2d159ce46d8447e

5 years agoUse AtomicStore() to set values in the wal-index hash table.
dan [Thu, 4 Jun 2020 16:07:51 +0000 (16:07 +0000)] 
Use AtomicStore() to set values in the wal-index hash table.

FossilOrigin-Name: 1ab30c75f2fe14d1ee77d0eace4e29ba8f805d63e2da0897b111ea1311f409aa

5 years agoWork around a bug in clang-11.0.0.
drh [Thu, 4 Jun 2020 02:50:47 +0000 (02:50 +0000)] 
Work around a bug in clang-11.0.0.

FossilOrigin-Name: 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6

5 years agoFix for ticket [810dc8038872e212]. Thank to user "Maxulite" for tracking
drh [Wed, 3 Jun 2020 19:28:10 +0000 (19:28 +0000)] 
Fix for ticket [810dc8038872e212].  Thank to user "Maxulite" for tracking
down the problem!

FossilOrigin-Name: 89af93d77fa7959a4ee7364bae6c02c40963a3cdf80b0a4a8af9c9764d5c7bb5

5 years agoSimplification to the interrupt handling logic in sqlite3VdbeExec() saves
drh [Wed, 3 Jun 2020 15:59:22 +0000 (15:59 +0000)] 
Simplification to the interrupt handling logic in sqlite3VdbeExec() saves
a few bytes of code space.

FossilOrigin-Name: 43e0e59bd4e34c6e88c004ea951c0d76ff1cf0a034389f490495a5d12e239382

5 years agoImprove the query planner so that it is better able to find full
drh [Wed, 3 Jun 2020 03:00:09 +0000 (03:00 +0000)] 
Improve the query planner so that it is better able to find full
index scan plan when there is an INDEXED BY clause.

FossilOrigin-Name: d901837fea1ed54de43ad59eb47c02cbfd2eb215fc57317b5ea8c22a7df947c4

5 years agoDraw the dashes below the headers in "explain" mode in the CLI.
drh [Sat, 30 May 2020 15:34:49 +0000 (15:34 +0000)] 
Draw the dashes below the headers in "explain" mode in the CLI.

FossilOrigin-Name: c6b7833ac7d9cc75cb45d5e8041367ebd6f197f776766e6143535c227fc72a20

5 years agoImproved VDBE comments on the ANALYZE code generator. This change
drh [Sat, 30 May 2020 00:30:08 +0000 (00:30 +0000)] 
Improved VDBE comments on the ANALYZE code generator.  This change
also fixes a harmless use of an uninitialized integer variable as an input
to the %d format on a VDBE comment.

FossilOrigin-Name: 1cb248a3fc4c35c5bc3993b554edcccaa5c5e91570af67ebb99643a15221ae33

5 years agoEnhancements to the incremental build support for MSVC.
mistachkin [Fri, 29 May 2020 21:06:52 +0000 (21:06 +0000)] 
Enhancements to the incremental build support for MSVC.

FossilOrigin-Name: 2e25d915bcb8d6f1747f9befdef64d2e0e495cc6c5948a8eff5d0097b6613d06

5 years agoRemove a stray "&" character in the CLI, detected by a clang warning.
drh [Fri, 29 May 2020 20:16:19 +0000 (20:16 +0000)] 
Remove a stray "&" character in the CLI, detected by a clang warning.

FossilOrigin-Name: 5865d2f2d0333024366ecf1d919535fd4ec05c637feff16d75028ccdc8db4b50

5 years agoAdd the "shelltest" target to the MSVC makefile as well.
drh [Fri, 29 May 2020 19:45:03 +0000 (19:45 +0000)] 
Add the "shelltest" target to the MSVC makefile as well.

FossilOrigin-Name: 9924c0456bfcd2058c9620a93dfbfd4c7d960c68910ce6aed7364dff42baba5c

5 years agoFix the ".import" command of the CLI to clean up better after errors.
drh [Fri, 29 May 2020 19:39:35 +0000 (19:39 +0000)] 
Fix the ".import" command of the CLI to clean up better after errors.
Add the new "shelltest" makefile target on unix platforms.

FossilOrigin-Name: 50d4ddf1330b88551de51439eb535f385dee6b53013802dd62f832d16b3025b6

5 years agoImprovements to help text for the CLI.
drh [Fri, 29 May 2020 19:17:20 +0000 (19:17 +0000)] 
Improvements to help text for the CLI.

FossilOrigin-Name: 6a01e4c444b072e31a320121a6810d7c986c2c54ce45f9b11683233b1e7af8da

5 years agoFix a memory leak in the CLI when an unknown or unrecognized
drh [Fri, 29 May 2020 19:03:03 +0000 (19:03 +0000)] 
Fix a memory leak in the CLI when an unknown or unrecognized
argument is given to the ".dump" command.

FossilOrigin-Name: 71bfbbcc1a8d0e02073a381a5b31a5ccd5477011b22904b9989b6129d81f02e7

5 years agoImprovements to columnar output in the CLI. Columns automatically expand
drh [Fri, 29 May 2020 16:15:58 +0000 (16:15 +0000)] 
Improvements to columnar output in the CLI.  Columns automatically expand
to contain the largest row.

FossilOrigin-Name: 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82

5 years agoSpace to hold the ".width" of columns in the CLI is now obtained from
drh [Fri, 29 May 2020 14:38:43 +0000 (14:38 +0000)] 
Space to hold the ".width" of columns in the CLI is now obtained from
malloc() and hence is not limited in the number of columns supported.

FossilOrigin-Name: 445ed5dab2c26e9f4a7fb5277abdba3359d23cf5318cfd0d8322162d9616ee7a

5 years agoIncremental improvements to tabular output modes in the CLI. The
drh [Fri, 29 May 2020 12:31:53 +0000 (12:31 +0000)] 
Incremental improvements to tabular output modes in the CLI.  The
"markdown" and "table" modes no have headers turned on by default.

FossilOrigin-Name: af28bff91ad7e2d69db0052323c9c05c75a41d4134974bd1305f1c4f579d3558

5 years agoExpand upon a comment in os_unix.c. No changes to code.
dan [Fri, 29 May 2020 11:07:20 +0000 (11:07 +0000)] 
Expand upon a comment in os_unix.c. No changes to code.

FossilOrigin-Name: 77933dc4dbe0e0af3b13a14293a8bd684edc5056f4ae9291c6f95d4433bf90ce

5 years agoIn the json output mode of the CLI, do correct quoting of escape characters.
drh [Fri, 29 May 2020 00:21:43 +0000 (00:21 +0000)] 
In the json output mode of the CLI, do correct quoting of escape characters.
Also, show BLOBs as JSON strings, possibly with embedded \u0000 bytes.

FossilOrigin-Name: 0278147a7d2b50bed9f59ed3d3a04ecc6d46f072eb510e463f6707df1d829020

5 years agoProgress toward adding new output modes to the CLI: json, table, and
drh [Thu, 28 May 2020 23:49:50 +0000 (23:49 +0000)] 
Progress toward adding new output modes to the CLI:  json, table, and
markdown.

FossilOrigin-Name: 14f55fafec11491e87e6526c72cf85c689d74ba18418a1ae9646586ec206767a

5 years agoEnhance the ".quote" mode in the shell so that it honors .separator.
drh [Thu, 28 May 2020 20:37:17 +0000 (20:37 +0000)] 
Enhance the ".quote" mode in the shell so that it honors .separator.

FossilOrigin-Name: b5e33ed537e7d7dcabc9f6dc91d6838e0d1657f323440e09e2e24ffa2ba6141a

5 years agoWhen the sqlite_stat1 data is missing for some indexes of a table but is
drh [Thu, 28 May 2020 00:45:16 +0000 (00:45 +0000)] 
When the sqlite_stat1 data is missing for some indexes of a table but is
present for the table itself or for other indexes in the same table, then do
not let the estimated number of rows in that table get too small, as
doing so can deceive the query planner into ignoring a perfectly good index.

FossilOrigin-Name: 98d4262018a81a9a36dd8beb4b02ff0e75cdcbb8a121d143157ffb37b228d60d

5 years agoSmall performance improvement and size reduction in the expression
drh [Wed, 27 May 2020 12:44:28 +0000 (12:44 +0000)] 
Small performance improvement and size reduction in the expression
code generator.

FossilOrigin-Name: eeb53e219551d8a05a87f1de9a7cd9af295d08a296f1f435a8509ea1252ccdcc

5 years agoChange a datatype from i16 to int to appease Converity and help eliminate
drh [Wed, 27 May 2020 00:02:07 +0000 (00:02 +0000)] 
Change a datatype from i16 to int to appease Converity and help eliminate
a false-positive.

FossilOrigin-Name: 5b560ec49041d89c87ea3315d8fc17f7fb0e03a82091934be7373b290183f82e

5 years agoFix the cksumvfs extension so that it will not register itself more than
drh [Tue, 26 May 2020 20:33:18 +0000 (20:33 +0000)] 
Fix the cksumvfs extension so that it will not register itself more than
once.

FossilOrigin-Name: d5cdd57150db914b61b8b9c61c6caac9690fe7b647ee2c003e75b9b62be62752

5 years agoPerformance optimization in the transfer of error messages from statements
drh [Tue, 26 May 2020 20:31:17 +0000 (20:31 +0000)] 
Performance optimization in the transfer of error messages from statements
to connections.

FossilOrigin-Name: 0e898f4fed1c851cb90f940175110e632a20668a285d39f5f94f7358c3064882

5 years agoIncrease the version number to 3.33.0 to begin the next release cycle.
drh [Tue, 26 May 2020 11:23:48 +0000 (11:23 +0000)] 
Increase the version number to 3.33.0 to begin the next release cycle.

FossilOrigin-Name: 790badb390d59062cd2d8d1dec76cc6104c9425610a67503f6be38076b6a458e

5 years agoChanges to sqlite3SelectNew() to work around a false-positive warning
drh [Tue, 26 May 2020 11:10:25 +0000 (11:10 +0000)] 
Changes to sqlite3SelectNew() to work around a false-positive warning
from GCC-10.  The code is very slightly larger and slower as a result.

FossilOrigin-Name: 04e1edd8e5821a377407263829ed0d87968c708c9aeb1282107ea6f39a11c1cc

5 years agoInnocuous changes to help Coverity avoid false-positives.
drh [Tue, 26 May 2020 10:54:46 +0000 (10:54 +0000)] 
Innocuous changes to help Coverity avoid false-positives.

FossilOrigin-Name: 4ec8a5a203f10d228d0b3389120638766cc343179dbe38d5dbf69b650765934c

5 years agoVersion 3.32.1 version-3.32.1
drh [Mon, 25 May 2020 16:19:56 +0000 (16:19 +0000)] 
Version 3.32.1

FossilOrigin-Name: 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350

5 years agoExtra assert() statements in the printf() logic.
drh [Mon, 25 May 2020 15:41:03 +0000 (15:41 +0000)] 
Extra assert() statements in the printf() logic.

FossilOrigin-Name: b1b182be2ab34cec1d94c5570bc361331a34f727eb9fa4aadfabb7f1ef79f83e

5 years agoDefensive code that tries to prevent a recurrence of problems like the
drh [Mon, 25 May 2020 15:19:52 +0000 (15:19 +0000)] 
Defensive code that tries to prevent a recurrence of problems like the
one described in ticket [7a5279a25c57adf1]

FossilOrigin-Name: 572105de1d44bca4f18c99d373458889163611384eebbc9659474874ee1701f4

5 years agoFix minor compile issues with optional extensions.
drh [Mon, 25 May 2020 12:49:58 +0000 (12:49 +0000)] 
Fix minor compile issues with optional extensions.

FossilOrigin-Name: 3261ee9ec26bbeaa64190c12556a1d8146270b6660c70004830bd38c1b5b63f4

5 years agoMake sure variable declarations are at start of scope even when
drh [Mon, 25 May 2020 12:02:12 +0000 (12:02 +0000)] 
Make sure variable declarations are at start of scope even when
SQLITE_ENABLE_SNAPSHOT is used.

FossilOrigin-Name: a77ceaf6ba934b1d73c90b8980191a65d02ad6ce1e11e6baf573b3a132685545

5 years agoAttempt to work around a false-positive warning in the CGo compiler. cgo-warning-workaround
drh [Mon, 25 May 2020 01:31:09 +0000 (01:31 +0000)] 
Attempt to work around a false-positive warning in the CGo compiler.

FossilOrigin-Name: d4bf60f464789935dc193ea99bf730c8fade448c7dca13eb3ce297965980f36e

5 years agoVersion number to 3.32.1.
drh [Sun, 24 May 2020 12:36:20 +0000 (12:36 +0000)] 
Version number to 3.32.1.

FossilOrigin-Name: 56e5063c326ffbfd3e3cb6f2b05718412aca2cb183274bfe11f5666effdd04b9

5 years agoWhen rewriting a query for window functions, if the rewrite changes the
drh [Sun, 24 May 2020 03:38:37 +0000 (03:38 +0000)] 
When rewriting a query for window functions, if the rewrite changes the
depth of TK_AGG_FUNCTION nodes, be sure to adjust the Expr.op2 field
appropriately.  Fix for ticket [7a5279a25c57adf1]

FossilOrigin-Name: ad7bb70af9bb68d192137188bb2528f1e9e43ad164c925174ca1dafc9e1f5339

5 years agoMove some utility Walker callbacks into the walker.c source file, as they
drh [Sun, 24 May 2020 03:01:36 +0000 (03:01 +0000)] 
Move some utility Walker callbacks into the walker.c source file, as they
seem to belong there better.

FossilOrigin-Name: dac438236f7c5419d4e7e094e8b3f19f83cd3b1a18bc8acb14aee90d4514fa3c

5 years agoImprovements to parse-tree tracing logic. No changes in deliverable code.
drh [Sun, 24 May 2020 02:05:04 +0000 (02:05 +0000)] 
Improvements to parse-tree tracing logic.  No changes in deliverable code.

FossilOrigin-Name: f7e5a68a7ebbb97a5beb050a75b3b4cf2fd6adc54653da993a8950fb3a5799f7

5 years agoMinor fix to a comment. No code changes.
drh [Sun, 24 May 2020 00:30:38 +0000 (00:30 +0000)] 
Minor fix to a comment.  No code changes.

FossilOrigin-Name: efdbb2b499bda8ffcfe54f5d6ece08a2c58fe7a490d9550785d806bd404abb8c

5 years agoLimit the "precision" of floating-point to text conversions in the printf()
drh [Sat, 23 May 2020 19:58:07 +0000 (19:58 +0000)] 
Limit the "precision" of floating-point to text conversions in the printf()
function to 100,000,000.  Fix for ticket [23439ea582241138].

FossilOrigin-Name: d08d3405878d394e08e5d3af281246edfbd81ca74cc8d16458808591512fb93d

5 years agoImproved bytecode comment.
drh [Sat, 23 May 2020 17:56:49 +0000 (17:56 +0000)] 
Improved bytecode comment.

FossilOrigin-Name: 9224f1543b51a674ad6d7db8e90d97e1b0d1abe68bed3417820ebd09d27270f9

5 years agoVersion 3.32.0 version-3.32.0
drh [Fri, 22 May 2020 17:46:16 +0000 (17:46 +0000)] 
Version 3.32.0

FossilOrigin-Name: 5998789c9c744bce92e4cff7636bba800a75574243d6977e1fc8281e360f8d5a

5 years agoChange a NEVER macro into a NO_TEST comment, as the conditional is reachable,
drh [Thu, 21 May 2020 20:38:39 +0000 (20:38 +0000)] 
Change a NEVER macro into a NO_TEST comment, as the conditional is reachable,
but only when compiling for Windows 32-bit.

FossilOrigin-Name: ce36b6d1331edba5a921fef32553e2470a79bdb1f62d2cfd81190691c83d5b06

5 years agoAvoid another potential OOB read in sqlite3expert.c.
dan [Thu, 21 May 2020 19:13:46 +0000 (19:13 +0000)] 
Avoid another potential OOB read in sqlite3expert.c.

FossilOrigin-Name: 0ccea80092f16e7f17f4c4de4f8be3fdef217199fcc08ace37e179c1b22c1294

5 years agoBack out the change from [7fab1393c2b22b1f] that tries to convert invalid
drh [Wed, 20 May 2020 15:02:04 +0000 (15:02 +0000)] 
Back out the change from [7fab1393c2b22b1f] that tries to convert invalid
surrogate characters in UTF16 into the replacement character 0xfffd, as we
find that this breaks some software.

FossilOrigin-Name: 4218c7b71fb6b227dbe4b852718584c150164af2d84e067cb810aa602554a609

5 years agoAdd compiler hints to disable TSAN for the routines that access the -shm
drh [Tue, 19 May 2020 15:51:10 +0000 (15:51 +0000)] 
Add compiler hints to disable TSAN for the routines that access the -shm
file header in WAL mode using a double-read with memory barrier.

FossilOrigin-Name: 3117c1b5a9e348fd8d16ba9d03fdafaad8514567fb3403f72b86d6162ad40bde

5 years agoIn os_win.c, avoid calling sqlite3_uri_boolean() on anything other than a main-db...
dan [Tue, 19 May 2020 15:40:07 +0000 (15:40 +0000)] 
In os_win.c, avoid calling sqlite3_uri_boolean() on anything other than a main-db filename.

FossilOrigin-Name: cb0a18e64f8d81c2ada9f698faaf5ca68a0666687bf6f3abc860324cb1997463

5 years agoUser-suggested improvement to the README.txt for the ICU extension.
drh [Tue, 19 May 2020 12:29:56 +0000 (12:29 +0000)] 
User-suggested improvement to the README.txt for the ICU extension.

FossilOrigin-Name: 1d1293c25abdd4b0fca64e5b1d0a118e2f339635dbc89422c0c2463fbf9ee27f

5 years agoIn wal.c, improved comments on concurrency issues. More use of
drh [Tue, 19 May 2020 12:27:29 +0000 (12:27 +0000)] 
In wal.c, improved comments on concurrency issues.  More use of
AtomicLoad() and AtomicStore().

FossilOrigin-Name: 4bf566feca3a8fbe5e386533aac30e0ac25836cfc820a3abd91e156bd6198b4a

5 years agoAdd vdbevtab.lo to build of libsqlite3.lib in Makefile.msc.
dan [Mon, 18 May 2020 18:02:37 +0000 (18:02 +0000)] 
Add vdbevtab.lo to build of libsqlite3.lib in Makefile.msc.

FossilOrigin-Name: f64d054b799c0af8d582fd9aff9bcbfa380ef08026ba5db8c5f89f6f56dfdad9

5 years agoAvoid harmless UB in memcpy() in the JSON extension.
drh [Sun, 17 May 2020 13:47:28 +0000 (13:47 +0000)] 
Avoid harmless UB in memcpy() in the JSON extension.

FossilOrigin-Name: 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469f8ece

5 years agoUse the sqlite3Realloc() interface internally, rather than the public
drh [Sun, 17 May 2020 00:26:44 +0000 (00:26 +0000)] 
Use the sqlite3Realloc() interface internally, rather than the public
sqlite3_realloc64() equivalent, to avoid unnecessary calls to
sqlite3_initialize().

FossilOrigin-Name: 1313557b512297e7b75ed748894379b2022aecf696d5a58318e46a668321c1ff

5 years agoPerformance optimization for the sqlite3FindTable() subroutine.
drh [Sat, 16 May 2020 21:01:00 +0000 (21:01 +0000)] 
Performance optimization for the sqlite3FindTable() subroutine.

FossilOrigin-Name: 55910b9a7287be92af9f95e0af54af822055d15b7eabbcc81d61410d0bf67726

5 years agoThe OP_RealAffinity opcode is not necessary after reading values from
drh [Sat, 16 May 2020 18:01:02 +0000 (18:01 +0000)] 
The OP_RealAffinity opcode is not necessary after reading values from
a virtual table (such as rtree).  It is harmless, but it does use CPU
cycles.  Might as well leave it off.

FossilOrigin-Name: dc18d89354cffcb726722c234a0271ab628a71277b22887eea2bf118028193a6

5 years agoFix a use-after-free bug in the fts3 snippet() function.
dan [Sat, 16 May 2020 17:26:58 +0000 (17:26 +0000)] 
Fix a use-after-free bug in the fts3 snippet() function.

FossilOrigin-Name: 0d69f76f0865f9626078bee087a22fb826407279e78cf9d5382e1c985c9f64a9

5 years agoExtra memory barrier during initialization.
drh [Sat, 16 May 2020 16:23:48 +0000 (16:23 +0000)] 
Extra memory barrier during initialization.

FossilOrigin-Name: 043a7e142dfc2b0da5fbc0b025d005ccad4886f0b0ff65426ba9155ca40394ca

5 years agoAdd sqlite3BeginBenignMalloc() and EndBenignMalloc() calls to debugging function...
dan [Sat, 16 May 2020 15:18:27 +0000 (15:18 +0000)] 
Add sqlite3BeginBenignMalloc() and EndBenignMalloc() calls to debugging function sqlite3VdbePrintOp().

FossilOrigin-Name: 6f857d0e9e0893524c2f828a1a1600fefb6efeff12ecbc9bb1da106a5aff9c1c

5 years agoUpdate code in sqlite3expert.c to account for the fact that "-- TRIGGER xyz" VM comme...
dan [Fri, 15 May 2020 18:48:31 +0000 (18:48 +0000)] 
Update code in sqlite3expert.c to account for the fact that "-- TRIGGER xyz" VM comments are now omitted for some builds.

FossilOrigin-Name: 7cf93dc55c48c68731a1fe3ae3517fcfeb5c252bfa87e715a333c6194bcc0ace

5 years agoFix another build problem for SQLITE_OMIT_VIRTUALTABLE builds.
dan [Fri, 15 May 2020 16:19:35 +0000 (16:19 +0000)] 
Fix another build problem for SQLITE_OMIT_VIRTUALTABLE builds.

FossilOrigin-Name: 5e1eb0fa3afd74251bc8f484e3edfa81b15610479431af205bd952c91eecd21f

5 years agoFix a documentation typo. No changes to code.
drh [Fri, 15 May 2020 16:05:31 +0000 (16:05 +0000)] 
Fix a documentation typo.  No changes to code.

FossilOrigin-Name: 758353c72627a847ba027ca44a750bbf057827dafd05811f56e4765dfc77623b

5 years agoAdjust some requirement marks. No changes to code.
drh [Fri, 15 May 2020 15:03:51 +0000 (15:03 +0000)] 
Adjust some requirement marks.  No changes to code.

FossilOrigin-Name: 7285ae2ce8fb1439e1acea2ec321abbc76aab0a2e84b58683fddb0a7bf74fb1b

5 years agoUpdate test file e_fkey.test to account for the fact that new columns with REFERENCE...
dan [Fri, 15 May 2020 13:52:33 +0000 (13:52 +0000)] 
Update test file e_fkey.test to account for the fact that new columns with REFERENCE clauses and non-NULL default values may now be added using ALTER TABLE if the table is empty.

FossilOrigin-Name: 4087fce97252beda2456164afe9508f952fc9fe4be68ad0e9b330569a78e42f2

5 years agoFix SQLITE_OMIT_VIRTUALTABLE testfixture builds.
dan [Fri, 15 May 2020 11:36:16 +0000 (11:36 +0000)] 
Fix SQLITE_OMIT_VIRTUALTABLE testfixture builds.

FossilOrigin-Name: 3d9780c5f6095ea35bc731a51eb34d7cf8bd5dcece825b686b94fd50131626e2

5 years agoTest script changes to account for the fact that the "p5" column in the EXPLAIN outpu...
dan [Fri, 15 May 2020 11:26:31 +0000 (11:26 +0000)] 
Test script changes to account for the fact that the "p5" column in the EXPLAIN output is now an integer, not a text values containing a 2-digit hex value.

FossilOrigin-Name: 102126d80872fdb7469233611cab28100c8455aab4ce25702b83398394559185

5 years agoEnhancements to long-path support in the Win32 VFS.
mistachkin [Fri, 15 May 2020 01:18:07 +0000 (01:18 +0000)] 
Enhancements to long-path support in the Win32 VFS.

FossilOrigin-Name: 0119d96decd344ae711388ac8475b92464a6d018ecf73862170f137410036dac

5 years agoMove some new test cases from fts3snippet.test into fts3snippet2.test.
drh [Fri, 15 May 2020 01:13:46 +0000 (01:13 +0000)] 
Move some new test cases from fts3snippet.test into fts3snippet2.test.

FossilOrigin-Name: fa203999944133941a38e5c858f1f66fc1ef4d2f33222ab81cbf4e3fc1539f1c

5 years agoAdd the SQLITE_ENABLE_FTS3_PARENTHESIS option to fuzzcheck. Add a new
drh [Fri, 15 May 2020 01:02:00 +0000 (01:02 +0000)] 
Add the SQLITE_ENABLE_FTS3_PARENTHESIS option to fuzzcheck.  Add a new
test case that uses that option.

FossilOrigin-Name: c49a33db954f1a3fbc1889bbe9f3f3fdb8fb00e31aafb91cd6f5d1602db5c2b9

5 years agoFix a null pointer deference that can occur on a strange matchinfo()
drh [Thu, 14 May 2020 23:59:24 +0000 (23:59 +0000)] 
Fix a null pointer deference that can occur on a strange matchinfo()
query.

FossilOrigin-Name: a4dd148928ea65bd4e1654dfacc3d8057d1f85b8c9939416991d50722e5a720e

5 years agoDo not allow a virtual table to be renamed into the name of one of its
drh [Thu, 14 May 2020 21:16:52 +0000 (21:16 +0000)] 
Do not allow a virtual table to be renamed into the name of one of its
shadows.

FossilOrigin-Name: eca0ba2cf4c0fdf757bae19c6397a48245adb99e8017ddc28f01804072a30b2c

5 years agoImplement the IIF(x,y,z) SQL function that is short-hand for
drh [Wed, 13 May 2020 18:03:34 +0000 (18:03 +0000)] 
Implement the IIF(x,y,z) SQL function that is short-hand for
"CASE WHEN x THEN y ELSE z END".  For compatibility with SQL Server.

FossilOrigin-Name: fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a

5 years agoRemove unused constant SQLITE_FUNC_COALESCE.
drh [Wed, 13 May 2020 17:26:38 +0000 (17:26 +0000)] 
Remove unused constant SQLITE_FUNC_COALESCE.

FossilOrigin-Name: a116b20f863e9732cd08fbfbb1aa48204a17d611c9c1edde85dcf59310bde782

5 years agoUse AtomicStore() and AtomicLoad() in a few more places to avoid a theoretically...
dan [Wed, 13 May 2020 13:33:30 +0000 (13:33 +0000)] 
Use AtomicStore() and AtomicLoad() in a few more places to avoid a theoretically undefined behaviour. This is not actually problem on any known hardware.

FossilOrigin-Name: fda57d4d2f1499c861d43026aa9362d1a30d67c9c002ebf5b0cdc25251537fbb

5 years agoNew test case in test/fuzzdata8.db.
drh [Mon, 11 May 2020 11:11:25 +0000 (11:11 +0000)] 
New test case in test/fuzzdata8.db.

FossilOrigin-Name: fa11230135610f01c56d6f436f30a8b57a50b430fe7397ea3a0b6642986b3a39

5 years agoFix a problem handling constant integer expressions with collation sequences in PARTI...
dan [Mon, 11 May 2020 10:55:24 +0000 (10:55 +0000)] 
Fix a problem handling constant integer expressions with collation sequences in PARTITION BY clauses.

FossilOrigin-Name: 155e6649efe8614718be7ac6c3cccf5b073ae57496dc220db5e4313621f5188e

5 years agoRelease some restrictions on columns added by ALTER TABLE so that they
drh [Fri, 8 May 2020 19:02:21 +0000 (19:02 +0000)] 
Release some restrictions on columns added by ALTER TABLE so that they
only apply if the table contains one or more rows.

FossilOrigin-Name: 3a16c0ce4d8851f79f670d94786032c8007619154ece44647dc9cc5b1f9654ff

5 years agoFix the count-optimization so that it honors the NOT INDEXED clause.
drh [Fri, 8 May 2020 18:22:00 +0000 (18:22 +0000)] 
Fix the count-optimization so that it honors the NOT INDEXED clause.

FossilOrigin-Name: 0d23a0b209900f4d7c6c13f75d4364f19afc23db72f9cfdb11e05b81502e8040

5 years agoNew test cases added to test/fuzzdata8.db.
drh [Fri, 8 May 2020 15:28:07 +0000 (15:28 +0000)] 
New test cases added to test/fuzzdata8.db.

FossilOrigin-Name: 3fce9711a47329811cd333ae2f1d1384a96d73b9a5d6f9d08454a57a3fd24fc8

5 years agoDo not retry on a failed realloc() unless SQLITE_ENABLE_MEMORY_MANAGEMENT
drh [Fri, 8 May 2020 10:44:23 +0000 (10:44 +0000)] 
Do not retry on a failed realloc() unless SQLITE_ENABLE_MEMORY_MANAGEMENT
is available, meaning that the retry has some possibility of success.

FossilOrigin-Name: e9a8f910b5e2b84dd77364783f0610bca970cc88aa037c88636c72145b99f411

5 years agoFix a failing assert() in fts3 triggered by a corrupt database.
dan [Thu, 7 May 2020 19:55:40 +0000 (19:55 +0000)] 
Fix a failing assert() in fts3 triggered by a corrupt database.

FossilOrigin-Name: cb299a090c81cdc5c116c4e15ab38fce112916f8b0fad0c7f2ab127e79238a94

5 years agoChanges to avoid deadlock in SQLITE_ENABLE_SETLK_TIMEOUT builds.
dan [Thu, 7 May 2020 14:39:56 +0000 (14:39 +0000)] 
Changes to avoid deadlock in SQLITE_ENABLE_SETLK_TIMEOUT builds.

FossilOrigin-Name: 652e4b23fffbff128b177697d7217b7d5aad8baf2364df1646b268ce6774e0fb

5 years agoFix an error that could occur if the first transaction executed by a connection confi... setlk-deadlock-changes
dan [Thu, 7 May 2020 14:26:40 +0000 (14:26 +0000)] 
Fix an error that could occur if the first transaction executed by a connection configured to use blocking locks is a write-transaction for which the WRITER lock cannot be obtained.

FossilOrigin-Name: 49e4dc72f7a4b28e4b49d7b91030bc986aea3ff44dac38cb6e68305800cd1de5

5 years agoMerge trunk changes into this branch.
dan [Thu, 7 May 2020 14:05:08 +0000 (14:05 +0000)] 
Merge trunk changes into this branch.

FossilOrigin-Name: ac4ee69664278a828e0a64c5be3b96fdb6eb6acc95646a9425c667aea328791c

5 years agoFix the handling of reserve-bytes so that the maximum value of 255 can be used.
drh [Thu, 7 May 2020 01:56:57 +0000 (01:56 +0000)] 
Fix the handling of reserve-bytes so that the maximum value of 255 can be used.

FossilOrigin-Name: 99749d4fd4930ccf15227f67c732266af9e09dd3cabdc0834fb450ef98196441

5 years agoAvoid leaking a file-handle in test file walsetlk.test.
dan [Wed, 6 May 2020 21:25:39 +0000 (21:25 +0000)] 
Avoid leaking a file-handle in test file walsetlk.test.

FossilOrigin-Name: 3cfc675e2e917b69108feb3a75728b573abe8e44f0890a7d20d307b0b6784c0e

5 years agoFix an assert() failure that could follow an IO error.
dan [Wed, 6 May 2020 21:24:29 +0000 (21:24 +0000)] 
Fix an assert() failure that could follow an IO error.

FossilOrigin-Name: e89c864299024cdce395a15c19b000b976142b9eed267901a288adaa695f9e65

5 years agoFix harmless compiler warnings.
drh [Wed, 6 May 2020 20:55:38 +0000 (20:55 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 92dc59132f8547635d73c61c21ea29b380c401ddc84a6d01412808e00386b9e8

5 years agoFix a problem preventing building without SQLITE_ENABLE_SETLK_TIMEOUT defined.
dan [Wed, 6 May 2020 20:45:11 +0000 (20:45 +0000)] 
Fix a problem preventing building without SQLITE_ENABLE_SETLK_TIMEOUT defined.

FossilOrigin-Name: 98eb54c6d83992886f17a00b6fc8998df230e3b5f45bafc6fae0d15a9ee5a4c6