]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoMerge the Parse.prepFlags change from trunk. stmt-cache
drh [Sat, 1 Oct 2022 13:28:04 +0000 (13:28 +0000)] 
Merge the Parse.prepFlags change from trunk.

FossilOrigin-Name: c8d77f398099f357bed0aab10f066c6b26ba4ad8ffd68bb7b4465c0c4999599b

2 years agoReplace the Parse.disableVtab field with Parse.prepFlags for increased
drh [Sat, 1 Oct 2022 13:17:53 +0000 (13:17 +0000)] 
Replace the Parse.disableVtab field with Parse.prepFlags for increased
generality, a small size reduction, and a small performance increase.

FossilOrigin-Name: b7da0bcdf70e53ab1ec00a0694e17c7429e23bc6eb3f39b622d06a930aa2f6a3

2 years agoMerge the latest trunk enhancements into the stmt-cache branch.
drh [Sat, 1 Oct 2022 12:00:39 +0000 (12:00 +0000)] 
Merge the latest trunk enhancements into the stmt-cache branch.

FossilOrigin-Name: 7812aea6ea2a922599970cd56933dadaa340bcf40781701844f62456772501c2

2 years agoRemove one of the NEVER() macros added by [5166acf3f0040459] because it
drh [Fri, 30 Sep 2022 22:40:57 +0000 (22:40 +0000)] 
Remove one of the NEVER() macros added by [5166acf3f0040459] because it
is reachable after all.

FossilOrigin-Name: bd8ae5febbb8d3122f1e2e09b9fcdd6ac20c075ae1cf60bcdbd36080f3736417

2 years agoNew test cases in fuzzdata8.db
drh [Fri, 30 Sep 2022 20:59:09 +0000 (20:59 +0000)] 
New test cases in fuzzdata8.db

FossilOrigin-Name: aa367a3c974041323edb759855f0b83803439ceef2846da2d73eadd80efeaac4

2 years agoFix a bug in the demoDelete fix from [d76a301e22e05722].
drh [Fri, 30 Sep 2022 20:53:36 +0000 (20:53 +0000)] 
Fix a bug in the demoDelete fix from [d76a301e22e05722].

FossilOrigin-Name: 7e761a02530ffbb055a766eb6c995f11fc2adbabb9a52502124f672fdcff0d10

2 years agoAdd NEVER() to two error-detection tests that were made unreachable by
drh [Fri, 30 Sep 2022 20:48:22 +0000 (20:48 +0000)] 
Add NEVER() to two error-detection tests that were made unreachable by
the previous check-in.

FossilOrigin-Name: 5166acf3f00404597e77910aee88920ab833af8447766f50bf4f70525606cf95

2 years agoBetter handle a case of database corruption where a b-tree page is one of its own...
dan [Fri, 30 Sep 2022 20:15:21 +0000 (20:15 +0000)] 
Better handle a case of database corruption where a b-tree page is one of its own ancestor pages.

FossilOrigin-Name: a24e46804893a7e6e8f3130abca882f9a3aa3b7b2b82aa39a0a20856172766d5

2 years agoImprovements to the "demoDelete" method in the demovfs, suggested by
drh [Fri, 30 Sep 2022 14:35:18 +0000 (14:35 +0000)] 
Improvements to the "demoDelete" method in the demovfs, suggested by
[forum:/forumpost/cad18961c2|forum post cad18961c2].

FossilOrigin-Name: d76a301e22e0572262917dfe9557a5051339a65416a473dd2d9989a49975403e

2 years agoFix misuse of the sqlite3_set_auxdata() interface in the ICU extension.
drh [Wed, 28 Sep 2022 19:14:01 +0000 (19:14 +0000)] 
Fix misuse of the sqlite3_set_auxdata() interface in the ICU extension.

FossilOrigin-Name: f25cf63471cbed1edb27591e57fead62550d4046dbdcb61312288f0f6f24c646

2 years agoProvide the SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting the
drh [Tue, 27 Sep 2022 16:35:06 +0000 (16:35 +0000)] 
Provide the SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting the
maximum memory allocation size.

FossilOrigin-Name: 584de6a996c78b8e41bdfcd05a8e2a3844664c6b4efedb5883c8b8af388462b5

2 years agoMake the legacy FTS3 code more robust against integer overflow during
drh [Tue, 27 Sep 2022 01:53:05 +0000 (01:53 +0000)] 
Make the legacy FTS3 code more robust against integer overflow during
memory allocation.

FossilOrigin-Name: 5517bc50988b5339c2fd071b29de1b5ca03037b0b635c3b112cf7108fab54d5f

2 years agoEnhance defensive mode so that it disallows CREATE TRIGGER statements if the
drh [Tue, 27 Sep 2022 00:56:45 +0000 (00:56 +0000)] 
Enhance defensive mode so that it disallows CREATE TRIGGER statements if the
statements within the trigger attempt to write on a shadow table.

FossilOrigin-Name: 3283bbd12a60f472ed03cb7c6209a605a3bf9f3d9083371e17840b56e8b3f559

2 years agoReduced and improved comments on the constraintCompatibleWithOuterJoin()
drh [Wed, 21 Sep 2022 18:21:31 +0000 (18:21 +0000)] 
Reduced and improved comments on the constraintCompatibleWithOuterJoin()
function.

FossilOrigin-Name: 38aaf26e082bd95df6b64df43e1772fe6e20c4eb71307dcd97559cac7f11f8f1

2 years agoThe RIGHT JOIN logic added to version 3.39.0 added a new restriction on the
drh [Wed, 21 Sep 2022 09:54:41 +0000 (09:54 +0000)] 
The RIGHT JOIN logic added to version 3.39.0 added a new restriction on the
query flattener which resulted in a performance regression for some queries,
as documented by [forum:/forumpost/96b9e5709cf47cda|forum post 96b9e5709cf47cda].
This change removes that restriction (thus restoring performance) and fixes the
problem that RIGHT JOIN was having in a different way.

FossilOrigin-Name: 501609eddf2a46d51e8cd56477a22d4df142a166e78fe4322c0db11d1eed6687

2 years agoBreak out the decision of whether or not a constraint term is usable by flattener-omit-restriction-29
drh [Wed, 21 Sep 2022 00:16:59 +0000 (00:16 +0000)] 
Break out the decision of whether or not a constraint term is usable by
an outer join into a subroutine: constraintCompatibleWithOuterJoin().

FossilOrigin-Name: c7fbc9b0453050e2746af27e3a11e0c3701bef8c56da8e19173242c6ea3aff8b

2 years agoDo not allow EP_InnerON terms to be used on a outer join.
drh [Tue, 20 Sep 2022 22:19:13 +0000 (22:19 +0000)] 
Do not allow EP_InnerON terms to be used on a outer join.

FossilOrigin-Name: f47aa745690c018800243bf76930b2499ff4537411c4e27b4b16ba3854cc2bf8

2 years agoAdd new test cases that (current) get an incorrect answer.
drh [Tue, 20 Sep 2022 21:07:52 +0000 (21:07 +0000)] 
Add new test cases that (current) get an incorrect answer.

FossilOrigin-Name: fe5c37736444e397ace387b761ec2491229785d7a437f3f60232aedf9d1f00ec

2 years agoNew test cases for query flattening when there are ON clauses and outer joins.
drh [Tue, 20 Sep 2022 19:45:04 +0000 (19:45 +0000)] 
New test cases for query flattening when there are ON clauses and outer joins.

FossilOrigin-Name: db55387b1972bc7bc6855bd3497af744a111e7d28d09893cd985fbb01be41bcc

2 years agoModify the OP_IfNotOpen opcode so that the jump is taken if the cursor is open
drh [Tue, 20 Sep 2022 19:22:17 +0000 (19:22 +0000)] 
Modify the OP_IfNotOpen opcode so that the jump is taken if the cursor is open
but was previously set to a NULL row using OP_NullRow.

FossilOrigin-Name: 1292d68caa7086610ddda343f3852e63de8da1eb66536ee4716b6529f5a31bc6

2 years agoRemove code that has been previously commented out.
drh [Tue, 20 Sep 2022 18:18:00 +0000 (18:18 +0000)] 
Remove code that has been previously commented out.

FossilOrigin-Name: 852b385a5de622aa32026824210d4bd23db52a4a8a697b83d22d6000edeba487

2 years agoMerge the fuzzcheck fix from trunk into the flattener improvement branch.
drh [Tue, 20 Sep 2022 17:43:40 +0000 (17:43 +0000)] 
Merge the fuzzcheck fix from trunk into the flattener improvement branch.

FossilOrigin-Name: 930a8c1561d0d5dc70dc5378edac77f79ac59ab6569b561de3dfb02f160c38c5

2 years agoUpdate the fuzz invariant checker to conform to the latest changes in
drh [Tue, 20 Sep 2022 17:21:54 +0000 (17:21 +0000)] 
Update the fuzz invariant checker to conform to the latest changes in
dbsqlfuzz.

FossilOrigin-Name: 8d8c124349d2a25200ace9a60d76751594b722468ad0c39d927a5d2c6e2464e0

2 years agoIs the query flattener restriction 29 (do not allow both EP_InnerON and
drh [Tue, 20 Sep 2022 16:57:49 +0000 (16:57 +0000)] 
Is the query flattener restriction 29 (do not allow both EP_InnerON and
EP_OuterON constraints on the same FROM clause term) really necessary?   This
branch explores what happens if we omit that restriction.  This is an effort
to address the performance regression reported by
[forum:/forumpost/96b9e5709cf47cda|forum post 96b9e5709cf47cda] that is caused
by flattener restriction 29.

FossilOrigin-Name: 19270577ad1d08c9e6e5f0600396b8a1ccda9df1e67a0df845aee6b60437f379

2 years agoClarify comments that describe query flattener restrictions associated with
drh [Mon, 19 Sep 2022 19:25:15 +0000 (19:25 +0000)] 
Clarify comments that describe query flattener restrictions associated with
outer joins.  No code changes.

FossilOrigin-Name: 2647d73bb1876d01851f52cb3fd6af08a962ab336b6d51c160d27b1baf94f75f

2 years agoFix a minor comment typo. No changes to code or documentation.
drh [Mon, 19 Sep 2022 17:41:59 +0000 (17:41 +0000)] 
Fix a minor comment typo.  No changes to code or documentation.

FossilOrigin-Name: 8032db4ade66f70a102abb9d3a49e20620e204c45ad7a954a49d20403985bf07

2 years agoRemove a NEVER macro in defragmentPage() that dbsqlfuzz discovered can be
drh [Sun, 18 Sep 2022 17:59:28 +0000 (17:59 +0000)] 
Remove a NEVER macro in defragmentPage() that dbsqlfuzz discovered can be
true.  crash-32d9312f145cdce41613573f6431d9a3e439e3d7

FossilOrigin-Name: 90403759e1cf30f7c11fa8170d6df59a0dd138e1de59d2b60bec7ba15d74f67c

2 years agoNew run-time options to the speed-check.sh script.
drh [Mon, 12 Sep 2022 16:07:24 +0000 (16:07 +0000)] 
New run-time options to the speed-check.sh script.

FossilOrigin-Name: ff46bc9d2a844dde9dafa157114f4d9ee157205ca5c08ed9ee32f018de310e62

2 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Fri, 9 Sep 2022 17:50:29 +0000 (17:50 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 73c4c68d3b4c16caf8281dabddd7365d24691e5ee2da89b1783eca66bfbd9280

2 years agoEnhance an assert() to impose for tighter constraints on the operation of pcache.
drh [Wed, 7 Sep 2022 20:11:22 +0000 (20:11 +0000)] 
Enhance an assert() to impose for tighter constraints on the operation of pcache.

FossilOrigin-Name: 42105eb43a916a7cd839fa6c582eaffaef17f50b23c3e05142400c379feb73c7

2 years agoAn improved technique for ensuring that the Rekey() operation does not
drh [Wed, 7 Sep 2022 19:28:18 +0000 (19:28 +0000)] 
An improved technique for ensuring that the Rekey() operation does not
overwrite an existing page number.  This approach does not change the
semantics of the underlying pluggable pcache and it is easier to prove
correct.  This replaces the changes at
[aadd38f99a3e5abc] and [81cff9f1955874aa].

FossilOrigin-Name: 7dbddde79e3ca1b81e00288616fc27434698ce6dcb47714728fce8602ae91f45

2 years agoAdd the tool/omittest-msvc.tcl script that will try to build using MSVC
drh [Mon, 5 Sep 2022 22:54:36 +0000 (22:54 +0000)] 
Add the tool/omittest-msvc.tcl script that will try to build using MSVC
using various compile-time options, to ensure that the compile-time options
all build without errors.

FossilOrigin-Name: 6b00ecb59fd303f7985902c35a46db9e729201d4beaedea46596b728d9e4b1c8

2 years agoGet the tool/omittest-msvc.tcl script working. msvc-omit-test
drh [Mon, 5 Sep 2022 22:53:24 +0000 (22:53 +0000)] 
Get the tool/omittest-msvc.tcl script working.

FossilOrigin-Name: 82b89f8a074858a81d841dfc26436e8d39ce4907b8f989eba4d848db16758303

2 years agoAdd a prototype for a script, similar to tool/omittest.tcl, that is designed
drh [Mon, 5 Sep 2022 20:42:01 +0000 (20:42 +0000)] 
Add a prototype for a script, similar to tool/omittest.tcl, that is designed
to test builds using MSVC to ensure they work with various OMIT options.

FossilOrigin-Name: b1e37a0bd31fa9f8e58c2859a80c23a682b4702eefab2c55b243f1e21d475d6c

2 years agoFix the windows build so that it works with -DSQLITE_OMIT_AUTOINIT.
drh [Mon, 5 Sep 2022 18:17:03 +0000 (18:17 +0000)] 
Fix the windows build so that it works with -DSQLITE_OMIT_AUTOINIT.

FossilOrigin-Name: f74a5ea8c986dc33d3afcda169c38abbe55728c56716cf9991a5e2ef7fc4917a

2 years agoEnsure the Pager.journalOff variable is zeroed if an error occurs while writing the...
dan [Fri, 2 Sep 2022 21:19:24 +0000 (21:19 +0000)] 
Ensure the Pager.journalOff variable is zeroed if an error occurs while writing the initial header to the journal file.

FossilOrigin-Name: da7af290960ab8a04a1f55cdc5eeac36b47fa194edf67f0a05daa4b7f2a4071c

2 years agoFix an assert() associated with the dbsqlfuzz error at [8372468bb5d8922c].
drh [Fri, 2 Sep 2022 17:25:25 +0000 (17:25 +0000)] 
Fix an assert() associated with the dbsqlfuzz error at [8372468bb5d8922c].

FossilOrigin-Name: 54251f81ebc43839cc97f91d2df4c320c1b96b5690cc11ce45b60c087c9becd6

2 years agoIf sqlite3PcacheMove() really performs a swap, then be sure to renumber the
drh [Fri, 2 Sep 2022 15:09:55 +0000 (15:09 +0000)] 
If sqlite3PcacheMove() really performs a swap, then be sure to renumber the
second page.

FossilOrigin-Name: 81cff9f1955874aade55daa94263f58f06d966bd51ad558755f92777069a7347

2 years agoEnhance the pcache1 implementation so that during an xRekey operation if
drh [Fri, 2 Sep 2022 14:29:54 +0000 (14:29 +0000)] 
Enhance the pcache1 implementation so that during an xRekey operation if
another page already exists at the destination, that other page gets moved
to the source key.

FossilOrigin-Name: aadd38f99a3e5abcf9bef49f4367752f163cc79500a28f812bb71969d7de419c

2 years agoMutex protect access to the sqlite3_test_directory and sqlite3_data_directory
drh [Fri, 2 Sep 2022 11:45:26 +0000 (11:45 +0000)] 
Mutex protect access to the sqlite3_test_directory and sqlite3_data_directory
global variables.  See
[forum:/forumpost/719a11e1314d1c70|forum thread 719a11e1314d1c70].

FossilOrigin-Name: 8e6ad3a3e942a326cf16432e16d6596c7206c05b6f45cd0ff3a9b836bcfc9deb

2 years agoImproved mutex protection of the sqlite3_temp_directory and tempdir-mutex
drh [Fri, 2 Sep 2022 11:12:16 +0000 (11:12 +0000)] 
Improved mutex protection of the sqlite3_temp_directory and
sqlite3_data_directory global variables.

FossilOrigin-Name: ebbe9634d6dde9e097f61fb98a79111e46de422b7bbbd9ed3af7b6f22aacf5ec

2 years agoExperimental changes to put sqlite3_temp_directory behind a mutex.
drh [Fri, 2 Sep 2022 00:36:16 +0000 (00:36 +0000)] 
Experimental changes to put sqlite3_temp_directory behind a mutex.

FossilOrigin-Name: 5ee3515fbb88bf1ae5f8b507844f82dcc429380b6ebeab9b09b52b25ee60a60d

2 years agoDefer deleting a transient SELECT statement associated with a flattening
drh [Thu, 1 Sep 2022 13:51:09 +0000 (13:51 +0000)] 
Defer deleting a transient SELECT statement associated with a flattening
of one arm of a compound SELECT until after the parse has completed.

FossilOrigin-Name: 1c4157c71cd1e062a9c2c79787d17e34e340f28ce1e40573851dfe174f5da7d7

2 years agoIn the query planner, add a heuristic that will reduce the cost of a full
drh [Thu, 1 Sep 2022 10:29:02 +0000 (10:29 +0000)] 
In the query planner, add a heuristic that will reduce the cost of a full
table scan for a materialized view or subquery if the full scan is the
outer-most loop.  This is shown to speed up some queries.

FossilOrigin-Name: 609fbb94b8f01d6792e5941ab23ce041313d359f6788c4dde6b1ca749ab49137

2 years agoEnhance the b-tree page sorting code to ensure that sqlite3PagerRekey() never
drh [Wed, 31 Aug 2022 15:04:42 +0000 (15:04 +0000)] 
Enhance the b-tree page sorting code to ensure that sqlite3PagerRekey() never
overloads a page number and uses only the PENDING_BYTE page for temporary
storage.

FossilOrigin-Name: 5007742886bd20de20be3973737cf46b010359911615eb3da69cd262bd9a2435

2 years agoImproved comments in pcache1.c. No changes to code.
drh [Tue, 30 Aug 2022 16:54:41 +0000 (16:54 +0000)] 
Improved comments in pcache1.c.  No changes to code.

FossilOrigin-Name: dd017bb1b3e31c7692d29dc4865d6bda871e429978c8738a39160d0114e5bf9b

2 years agoAny function call can abort. Take this into account when deciding if a DML
drh [Tue, 30 Aug 2022 00:11:51 +0000 (00:11 +0000)] 
Any function call can abort.  Take this into account when deciding if a DML
statement needs a statement journal.  See
[forum:/forumpost/9b9e4716c0d7bbd1|forum thread 9b9e4716c0d7bbd1] for more
information.

FossilOrigin-Name: 5c95ae6c9b93b9bcf698bb1cad93b2da2e28121b35e7c539b1ddc0ef2de33cfe

2 years agoMore assert() statements in the page cache.
drh [Sat, 27 Aug 2022 16:11:00 +0000 (16:11 +0000)] 
More assert() statements in the page cache.

FossilOrigin-Name: 7c96a56c0d1de966844da6c5a84c0cd6066130a10724797ce6f228a9182d9b85

2 years agoEnsure that every pcache page always has either the PGHDR_DIRTY or the
drh [Sat, 27 Aug 2022 14:43:34 +0000 (14:43 +0000)] 
Ensure that every pcache page always has either the PGHDR_DIRTY or the
PGHDR_CLEAN bit set, even during transient page reshuffling during btree
balancing.

FossilOrigin-Name: e67f03c166277951725c194674c84da61c152a5820aa6df55a726f7dda838e92

2 years agoEnsure that sqlite3_prepare() inputs always have a semicolon terminator in
drh [Thu, 25 Aug 2022 19:29:35 +0000 (19:29 +0000)] 
Ensure that sqlite3_prepare() inputs always have a semicolon terminator in
speedtest1.

FossilOrigin-Name: c72756b0f2db30c622f00f43be9245d50e36049bd7740ee6332164f0c48f9c3d

2 years agoAdd the --script option to speedtest1.
drh [Thu, 25 Aug 2022 19:19:25 +0000 (19:19 +0000)] 
Add the --script option to speedtest1.

FossilOrigin-Name: 1c87d7c58d5aec83f9e2ae3771a81aa17cfae0cf06169025a5db085e2d5749f9

2 years agoFix the bytecode engine so that it is able to handle an incoming
drh [Thu, 25 Aug 2022 18:29:12 +0000 (18:29 +0000)] 
Fix the bytecode engine so that it is able to handle an incoming
SQLITE_TOOBIG error, which is now possible using the statement cache.

FossilOrigin-Name: 7763b98b36bec186c5cc4a06382ee424fe9c7f401c70858fdfa490baa4bf437c

2 years agoDo not attempt to cache DDL statement.
drh [Thu, 25 Aug 2022 17:12:30 +0000 (17:12 +0000)] 
Do not attempt to cache DDL statement.

FossilOrigin-Name: 8f6a1f77b8d11c4eea315672353ea18a1ac50aa46a8e3f06f7d3b81de25f88c6

2 years agoImproved documentation of new features. Minor speed enhancements.
drh [Thu, 25 Aug 2022 15:09:31 +0000 (15:09 +0000)] 
Improved documentation of new features.  Minor speed enhancements.

FossilOrigin-Name: da9aa5476c342ed02a982e81eb8272cb33adb2ed3d0b5df44b2c88b27d80a94c

2 years agoMerge changes from trunk into the stmt-cache branch.
drh [Thu, 25 Aug 2022 14:31:08 +0000 (14:31 +0000)] 
Merge changes from trunk into the stmt-cache branch.

FossilOrigin-Name: bc988ce727bee0c7ac6406b5c9af486e353f1adf1e13b11ba0ac963fbea1f14e

2 years agoRemove a NEVER() macro for a condition that is actually reachable following an OOM...
dan [Thu, 25 Aug 2022 13:32:55 +0000 (13:32 +0000)] 
Remove a NEVER() macro for a condition that is actually reachable following an OOM. dbsqlfuzz crash-6ef3cd3b18ccc5de86120950a0498641acd90a33.txt.

FossilOrigin-Name: b573e2cffa5fedc893ed30e76e47022b3617ac5583e1eb486afa810b2514c419

2 years agoIf a perpared statement runs the Expire opcode, then disqualify it from
drh [Thu, 25 Aug 2022 13:09:02 +0000 (13:09 +0000)] 
If a perpared statement runs the Expire opcode, then disqualify it from
being cached.

FossilOrigin-Name: f27d919f3535f2be6642a02cf03cee82c66ff9d1e727f0c59c137f2a7f1d00c9

2 years agoChange sqlite3_prepare_v3() to require SQLITE_PREPARE_CACHE in order for a
drh [Wed, 24 Aug 2022 23:50:45 +0000 (23:50 +0000)] 
Change sqlite3_prepare_v3() to require SQLITE_PREPARE_CACHE in order for a
statement to be a cache candidate.  But any statement can pull from the cache.
Also add statement cache control to the CLI.

FossilOrigin-Name: c9dc536db9d13c0d66e5b84e564d6813c184ae26c889413a64b365781bf8ee50

2 years agoAdd a mutex to the sqlite3_db_config() interface so that it is threadsafe
drh [Wed, 24 Aug 2022 17:59:00 +0000 (17:59 +0000)] 
Add a mutex to the sqlite3_db_config() interface so that it is threadsafe
when two or more threads call it on the same database connection at the same
time.

FossilOrigin-Name: 459ad8846ee1ee2d3b277a291c47121692bdf477e779b06e77be8338f62237a6

2 years agoFirst attempt at adding a built-in prepared statement cache. This is
drh [Wed, 24 Aug 2022 17:55:27 +0000 (17:55 +0000)] 
First attempt at adding a built-in prepared statement cache.  This is
mostly working, but still has a few obscure faults.

FossilOrigin-Name: c217b763b148e8bece9d1f72525fd5026d3f710b337c010ffd0306fde4f9add8

2 years agoFix an inefficiency in the ".dump" command when outputing large blob literals.
dan [Wed, 24 Aug 2022 11:51:31 +0000 (11:51 +0000)] 
Fix an inefficiency in the ".dump" command when outputing large blob literals.

FossilOrigin-Name: c055d05dbdfd4643d5052c6e6a736c78651fdfcd78f15f791af903df3814832d

2 years agoChange the names of the Vdbe.pVNext and Vdbe.ppVPrev fields to make them
drh [Tue, 23 Aug 2022 20:11:01 +0000 (20:11 +0000)] 
Change the names of the Vdbe.pVNext and Vdbe.ppVPrev fields to make them
unique.  Change to ppVPrev to save a few bytes and a few CPU cycles.

FossilOrigin-Name: 34b8ea31877ae8b40729d37b3f51ae7e15f38be841881ea4a37c9c8f0a52896d

2 years agoEnhance assert() statements to enforce tighter bounds on the P5 operand of
drh [Tue, 23 Aug 2022 17:51:39 +0000 (17:51 +0000)] 
Enhance assert() statements to enforce tighter bounds on the P5 operand of
the OP_Next and OP_Prev opcodes.

FossilOrigin-Name: 4e0a07fc6f96e6e7726506b7a5ee942461c1381501f253893fa94d76023b634f

2 years agoAdd mksourceid binary to the clean rules and $(TESTPROGS) to distclean.
stephan [Tue, 23 Aug 2022 16:55:19 +0000 (16:55 +0000)] 
Add mksourceid binary to the clean rules and $(TESTPROGS) to distclean.

FossilOrigin-Name: ae3e82f5a3332bea261aca6a0dd02063cf7056c023204cc10f1ae18d75249f91

2 years agoPerformance enhancement for sqlite3DbFree().
drh [Mon, 22 Aug 2022 15:18:37 +0000 (15:18 +0000)] 
Performance enhancement for sqlite3DbFree().

FossilOrigin-Name: c296a9d958ec360fc8d217363348b4918d665bccb3c4f27503a2dcef7db49052

2 years agoAdd the new internal interface sqlite3DbNNFreeNN(db,ptr) where both the
drh [Mon, 22 Aug 2022 02:00:26 +0000 (02:00 +0000)] 
Add the new internal interface sqlite3DbNNFreeNN(db,ptr) where both the
db and ptr parameters are guaranteed to be non-NULL.  Use this where
appropriate to save more than 2 million CPU cycles on the standard
performance test.

FossilOrigin-Name: e5eaa80e81fdf86f2875a912b880272b8d099b82b08e945a7988c5dd0fe9d6b5

2 years agoMerge the test case for dbsqlfuzz 18fe4e257be7fa3ecfb0424ab7427e41e97ef9e3
drh [Sat, 20 Aug 2022 19:45:41 +0000 (19:45 +0000)] 
Merge the test case for dbsqlfuzz 18fe4e257be7fa3ecfb0424ab7427e41e97ef9e3
assertion fault, which is fixed with the previous check-in.

FossilOrigin-Name: 2d13ec086e96a5446462ce0f689c40c8196e740cd693f5967bfe9eb961f03463

2 years agoEnhance the enforcement of SQLITE_VTAB_DIRECTONLY so that it applies to
drh [Sat, 20 Aug 2022 19:33:04 +0000 (19:33 +0000)] 
Enhance the enforcement of SQLITE_VTAB_DIRECTONLY so that it applies to
DML statements within triggers.  Do not allow DML stratements against
virtual tables within triggers unless either the virtual table is
SQLITE_VTAB_INNOCUOUS or PRAGMA trusted_schema is ON.

FossilOrigin-Name: 9433ea4070f52135be64569057f439e7bdb4b3f425d87167c9ebda50011210c1

2 years agoAdd test case for fuzzer case crash-18fe4e. crash-18fe4e
dan [Fri, 19 Aug 2022 20:10:51 +0000 (20:10 +0000)] 
Add test case for fuzzer case crash-18fe4e.

FossilOrigin-Name: 8372468bb5d8922cf20b8bbee34cfd6044ceb09c26a4efa79a5e6df2c7c4b730

2 years agoIn the ".dump" command of the CLI, if a schema statement ends with an
drh [Wed, 17 Aug 2022 20:18:34 +0000 (20:18 +0000)] 
In the ".dump" command of the CLI, if a schema statement ends with an
unterminated comment, try to terminate that comment prior to appending
the ";" at the end.  [forum:/forumpost/d7be961c5c|Forum post d7be961c5c].

FossilOrigin-Name: 96e112da1ac56767cf49f26132833745b6020d2c60f5c36f86ca84f87ad30c81

2 years agoEnhance the "PRAGMA integrity_check" statement so that it verifies the rows of
drh [Wed, 17 Aug 2022 18:07:52 +0000 (18:07 +0000)] 
Enhance the "PRAGMA integrity_check" statement so that it verifies the rows of
a WITHOUT ROWID table are in the correct order.

FossilOrigin-Name: 62f934bff495850d0763e07ffa44a557f066ecba9d039363f32287213cba819f

2 years agoMinor code simplification in the code generator for PRAGMA integrity check.
drh [Wed, 17 Aug 2022 17:14:36 +0000 (17:14 +0000)] 
Minor code simplification in the code generator for PRAGMA integrity check.

FossilOrigin-Name: a3b9c7a6c9be5c78a93e5125f16237d2d84b977eca81f527af0198e96435a995

2 years agoChange the legacy RC4-based PRNG to use the RFC-7539 chacha20 algorithm.
drh [Tue, 16 Aug 2022 17:18:00 +0000 (17:18 +0000)] 
Change the legacy RC4-based PRNG to use the RFC-7539 chacha20 algorithm.

FossilOrigin-Name: a0f801151925e882e120f6ab685dcacb9d3268d25b52bc665c5b927bcc7dda1e

2 years agoFix obsolete comments. Add new comments. Fix non-standard spacing. chacha20-prng
drh [Tue, 16 Aug 2022 16:57:33 +0000 (16:57 +0000)] 
Fix obsolete comments.  Add new comments.  Fix non-standard spacing.

FossilOrigin-Name: a0d224c6a69941dad1f2b35edcc7ddee343b99eae2aeed74043461f3e97ef5b4

2 years agoFix an off-by-one error in the ChaCha20 initialization code.
drh [Tue, 16 Aug 2022 16:40:54 +0000 (16:40 +0000)] 
Fix an off-by-one error in the ChaCha20 initialization code.

FossilOrigin-Name: 72e220eed446ea9a02a6ef03e09a01bcb8bbca1f3b32d2e0bf52a17d9722e2f0

2 years agoOmit an unnecessary test case from corruptN.test that does not work with the
drh [Tue, 16 Aug 2022 14:09:51 +0000 (14:09 +0000)] 
Omit an unnecessary test case from corruptN.test that does not work with the
new RFC-7539 PRNG.

FossilOrigin-Name: d9e8c65ed25c4f6222c737f4244d5362dbe433d357f7d133765157446cf4e925

2 years agoAdd assert() statements to verify that the SQLITE_OPEN_EXCLUSIVE flag is always passe...
dan [Tue, 16 Aug 2022 10:52:35 +0000 (10:52 +0000)] 
Add assert() statements to verify that the SQLITE_OPEN_EXCLUSIVE flag is always passed to the VFS when opening a temporary file.

FossilOrigin-Name: e123da49ccae61d591abded52f4721aa10f20d75935c9a3e3fe826a9b8df2317

2 years agoReplace the RC4-based PRNG with one based on ChaCha20. 3x faster.
drh [Tue, 16 Aug 2022 00:04:40 +0000 (00:04 +0000)] 
Replace the RC4-based PRNG with one based on ChaCha20.  3x faster.

FossilOrigin-Name: 084d8776fa95c75440530028171c56547a341c9a952ba2f29bb533b538603c78

2 years agoExtra test for SQLITE_MAX_COMPOUND_SELECT.
dan [Mon, 15 Aug 2022 19:23:15 +0000 (19:23 +0000)] 
Extra test for SQLITE_MAX_COMPOUND_SELECT.

FossilOrigin-Name: c271096736889530f392ff37e631a77f3bc9c46b290dbda245fa05249f4410fc

2 years agoThe new --script option to dbtotxt.c looks for an SQL script at the head of
drh [Mon, 15 Aug 2022 18:36:08 +0000 (18:36 +0000)] 
The new --script option to dbtotxt.c looks for an SQL script at the head of
the file and generates a CLI script that will construct the database then run
the SQL.

FossilOrigin-Name: 6170e638ebeb12cc40c3247324237978401f701afc270de88ad03e183e82cefc

2 years agoIn the documentation emphasize that the use of shared cache is discouraged.
drh [Mon, 15 Aug 2022 12:26:26 +0000 (12:26 +0000)] 
In the documentation emphasize that the use of shared cache is discouraged.
Fix test cases so that they all work with shared cache disabled.

FossilOrigin-Name: 52c3ae063e133c5f88cad2c3084cf46218f865ac817ab937e3529d2c6a7af300

2 years agoAdd the (undocumented) SQLITE_DEFAULT_UNIX_VFS compile-time option.
drh [Fri, 12 Aug 2022 18:46:01 +0000 (18:46 +0000)] 
Add the (undocumented) SQLITE_DEFAULT_UNIX_VFS compile-time option.

FossilOrigin-Name: 49828bdec5f926cd18a069d39a5db0b1e1f3528a2affcfbaa1cf7b98aca51b3b

2 years agoMinor wasm-related doc clarification and remove an obsolete code comment.
stephan [Fri, 12 Aug 2022 17:55:18 +0000 (17:55 +0000)] 
Minor wasm-related doc clarification and remove an obsolete code comment.

FossilOrigin-Name: 1b1f650a08da93da97ed3a96b9a3e4eac567472c266188c02a9bffe1cf620e53

2 years agowasm: document the role of sqlite3-wasm.c. Other minor doc updates.
stephan [Fri, 12 Aug 2022 13:07:21 +0000 (13:07 +0000)] 
wasm: document the role of sqlite3-wasm.c. Other minor doc updates.

FossilOrigin-Name: 4c10b9b18feca82440273f8192fef951ad051bbfd8aad4d3c840cf6375130afd

2 years agowasm: corrected (in as-yet unused code) a flags check.
stephan [Fri, 12 Aug 2022 09:32:51 +0000 (09:32 +0000)] 
wasm: corrected (in as-yet unused code) a flags check.

FossilOrigin-Name: 06b6113783dd81252a5dd125e1cddb52a9d4e387c74cfb3ba88475e47a31060a

2 years agoWasm-related doc additions and tweaks.
stephan [Thu, 11 Aug 2022 15:45:32 +0000 (15:45 +0000)] 
Wasm-related doc additions and tweaks.

FossilOrigin-Name: ec55a3aa44a80f661dd451b9ea567449ea4c7353901cfd44a4b50ca10f00ddbd

2 years agoMerge in wasm-cleanups branch, reorganizing and updating the wasm-related components.
stephan [Thu, 11 Aug 2022 09:18:09 +0000 (09:18 +0000)] 
Merge in wasm-cleanups branch, reorganizing and updating the wasm-related components.

FossilOrigin-Name: c072594d3de3d6893c5d4a9d68439b84d043325f105b0d065575765a6e66c196

2 years agoFix another harmless comment typo that causes a typo in the documentation.
drh [Wed, 10 Aug 2022 18:40:43 +0000 (18:40 +0000)] 
Fix another harmless comment typo that causes a typo in the documentation.

FossilOrigin-Name: bb084adb53386d8e52ca1e818a8322d2ec641b73fd8568cee01cc74c0ee9f265

2 years agoRemove (harmless) duplicate words in comments used to generate parts of the
drh [Wed, 10 Aug 2022 18:33:57 +0000 (18:33 +0000)] 
Remove (harmless) duplicate words in comments used to generate parts of the
documentation.  [forum:/forumpost/54abbe9ccd|forum post 54abbe9ccd]

FossilOrigin-Name: b5e4f0db09ff7790862357df3c6fd38a2dcdfc82ff51b9f0d9470517648c844d

2 years agoFix handling of columns with names that are SQL keywords in the ".expert" command.
dan [Wed, 10 Aug 2022 15:29:21 +0000 (15:29 +0000)] 
Fix handling of columns with names that are SQL keywords in the ".expert" command.

FossilOrigin-Name: 5e1b8221c385deb04a3ff5aafb2e9fc55aecc6ffc68328674e3afe56c4273e29

2 years agowasm opfs: error handling fix for an impossible-to-reach error case. Minor cosmetic... wasm-cleanups
stephan [Wed, 10 Aug 2022 13:22:44 +0000 (13:22 +0000)] 
wasm opfs: error handling fix for an impossible-to-reach error case. Minor cosmetic tweaks in the wasm JSON enum.

FossilOrigin-Name: 683a3b937e608a5ecaf7f63f054e8a63179d67c8b2348bf843e5e68f27a369f5

2 years agowasm refactoring part 2 of (apparently) 2: moved ext/fiddle/... into ext/wasm and...
stephan [Wed, 10 Aug 2022 11:26:08 +0000 (11:26 +0000)] 
wasm refactoring part 2 of (apparently) 2: moved ext/fiddle/... into ext/wasm and restructured the core API-related parts of the JS/WASM considerably.

FossilOrigin-Name: 27f9da4eaaff39d1d58e9ffef7ddccf1e41b3726914f754b920e3e1fb572cba6

2 years agowasm/fiddle refactoring part 1 of N: move fiddle app from ext/fiddle to ext/wasm...
stephan [Wed, 10 Aug 2022 09:36:10 +0000 (09:36 +0000)] 
wasm/fiddle refactoring part 1 of N: move fiddle app from ext/fiddle to ext/wasm/fiddle, which only contains files intended to be pushed to the live site. Disabled build of the non-fiddle wasm parts, pending a later step of the refactoring.

FossilOrigin-Name: fb4eb93080288b60815be14afd7ddbbca470ce363fa3735352ea9a558fef583e

2 years agoMerged in trunk for pending tree refactoring.
stephan [Wed, 10 Aug 2022 07:58:57 +0000 (07:58 +0000)] 
Merged in trunk for pending tree refactoring.

FossilOrigin-Name: c3a3cb0103126210692bbeb703e7b8793974042e1fc2473be6d0a0d9b07d5770

2 years agoAllow the name of an index to collide with a table in a different schema.
drh [Tue, 9 Aug 2022 16:13:21 +0000 (16:13 +0000)] 
Allow the name of an index to collide with a table in a different schema.

FossilOrigin-Name: f963c2523872b59b8a7a14971f703f2eb0d021501b288597a958f6596885d0de

2 years agoOmit the (undocumented) SQLITE_PCACHE_SEPARATE_HEADER compile-time option.
drh [Tue, 9 Aug 2022 14:28:54 +0000 (14:28 +0000)] 
Omit the (undocumented) SQLITE_PCACHE_SEPARATE_HEADER compile-time option.

FossilOrigin-Name: 60947da687d525e72e62bcddcdf4c5c819818855074cc318c9ee656e83897aef

2 years agoAvoid some cases of signed integer overflow in fts5 by casting to unsigned values.
dan [Mon, 8 Aug 2022 19:29:53 +0000 (19:29 +0000)] 
Avoid some cases of signed integer overflow in fts5 by casting to unsigned values.

FossilOrigin-Name: 46a78c8c0ed518c4521e6e0bdebeb065bab07076abc444775002e7f4361d2242

2 years agoAvoid trying to cast an over-sized floating point value into an integer.
drh [Mon, 8 Aug 2022 16:25:13 +0000 (16:25 +0000)] 
Avoid trying to cast an over-sized floating point value into an integer.

FossilOrigin-Name: 3518cd7cb1feeefc3963da72c2d258d81d8914f1e1f427da28a00b6228cf126c

2 years agoRemove an unreachable branch in the numericType() helper routine.
drh [Mon, 8 Aug 2022 13:04:08 +0000 (13:04 +0000)] 
Remove an unreachable branch in the numericType() helper routine.

FossilOrigin-Name: a99cc008e46ab1a4fdbe2fa87202d026a10c57be55e3e9fedd935795ed6dc694

2 years agoDo not attempt to convert an oversized floating point value into an integer.
drh [Mon, 8 Aug 2022 12:19:13 +0000 (12:19 +0000)] 
Do not attempt to convert an oversized floating point value into an integer.

FossilOrigin-Name: 6c4fc8385ee22516e0b87fb647327ee7d1a564040ebe2a4d66fc999ef2908df2