]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoMerge the 3.40.1 changes into the reuse-schema branch. reuse-schema-3.40
drh [Wed, 28 Dec 2022 14:55:11 +0000 (14:55 +0000)] 
Merge the 3.40.1 changes into the reuse-schema branch.

FossilOrigin-Name: 126c68bd15dd7d26af7a584f28fc4ff82c591154aa6828e0021815e46e7f2809

2 years agoVersion 3.40.1 version-3.40.1
drh [Wed, 28 Dec 2022 14:03:47 +0000 (14:03 +0000)] 
Version 3.40.1

FossilOrigin-Name: df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24

2 years agoFix a broken assert() in fts5.
dan [Tue, 27 Dec 2022 14:14:56 +0000 (14:14 +0000)] 
Fix a broken assert() in fts5.

FossilOrigin-Name: ff1d456161e57314b0bb4e2e720eb1cd00f71b4bf4c459fad9fef4f11d38c19f

2 years agoFix a faulty assert() in fts5.
dan [Tue, 27 Dec 2022 14:12:03 +0000 (14:12 +0000)] 
Fix a faulty assert() in fts5.

FossilOrigin-Name: 4acff807c68cf9751f5958bf8efac73ac2fe3d82d5efd62f1517796d05032075

2 years agoFix an assert() in fts5. Simplify memdb xLock/xUnlock some.
dan [Tue, 27 Dec 2022 14:11:22 +0000 (14:11 +0000)] 
Fix an assert() in fts5. Simplify memdb xLock/xUnlock some.

FossilOrigin-Name: 43079c5246d4cee11239f4ec375a5159d5bf458c5add126c1a068f8278d432a1

2 years agoFix a missing 0 at the end of an integer literal in the MEMSYS5 fix.
drh [Tue, 27 Dec 2022 14:06:13 +0000 (14:06 +0000)] 
Fix a missing 0 at the end of an integer literal in the MEMSYS5 fix.

FossilOrigin-Name: e3bc10e8a8d944d57a4bc15e7a2839af6b17cc7bc553f00fb86e4757150ed47c

2 years agoFix minor problems in test scripts where.test and recover1.test.
dan [Tue, 27 Dec 2022 11:53:28 +0000 (11:53 +0000)] 
Fix minor problems in test scripts where.test and recover1.test.

FossilOrigin-Name: 64588bd5da228026da8d2ba679625f36802f19944e00db79c832884ef4e429cd

2 years agoFix an unsafe use of sqlite3_mprintf() in sqlite3_overload_function() identified...
drh [Mon, 26 Dec 2022 17:09:43 +0000 (17:09 +0000)] 
Fix an unsafe use of sqlite3_mprintf() in sqlite3_overload_function() identified by forum post: [https://sqlite.org/forum/forumpost/95b338860d].

FossilOrigin-Name: a31522261921a75c59d84448dab50896ba2a6e8a8e106c38b523081f78e5e22d

2 years agoPrevent the sessions rebaser from generating changesets containing UPDATE records...
drh [Mon, 26 Dec 2022 17:02:15 +0000 (17:02 +0000)] 
Prevent the sessions rebaser from generating changesets containing UPDATE records for which non-PK fields are present in the old.* but not the new.* record. Also update the changeset iterator to work around such changesets.

FossilOrigin-Name: 629dbe254346dc0b78025bb73def853bd725201244baa35cf169cf425930e184

2 years agoIn the unix backend, when implementing the defenses against small file
drh [Mon, 26 Dec 2022 16:54:15 +0000 (16:54 +0000)] 
In the unix backend, when implementing the defenses against small file
descriptors, delete a file just created if it was opened with
O_EXCL|O_CREAT so that it can be created again the next time through the
loop.  Fix for the problem described by
[forum:/forumpost/699af709ab3a8ccf|forum post 699af709ab3a8ccf].

FossilOrigin-Name: 174acf3284434adb8b6c643c85c059fdf5ea5e24e95852834251ea3b3c3d1a4d

2 years agoFix an over-zealous assert() reported by Yong Heng.
drh [Mon, 26 Dec 2022 16:45:44 +0000 (16:45 +0000)] 
Fix an over-zealous assert() reported by Yong Heng.

FossilOrigin-Name: 1e9dbb5a1bcbf66acc1073e23791d1eb804af207de9bd08f4f7425cd3ff2e5c6

2 years agoEnsure the RETURNING clause is honoured when a row of a temp table is updated by...
drh [Mon, 26 Dec 2022 16:24:52 +0000 (16:24 +0000)] 
Ensure the RETURNING clause is honoured when a row of a temp table is updated by an ON CONFLICT clause.

FossilOrigin-Name: ac9568cf87efe5e52cef030c0336761134253acb25f7e5343ccefaf526c96b41

2 years agoAdd the SQLITE_FCNTL_RESET_CACHE verb. Use it to ensure that the page cache is purged...
drh [Mon, 26 Dec 2022 16:12:40 +0000 (16:12 +0000)] 
Add the SQLITE_FCNTL_RESET_CACHE verb. Use it to ensure that the page cache is purged before and after a the recovery extension is run.

FossilOrigin-Name: 71dd920f92457a30aff21665de5d6b8fcdcb06119022bb8fd950960c2e041216

2 years agoFix corner cases in UTF8 handling in the REGEXP extension.
drh [Mon, 26 Dec 2022 16:03:34 +0000 (16:03 +0000)] 
Fix corner cases in UTF8 handling in the REGEXP extension.
[forum:/forumpost/3ffe058b04|Forum post 3ffe058b04].

FossilOrigin-Name: 93e68b398329dcdd25758065c5f45b0e8c43368ab7a034201a244c7b3ac5b3dd

2 years agoFix a off-by-one error in code generation that comes up when
drh [Mon, 26 Dec 2022 15:55:10 +0000 (15:55 +0000)] 
Fix a off-by-one error in code generation that comes up when
doing a DISTINCT query against a virtual table with an OR term in the
WHERE clause and where the ORDER BY clause has 64 or more references to
the result set.  [forum:/forumpost/dfe8084751|Forum post dfe8084751].
The error is harmless in production builds, but might cause an assertion
fault in a debugging build.

FossilOrigin-Name: cbcd7d9be5e5fa6c55fa53a868ff07ee2c1725fc27c57a4bb390072e369b2be4

2 years agoFix safe mode authorizer callback to reject disallowed UDFs. Reported at [forum:...
drh [Mon, 26 Dec 2022 15:44:50 +0000 (15:44 +0000)] 
Fix safe mode authorizer callback to reject disallowed UDFs. Reported at [forum:/forumpost/07beac8056151b2f|Forum post 07beac8056151b2f].

FossilOrigin-Name: 70964b8a1cfe8e47bac399db840afda9c35e36d62f1933744f49011e94a2343e

2 years agoFix an infinite loop in the MEMSYS5 auxiliary memory allocator that occurs
drh [Mon, 26 Dec 2022 15:21:42 +0000 (15:21 +0000)] 
Fix an infinite loop in the MEMSYS5 auxiliary memory allocator that occurs
for memory allocations between 1GiB and 2GiB in size.  Error introduced
by check-in [949133231f8f751a].  The problem only affects builds that
include the SQLITE_ENABLE_MEMSYS5 compile-time option.

FossilOrigin-Name: c10d40ca683941be71f3be59b4251cf326a90a24e893169c744ade944dce3ee0

2 years agoFix a problem in the memdb vfs xLock() function allowing clients to upgrade to EXCLUS...
drh [Mon, 5 Dec 2022 14:23:06 +0000 (14:23 +0000)] 
Fix a problem in the memdb vfs xLock() function allowing clients to upgrade to EXCLUSIVE locks when other connections are holding SHARED.

FossilOrigin-Name: d18cce37b5b73bb2a4f28eb1b55eb2c3ffe1fc23c921c13170af3d74a549f48e

2 years agoRegenerate the configure script so that it includes the correct patch number.
drh [Mon, 5 Dec 2022 14:20:57 +0000 (14:20 +0000)] 
Regenerate the configure script so that it includes the correct patch number.

FossilOrigin-Name: e2ae2ea195593f142e4a0c23b7d18381efcaa4114b1de04a97543ac264cd527e

2 years agoFix the error message in the CLI for "no such VFS".
drh [Tue, 22 Nov 2022 18:24:59 +0000 (18:24 +0000)] 
Fix the error message in the CLI for "no such VFS".
[forum:/info/1217fdd6b3|Forum post 1217fdd6b3].

FossilOrigin-Name: b344f33d16213cd8861903b9e3e8efe9b4aaf36e742006e32b67b8ff4d5f8b7d

2 years agoBump the version number to 3.40.1.
drh [Tue, 22 Nov 2022 15:48:02 +0000 (15:48 +0000)] 
Bump the version number to 3.40.1.

FossilOrigin-Name: d0ca348b25ce0e597054920c2124ad5965c11b58280b8fd83f1a115b557ca907

2 years agoFix last function pointer in sqlite3Apis init. Reported at
drh [Tue, 22 Nov 2022 15:47:09 +0000 (15:47 +0000)] 
Fix last function pointer in sqlite3Apis init. Reported at
[forum:/info/eba0faa96d|forum post eba0faa96d].

FossilOrigin-Name: b3795d28fe607d0e74ff120788a0db2fa76a6ce819b65ba042cc1ba00fd070a8

2 years agoMerge version 3.40.0 into the reuse-schema branch.
drh [Wed, 16 Nov 2022 16:14:31 +0000 (16:14 +0000)] 
Merge version 3.40.0 into the reuse-schema branch.

FossilOrigin-Name: 2aec00a7294762b3f7e8138ea1686eda4a1b02e940ec39f261651b61b87fabad

2 years agoVersion 3.40.0 version-3.40.0
drh [Wed, 16 Nov 2022 12:10:08 +0000 (12:10 +0000)] 
Version 3.40.0

FossilOrigin-Name: 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318

2 years agoPrevious change to the fake_big_file command in the test harness was not
drh [Mon, 14 Nov 2022 19:42:01 +0000 (19:42 +0000)] 
Previous change to the fake_big_file command in the test harness was not
correct.  This one should fix the problem.

FossilOrigin-Name: 6ee57a2e4e3399481100c40da0229d2d33cbe3290016185c8a60839d14b209f6

2 years agoChange the fake_big_file test command so that it fails for files larger than
drh [Mon, 14 Nov 2022 18:57:21 +0000 (18:57 +0000)] 
Change the fake_big_file test command so that it fails for files larger than
2MB on Windows, as we have observed that Window10 will sometimes bluescreen
when operating on very large sparse files.

FossilOrigin-Name: d39ffd2abadcc85c46ba17612f9f575005b4818e18bf39362b8ee574837cfad9

2 years agoAvoid running bigsort.test with SQLITE_DEBUG builds. The assert() statements added...
dan [Mon, 14 Nov 2022 17:48:26 +0000 (17:48 +0000)] 
Avoid running bigsort.test with SQLITE_DEBUG builds. The assert() statements added in [7c96a56] make it too slow.

FossilOrigin-Name: fa68dd8928c76888d535e649794743eeefd3abe0f909792a128955710bfc948a

2 years agoMerge the 3.40.0 rc1 changes into the reuse-schema branch.
drh [Mon, 14 Nov 2022 13:41:22 +0000 (13:41 +0000)] 
Merge the 3.40.0 rc1 changes into the reuse-schema branch.

FossilOrigin-Name: 886788b61e227a5e821eb92e01aaeaf19b2e9412408a9c1a351c85546452a807

2 years agoRemove some outdated code comments. No code changes.
stephan [Sun, 13 Nov 2022 19:29:51 +0000 (19:29 +0000)] 
Remove some outdated code comments. No code changes.

FossilOrigin-Name: 80ff592a9d0157bfa8bd1f9959c3aa26cab0ec16fdccf7b58a7523b8912c1a8c

2 years agoDisable the ability to change the schema_version cookie when
drh [Sat, 12 Nov 2022 17:17:01 +0000 (17:17 +0000)] 
Disable the ability to change the schema_version cookie when
SQLITE_DBCONFIG_DEFENSIVE mode is enabled.  This is a security
enhancement inspired by the question in
[forum:/forumpost/2b9cc3dae1f1e5f6|forum post 2b9cc3dae1f1e5f6].

FossilOrigin-Name: 1d81381e8f5db5d7064cc313b8544ca3cb1ca9e8cd61e71368a2d2e598befc9c

2 years agoRemove unnecessary tabs in the ChaCha20 implementation.
drh [Thu, 10 Nov 2022 23:10:11 +0000 (23:10 +0000)] 
Remove unnecessary tabs in the ChaCha20 implementation.
[forum:/forumpost/0cdce5db8c|Forum post 0cdce5db8c].

FossilOrigin-Name: b7179efbdb2bdc878acec0abfe272821f7e0d7d9e5ef06cd7fd796ef295e54ab

2 years agoAutomatically relinquish implicitly-acquired OPFS file locks during VFS idle time...
stephan [Thu, 10 Nov 2022 13:22:35 +0000 (13:22 +0000)] 
Automatically relinquish implicitly-acquired OPFS file locks during VFS idle time in an attempt to help alleviate cross-tab locking contention like that described in [forum:58a377083cd24a|forum post 58a377083cd24a].

FossilOrigin-Name: 8daf24ff73dd9928057412e0e4c2e2b2e47e1dca66acfb6b07c846e8d97582cc

2 years agoRework automatically acquired OPFS locks to be released during idle time. This elimin... opfs-lock-without-xlock
stephan [Thu, 10 Nov 2022 13:14:30 +0000 (13:14 +0000)] 
Rework automatically acquired OPFS locks to be released during idle time. This eliminates the performance hit reported in [46304ba057707c].

FossilOrigin-Name: a7fe91afca473fe55c983bc81d214df4ef3699863c7423fa4b6b9cde23d6a3b4

2 years agoOPFS: if an op which needs a lock is called when no lock has been obtained, automatic...
stephan [Thu, 10 Nov 2022 11:35:10 +0000 (11:35 +0000)] 
OPFS: if an op which needs a lock is called when no lock has been obtained, automatically lock it at the start of the op and unlock it at the end of that op. This is an attempt to alleviate the cross-tab contention described in [forum post 58a377083cd24a|forum:58a377083cd24a] but it increases speedtest1 run time by approximately 4x. Perhaps auto-lock can be combined with the older idle-time-based auto-unlock to unlock such locks (but not those from xLock()) to improve this?

FossilOrigin-Name: 46304ba057707c3b072b6e7bb8c4af774f653aa5814099f0866cd87b2b73abeb

2 years agoBetter handle an error in the fts5 integrity-check code. dbsqlfuzz e87c62f9b67ea21aeb...
dan [Wed, 9 Nov 2022 11:17:57 +0000 (11:17 +0000)] 
Better handle an error in the fts5 integrity-check code. dbsqlfuzz e87c62f9b67ea21aebdc36ab71cab7cc3eda8dc3.

FossilOrigin-Name: ae43e97087a3207a5ca3ffae75fbe7a33c01f4a38ce0d1d7eed8591ae3083617

2 years agoAdditional defense against corrupt database files in dbdata.c.
drh [Wed, 9 Nov 2022 11:02:39 +0000 (11:02 +0000)] 
Additional defense against corrupt database files in dbdata.c.

FossilOrigin-Name: 2e70d1e5c9b2c9e068be3ccf8a6062edf7bdde2e46d60ba8ce54eda851af6008

2 years agoIncrease the precision of the nData parameter to the dbdataValue() routine
drh [Wed, 9 Nov 2022 10:17:25 +0000 (10:17 +0000)] 
Increase the precision of the nData parameter to the dbdataValue() routine
inside the sqlite_dbdata virtual table, to avoid the possibility of integer
overflow.

FossilOrigin-Name: 295447b44fc7658891352a9b3f792379b52a76ee5dcfd498b7028f5f87b40e9e

2 years agoFix a problem with URI formatting in calls to sqlite3rbu_vacuum(zDb, NULL) causing...
dan [Tue, 8 Nov 2022 20:04:05 +0000 (20:04 +0000)] 
Fix a problem with URI formatting in calls to sqlite3rbu_vacuum(zDb, NULL) causing problems on win32. First reported here <https://sqlite.org/forum/forumpost/a7ae915a9d>.

FossilOrigin-Name: 77ccc8ea8a901df64feabe08e1210087d060f0bc133242e87a94a71b68b5b5fa

2 years agoDo not attempt to run test script dbpagefault.test with SQLITE_OMIT_VIRTUALTABLE...
dan [Tue, 8 Nov 2022 19:36:26 +0000 (19:36 +0000)] 
Do not attempt to run test script dbpagefault.test with SQLITE_OMIT_VIRTUALTABLE builds.

FossilOrigin-Name: 901918c4867557e51160ef9c495e4e007de26cfe07c237addc00a388662957e8

2 years agoFix a problem in main.mk preventing the amalgamation-testfixture target from building.
dan [Tue, 8 Nov 2022 15:49:12 +0000 (15:49 +0000)] 
Fix a problem in main.mk preventing the amalgamation-testfixture target from building.

FossilOrigin-Name: ccf00a0e22a2a9815ff7db1c6c6457fce35aaf50843c1b5ff2adda22d6f70314

2 years agoFurther improvements to the handling of the u32 and u16 typedefs in the
drh [Mon, 7 Nov 2022 19:40:20 +0000 (19:40 +0000)] 
Further improvements to the handling of the u32 and u16 typedefs in the
shell.c source file.

FossilOrigin-Name: 55a19677d723147aeb2b4a86bbd01756ddeb2072cba72c3145ad32d335e203b0

2 years agoImprove the ability of mkshellc.tcl to remove redundant typedefs from the
drh [Mon, 7 Nov 2022 18:36:02 +0000 (18:36 +0000)] 
Improve the ability of mkshellc.tcl to remove redundant typedefs from the
generated shell.c code.  This is needed to get shell.c to build on older
C compilers.

FossilOrigin-Name: 3645585f37631d60cefab1d55cdb1ee060aae87317b9b158a01329ca8a4d3e1e

2 years agoUpdate this branch to match latest trunk changes.
dan [Mon, 7 Nov 2022 18:09:23 +0000 (18:09 +0000)] 
Update this branch to match latest trunk changes.

FossilOrigin-Name: 833f6374cc81a9b732bd852de6f98eef6c437f9fb18846e0022c6726324fab25

2 years agoAdd the sqlite3rbu_rename_handler() API. To override the default routine that RBU...
dan [Mon, 7 Nov 2022 18:00:18 +0000 (18:00 +0000)] 
Add the sqlite3rbu_rename_handler() API. To override the default routine that RBU uses to rename files.

FossilOrigin-Name: ebbb1f88e7b5d6cbe84d400f1a187acedb4c668d0b7e4c63bf1496e57da9b8ad

2 years agoMinor doc updates in speed-check.sh. No code changes.
stephan [Mon, 7 Nov 2022 17:21:53 +0000 (17:21 +0000)] 
Minor doc updates in speed-check.sh. No code changes.

FossilOrigin-Name: d2ed4116fbf1de3c840f84e05db6f29f7b489518ac07d56f61df153deab6bf6b

2 years agoFix an obsolete comment.
drh [Mon, 7 Nov 2022 15:23:51 +0000 (15:23 +0000)] 
Fix an obsolete comment.

FossilOrigin-Name: e377c0a1ef030395293c5f24d7cb8e5b36ce972e9fac31b99c8425075486a46a

2 years agoFix typo in comment.
drh [Mon, 7 Nov 2022 15:01:05 +0000 (15:01 +0000)] 
Fix typo in comment.

FossilOrigin-Name: c3b94d7d4697a5c3983253f6266c544d8037617778a09d491bc12eb13f08ac75

2 years agoAdd sqlite3.wasm.alloc.impl() as a "public back door" into the low-level non-throwing...
stephan [Mon, 7 Nov 2022 13:06:20 +0000 (13:06 +0000)] 
Add sqlite3.wasm.alloc.impl() as a "public back door" into the low-level non-throwing allocator. Correct sqlite3.WasmAllocError constructor to behave like its usages expect it to and add tests for that.

FossilOrigin-Name: cea8bf9a144d842c4755c3130273524926e8c4831d7f21c4e34d4e8c74109c8c

2 years agoFix requirements marks so that they match documentation corrections.
drh [Mon, 7 Nov 2022 12:21:06 +0000 (12:21 +0000)] 
Fix requirements marks so that they match documentation corrections.

FossilOrigin-Name: 10d6189d23133006b39ea230045a918483721dd48f5558f77e57e23693097d16

2 years agoMinor wasm doc touchups. No code changes.
stephan [Mon, 7 Nov 2022 12:12:27 +0000 (12:12 +0000)] 
Minor wasm doc touchups. No code changes.

FossilOrigin-Name: 2c448368913a844bdb5e69f8fa3bad91a2b6612ba3b7f3f650dd07b81db25a77

2 years agoFix the documentation regarding negative length parameters for
drh [Mon, 7 Nov 2022 11:19:28 +0000 (11:19 +0000)] 
Fix the documentation regarding negative length parameters for
sqlite3_result_text() interfaces, to point out that the length parameter
to sqlite3_result_text64() cannot be negative.
[forum:/forumpost/cf1d043b07|Forum post cf1d043b07].
Comment/documentation change only.

FossilOrigin-Name: 8016507651f377b08deb3a13cc559d56ce6e934c3073a8e63d05fd946b8403a4

2 years agoMake sure that the recoverStrlen() function (used internally by the new
drh [Mon, 7 Nov 2022 11:05:53 +0000 (11:05 +0000)] 
Make sure that the recoverStrlen() function (used internally by the new
recovery extension) is 64-bit safe.

FossilOrigin-Name: ea30a6bfc463acce26a4d710e7bf56519ad096ce2fe904ee7e199f5c55068034

2 years agoThe recoverAssertMutexHeld() function is for testing and verification only
drh [Sun, 6 Nov 2022 17:19:34 +0000 (17:19 +0000)] 
The recoverAssertMutexHeld() function is for testing and verification only
and should be a harmless no-op for production builds.
[forum/forumpost/b4f2c7d402|Forum post b4f2c7d402].

FossilOrigin-Name: d75504710c86af0037ac897106aadffe54955463195ee4dfb2cdfc81d396cbb4

2 years agoUpdate test file dbpagefault.test to account for the restriction on using SQLITE_VTAB...
dan [Sat, 5 Nov 2022 19:26:45 +0000 (19:26 +0000)] 
Update test file dbpagefault.test to account for the restriction on using SQLITE_VTAB_DIRECTONLY virtual tables from within triggers.

FossilOrigin-Name: 2b68fc8aa35cc69e4d2c26aaebbf3f2b1f1c08d15ca9efcbe5be21d45735d3f1

2 years agoFix harmless compiler warnings.
drh [Sat, 5 Nov 2022 17:52:41 +0000 (17:52 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: fe44e7ef5387328f62c61e4482dbf63c3d1a4408baf20f3719d0ad344a3c714b

2 years agoMerge the latest trunk enhancements into the reuse-schema branch.
drh [Sat, 5 Nov 2022 15:31:07 +0000 (15:31 +0000)] 
Merge the latest trunk enhancements into the reuse-schema branch.

FossilOrigin-Name: 224eaf2622ca0e0489d0d3feb20fb46082b866a98a216a84323c96a800618b60

2 years agoTweaks to recover module test scripts to work with various permutations.
dan [Fri, 4 Nov 2022 18:32:45 +0000 (18:32 +0000)] 
Tweaks to recover module test scripts to work with various permutations.

FossilOrigin-Name: 454c61e818f6941c9a23f6600e37828a3f2b2ad3c6dbc8d6223570aed5d9cd8b

2 years agoAnother test case fix for auto-vacuum builds.
dan [Fri, 4 Nov 2022 17:07:33 +0000 (17:07 +0000)] 
Another test case fix for auto-vacuum builds.

FossilOrigin-Name: c1c47eff48e0831b5aed987e90d797aee99caf1861fa8318c6c3ecfb108de7e6

2 years agoFixes to recover module test scripts so that they may be used with SQLITE_DEFAULT_AUT...
dan [Fri, 4 Nov 2022 16:39:39 +0000 (16:39 +0000)] 
Fixes to recover module test scripts so that they may be used with SQLITE_DEFAULT_AUTOVACUUM and SQLITE_SECURE_DELETE builds.

FossilOrigin-Name: 0e5597ce5353dea2cdb092b166b57ba1d60f8115eb468349f2b2869803691a2c

2 years agoFix Tcl tests so that they again build and run with SQLITE_OMIT_VIRTUALTABLE defined.
dan [Fri, 4 Nov 2022 15:17:14 +0000 (15:17 +0000)] 
Fix Tcl tests so that they again build and run with SQLITE_OMIT_VIRTUALTABLE defined.

FossilOrigin-Name: 06a9dbea40c8a0cdfae6b127a1ce1cba0547acdf1115c087e9b790a78c264b52

2 years agoRemove an unimportant testcase() macro that is no longer reachable due to the
drh [Fri, 4 Nov 2022 12:59:04 +0000 (12:59 +0000)] 
Remove an unimportant testcase() macro that is no longer reachable due to the
improvement in corruption detection.

FossilOrigin-Name: cd7e3568a9b0c0f5ef5ca8a29c55cefe2bbad2dbc88a3718a87bb24a8ada3b7f

2 years agoAdd another test case for the OP_Found fix.
dan [Fri, 4 Nov 2022 11:59:40 +0000 (11:59 +0000)] 
Add another test case for the OP_Found fix.

FossilOrigin-Name: 6cdd64a445fe16d547d7bf5ea26dad3ab6d9d5f7d1c2b49fdc9d7a2edaa031c6

2 years agoEnhance the ability of the OP_Found and similar opcodes to detect truncated
drh [Fri, 4 Nov 2022 11:54:42 +0000 (11:54 +0000)] 
Enhance the ability of the OP_Found and similar opcodes to detect truncated
index records and report SQLITE_CORRUPT.
dbsqlfuzz 2b12f90aeff8e081706c7e9b58834f04869f446c.  Test cases in TH3.

FossilOrigin-Name: 059a09da2c5fd9c7e723c713565fbaf71602079feef0704129cc5cbbd0033936

2 years agoCorrect sqlite3-wasm.c's SQLITE_DEFAULT_CACHE_SIZE (it's measured in kb, not bytes).
stephan [Fri, 4 Nov 2022 09:02:21 +0000 (09:02 +0000)] 
Correct sqlite3-wasm.c's SQLITE_DEFAULT_CACHE_SIZE (it's measured in kb, not bytes).

FossilOrigin-Name: 479ad980dfe509403e184e39a5aa441171e47b3297e05039f85516e72e9f15be

2 years agoAdd experimental esm target to ext/wasm/GNUmakefile to tell emcc to generate sqlite3...
stephan [Thu, 3 Nov 2022 22:51:20 +0000 (22:51 +0000)] 
Add experimental esm target to ext/wasm/GNUmakefile to tell emcc to generate sqlite3.mjs (ES6 module) instead of sqlite3.js. Related to discussion at [forum:ed4596cf8496a39b].

FossilOrigin-Name: e55d8eba83012492d85418dc0faedce5896027ecc70295a5ca1826f61a5edbaf

2 years agoGlobally replace '' with "" for empty JS strings to please C preprocessor.
stephan [Thu, 3 Nov 2022 21:21:10 +0000 (21:21 +0000)] 
Globally replace '' with "" for empty JS strings to please C preprocessor.

FossilOrigin-Name: e92e1f42bef94a1df29f66b4111ebfde93eba3759bc5d5a9c95f714508851346

2 years agoMinor build cleanups and fix a harmless race condition in the OPFS part of tester1.js.
stephan [Wed, 2 Nov 2022 14:08:59 +0000 (14:08 +0000)] 
Minor build cleanups and fix a harmless race condition in the OPFS part of tester1.js.

FossilOrigin-Name: 70ee6ee014bc4e2c1daa9b4a8909cf76ccecf32de1eb39055f20d3d0b1daa1bd

2 years agoClarify documentation regarding the --recovery-db option to ".recover" and
drh [Wed, 2 Nov 2022 14:08:26 +0000 (14:08 +0000)] 
Clarify documentation regarding the --recovery-db option to ".recover" and
the magic 789 configuration option it is associated with.

FossilOrigin-Name: f6fa0cffa921ccde8910e7fa4a63c2e4ef8ddb376c8ce99e436b27ac332c4498

2 years agoMinor improvements to API documentation in comments for the recovery
drh [Wed, 2 Nov 2022 13:09:14 +0000 (13:09 +0000)] 
Minor improvements to API documentation in comments for the recovery
extension.

FossilOrigin-Name: ed1c3515ad6a988e07a8b4583fbc38be257e6eae7443b01a242b98207ce78162

2 years agoAdd sqlite3_wasm_vfs_create_file() to replace Emscripten's FS.createDataFile() in...
stephan [Wed, 2 Nov 2022 11:53:31 +0000 (11:53 +0000)] 
Add sqlite3_wasm_vfs_create_file() to replace Emscripten's FS.createDataFile() in a (mostly) VFS-agnostic way. Add a test for worker1's export (to bytearray) support. Re-add worker1 open-from-bytearray using sqlite3_wasm_vfs_create_file() but it's untested (requires a new interactive test app or maybe reconsideration).

FossilOrigin-Name: b35e1225c91a3cadc0d25af1e4e790237256d194990faa13190e343ed03e11c5

2 years agoEmcc seems confused by SQLITE_DEBUG, for reasons unknown. Use NDEBUG instead
drh [Wed, 2 Nov 2022 11:25:33 +0000 (11:25 +0000)] 
Emcc seems confused by SQLITE_DEBUG, for reasons unknown.  Use NDEBUG instead
to simplify the #ifdef logic in sqlite3recover.c.

FossilOrigin-Name: 2610779ac84ac4a1a6901b6244653faf0c49ac6f0a4710a19aaf2a13106ae742

2 years agoFix a symbol name typo which broke and exception-handling case in OPFS xOpen().
stephan [Wed, 2 Nov 2022 08:49:05 +0000 (08:49 +0000)] 
Fix a symbol name typo which broke and exception-handling case in OPFS xOpen().

FossilOrigin-Name: 5bc83d569594e104e90b1acef1a5fd23655b2089de393a6776e799fdef2082f5

2 years agoFix a missing symbol in non-SQLITE_DEBUG builds.
stephan [Wed, 2 Nov 2022 08:10:22 +0000 (08:10 +0000)] 
Fix a missing symbol in non-SQLITE_DEBUG builds.

FossilOrigin-Name: 17cdcad627205cdc8ae8114df44ad2a44e59603200efb238fbbb5c30ea0a453e

2 years agoFix a harmless compiler warning.
drh [Tue, 1 Nov 2022 21:42:50 +0000 (21:42 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 663a89164fdd43529a13cab4b9d9f04fe519e7c6b954f9c91e32e4d7ae25eb46

2 years agoInstead of (const char*), use a special type - sqlite3_filename - as the filename...
dan [Tue, 1 Nov 2022 19:35:54 +0000 (19:35 +0000)] 
Instead of (const char*), use a special type - sqlite3_filename - as the filename argument passed to VFS method xOpen().

FossilOrigin-Name: 90df04e5a25907e748227c484b601b7dbd87c037556a0e87f8423f529d08bb6b

2 years agoFix harmless compiler warnings. sqlite3_filename
drh [Tue, 1 Nov 2022 18:56:39 +0000 (18:56 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: de829770aa0f59b4cd3ab1dc5eec90be82663dca3199c2cf6d97f4c41ce9f799

2 years agoInstead of (const char*), use a special type - sqlite3_filename - as the filename...
dan [Tue, 1 Nov 2022 17:43:19 +0000 (17:43 +0000)] 
Instead of (const char*), use a special type - sqlite3_filename - as the filename argument passed to VFS method xOpen().

FossilOrigin-Name: bd1fe4de8a2e8b8de19a7f90b9fdafb641ad11a6f0c96c0b4495d5bf80885675

2 years agoFix compilation errors in the recover API seen with MSVC.
mistachkin [Tue, 1 Nov 2022 14:13:05 +0000 (14:13 +0000)] 
Fix compilation errors in the recover API seen with MSVC.

FossilOrigin-Name: 78d17c4fedc1629bf161f9858f2b8bf35506155ccaa0acc084b419d244d4f75d

2 years agoFix a #ifdef involving SQLITE_OS_KV that was adding code unnecessarily.
drh [Tue, 1 Nov 2022 13:12:20 +0000 (13:12 +0000)] 
Fix a #ifdef involving SQLITE_OS_KV that was adding code unnecessarily.

FossilOrigin-Name: b6c1b6e4a3bc21c40d6faca6f70842df5201f21c96a076a895410660630461c0

2 years agoEnforce affinity on materialized tables for subqueries and views. Also,
drh [Tue, 1 Nov 2022 12:10:39 +0000 (12:10 +0000)] 
Enforce affinity on materialized tables for subqueries and views.  Also,
do not allow UNION ALL flattening if the affinity of a result column varies
between different arms of the compound.  This is a fix for
ticket [57c47526c34f01e8].

FossilOrigin-Name: 88a05141c28e5ff1357c3c599493e4ffb8f3821bab04be80244deac62e49135c

2 years agoImprovements to comments. Change the "optimization_control" TCL command tkt-57c47526
drh [Tue, 1 Nov 2022 12:01:10 +0000 (12:01 +0000)] 
Improvements to comments.  Change the "optimization_control" TCL command
in the test harness so that it returns the new optimization mask, for
verification.

FossilOrigin-Name: a3a500127d4752ee05c183e9ac97a2bc27768bf7063b04b5c1405cd3fd3931f5

2 years agoMinor internal cleanups in the js pieces.
stephan [Tue, 1 Nov 2022 11:09:34 +0000 (11:09 +0000)] 
Minor internal cleanups in the js pieces.

FossilOrigin-Name: 271391b4e32220ab4c32d69f579ecd2b03eb99da898955a1ef8fffc27216719d

2 years agoSignificant cleanups and expansion of the sqlite3.opfs utilities. Add oo1.DB.dbVfsNam...
stephan [Tue, 1 Nov 2022 07:49:49 +0000 (07:49 +0000)] 
Significant cleanups and expansion of the sqlite3.opfs utilities. Add oo1.DB.dbVfsName(). Add VFS name to worker1:open's arguments and result.

FossilOrigin-Name: 86a341d7e061f946b39e8647ddd4743013b851b33ae9e6e755d8dbc53fba5286

2 years agoDo not flatten a UNION ALL subquery where the column affinities do not match
drh [Tue, 1 Nov 2022 01:07:29 +0000 (01:07 +0000)] 
Do not flatten a UNION ALL subquery where the column affinities do not match
on all arms.  Force that subquery to be materialized.

FossilOrigin-Name: 1b8a128832c1633cbb86999d347fef64ac45fe134dac61132112fc97f24676a0

2 years agoEnforce column affinity on the materialization of a subquery or view.
drh [Tue, 1 Nov 2022 00:52:22 +0000 (00:52 +0000)] 
Enforce column affinity on the materialization of a subquery or view.

FossilOrigin-Name: b6692de374d7f489d8cf8877bdfef19501bc5ecb0781d42750807eeb58f2e7cd

2 years agoMake the UPDATE method of the sqlite_dbpage virtual table rebust against
drh [Mon, 31 Oct 2022 18:01:05 +0000 (18:01 +0000)] 
Make the UPDATE method of the sqlite_dbpage virtual table rebust against
OOM errors.  [forum:/forumpost/bbcf0dd6ca|Forum post bbcf0dd6ca].  Test case
in TH3.

FossilOrigin-Name: d15c9a4a323b825eb80e706e12e9df95e5db458024f51e6e537940efc8234d8b

2 years agoWorker1: use a list, rather than a single slot, to manage the default db link so...
stephan [Mon, 31 Oct 2022 13:50:05 +0000 (13:50 +0000)] 
Worker1: use a list, rather than a single slot, to manage the default db link so that we can keep the least-recently-opened db as the default. Re-introduce worker1.export() but do not yet expose it until an equivalent import() (or open() option) is implemented.

FossilOrigin-Name: c7750c101d9b7baa31496731bc34ea0a9b2bad0c11e2b3e92a8c7b327135c1bb

2 years agoInternal tweaks to the OPFS VFS result codes.
stephan [Mon, 31 Oct 2022 11:53:34 +0000 (11:53 +0000)] 
Internal tweaks to the OPFS VFS result codes.

FossilOrigin-Name: 32e1a2d2eb8738ae1635e413829f6cf7f64c63d2a86b72940a573de89948e529

2 years agoAdd oo1.DB.exec() 'returnValue' option, which specifies what exec() should return...
stephan [Mon, 31 Oct 2022 11:09:14 +0000 (11:09 +0000)] 
Add oo1.DB.exec() 'returnValue' option, which specifies what exec() should return. Defaults to the db object and enables direct return of the result rows array or a list of the individual SQL statements. Other code-adjacent internal cleanups.

FossilOrigin-Name: 69d36a6aa5e2cd79d26c0fd3e0d20fe8838fd1be97db07725233bfff1dfe6643

2 years agoAvoid a segfault that could occur when running the recover API on a database handle...
dan [Mon, 31 Oct 2022 10:53:23 +0000 (10:53 +0000)] 
Avoid a segfault that could occur when running the recover API on a database handle with memory-mapping enabled.

FossilOrigin-Name: e02c697281a777c33070168af784b2d291397e488244a217620897f40aed7158

2 years agoExtra OOM check in shell_error_context() of the CLI.
drh [Mon, 31 Oct 2022 01:22:38 +0000 (01:22 +0000)] 
Extra OOM check in shell_error_context() of the CLI.
[forum:/forumpost/5708841db0|forum post 5708841db0].

FossilOrigin-Name: cb12ac5de17e677f089d7b0b46803efbd9a9178972ffb0454a8b557b06633658

2 years agoAdd oo1.DB.selectArray() and selectObject().
stephan [Sun, 30 Oct 2022 11:39:47 +0000 (11:39 +0000)] 
Add oo1.DB.selectArray() and selectObject().

FossilOrigin-Name: 7660db2a2e9c4f3a6a9343d6929744ad0f4be6820976411f9080165491da59b7

2 years agoAdjust automatic OPFS locking retries such that they will wait up to a total of 3...
stephan [Sun, 30 Oct 2022 10:24:53 +0000 (10:24 +0000)] 
Adjust automatic OPFS locking retries such that they will wait up to a total of 3 seconds spanning 4 attempts.

FossilOrigin-Name: bbce49d81abc491ca666474040a53057e26e99131fea9449de253f88f4415ded

2 years agoMinor WASM build cleanups. Enable custom Module.instantiateWasm() when not in WASMFS...
stephan [Sun, 30 Oct 2022 09:47:33 +0000 (09:47 +0000)] 
Minor WASM build cleanups. Enable custom Module.instantiateWasm() when not in WASMFS mode (where it doesn't work). Add sqlite3.debugModule URL param to enable some module-init-time debugging output.

FossilOrigin-Name: 50f678846a2b3c3d0818f0bae89f2ee86252a2e6a9c7029ebaae3953ca0fa14c

2 years agoReduce wasm module's starting memory from 128mb to 16mb. The latter value is needed...
stephan [Sun, 30 Oct 2022 08:39:18 +0000 (08:39 +0000)] 
Reduce wasm module's starting memory from 128mb to 16mb. The latter value is needed only for WASMFS-based batch-runner.js, as WASMFS builds cannot be configured for dynamic memory growth without a tremendous performance hit.

FossilOrigin-Name: ed9d93c48752ba6e18edc1238a8ccdbf6bb65c74fb52a89d515f8b0ab6bea13a

2 years agoMinor updates to the Windows batch tools.
mistachkin [Sun, 30 Oct 2022 07:01:31 +0000 (07:01 +0000)] 
Minor updates to the Windows batch tools.

FossilOrigin-Name: b42f56205fa8e06431fb1a45c48257d93605fea0ed95bd766f71e27292d1af33

2 years agoUpdate ext/wasm/README.md for recent developments.
stephan [Sat, 29 Oct 2022 12:31:50 +0000 (12:31 +0000)] 
Update ext/wasm/README.md for recent developments.

FossilOrigin-Name: c76ec31ebf4d80ec8cbd2aa2017e1d6bc32eae66bfbcc130c053ddb403599c6b

2 years agoMore styling of module-symbols.html.
stephan [Sat, 29 Oct 2022 10:14:56 +0000 (10:14 +0000)] 
More styling of module-symbols.html.

FossilOrigin-Name: a36f42a8364b745c410a6f837d005a193f6a93134cac087ac18bee2897cad730

2 years agoExpand and document the wasm doc-update make rules. Extend the dist rules to fail...
stephan [Sat, 29 Oct 2022 09:45:01 +0000 (09:45 +0000)] 
Expand and document the wasm doc-update make rules. Extend the dist rules to fail more readily if there's a problem.

FossilOrigin-Name: 362ec11ec09f441b745cbd8ac8366b6bc998aba6e2b70782a88f189a3ffa9923

2 years agoMove the sqlite3.capi.wasm namespace to sqlite3.wasm. This causes a tiny bit of namin...
stephan [Sat, 29 Oct 2022 07:54:10 +0000 (07:54 +0000)] 
Move the sqlite3.capi.wasm namespace to sqlite3.wasm. This causes a tiny bit of naming confusion with the sqlite3.wasm *file*, but seems to make more sense than having it as a sub-namespace of capi.

FossilOrigin-Name: 3f16eb18d6186ca972fca952ccac18649e7a905213f589e53c0c9333e695448d