]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
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

2 years agoFix harmless compiler warnings in testing code.
drh [Fri, 28 Oct 2022 18:52:05 +0000 (18:52 +0000)] 
Fix harmless compiler warnings in testing code.

FossilOrigin-Name: 2f53612388507f9b1ecbec3c15281825beab54b8062d97d0ab6f009c5fed347b

2 years agoAdd sqlite3recover() support to fuzzcheck.
drh [Fri, 28 Oct 2022 18:35:06 +0000 (18:35 +0000)] 
Add sqlite3recover() support to fuzzcheck.

FossilOrigin-Name: e65c5bdc5bd6e1989c3de59798ff0a761125fc490fdec8c7671ca70ed688c4f8

2 years agoRemove sqlite3_interrupt() from the WASM build, as it is essentially impossible to...
stephan [Fri, 28 Oct 2022 14:33:50 +0000 (14:33 +0000)] 
Remove sqlite3_interrupt() from the WASM build, as it is essentially impossible to employ in JS's threading model.

FossilOrigin-Name: e85387590061edbb6cdc04de792ab86f43afaa5c8d1b0792206cb5b481c7d76a

2 years agoAdd ext/wasm/module-symbols.html. Adjacent minor JS touchups.
stephan [Fri, 28 Oct 2022 11:40:46 +0000 (11:40 +0000)] 
Add ext/wasm/module-symbols.html. Adjacent minor JS touchups.

FossilOrigin-Name: 24f12e681e06e3b71a6ac9c82255fe0270953a74c711405841f7e385eeafe874

2 years agoMinor sqlite3.oo1 API reorg prompted by documenting.
stephan [Fri, 28 Oct 2022 10:36:18 +0000 (10:36 +0000)] 
Minor sqlite3.oo1 API reorg prompted by documenting.

FossilOrigin-Name: 55237924ca363c5a3e0f8c82620eb6626a98311615866197375a86876b9da3a1

2 years agoFix a minor problem with sqlite_dbdata.
drh [Thu, 27 Oct 2022 23:17:49 +0000 (23:17 +0000)] 
Fix a minor problem with sqlite_dbdata.

FossilOrigin-Name: 58c2e49279c8f77f006b0c2ce351776bc711633f9c1a39c7a37969838d49ec0b

2 years agoFix another crash in the recover extension triggered by a corrupt database.
dan [Thu, 27 Oct 2022 20:27:45 +0000 (20:27 +0000)] 
Fix another crash in the recover extension triggered by a corrupt database.

FossilOrigin-Name: d125377378916fb3147612a536fde15ee955176eea9ea6eaa4a2ee5f1e8e1cbe

2 years agoFix another problem to do with recovering from in-memory databases.
dan [Thu, 27 Oct 2022 19:06:42 +0000 (19:06 +0000)] 
Fix another problem to do with recovering from in-memory databases.

FossilOrigin-Name: 5a7bfd4a217cd80882a1827674b479cdc547419a785e06e0ee82cb8cfca42701

2 years agoEnsure that the VFS wrapper in the recover extension does not attempt to invoke undef...
dan [Thu, 27 Oct 2022 19:02:51 +0000 (19:02 +0000)] 
Ensure that the VFS wrapper in the recover extension does not attempt to invoke undefined methods on the underlying VFS.

FossilOrigin-Name: 347c575108bc8112613a02afda1247bdbed24c15def7eb412d0b27aba047715b

2 years agoFix an assert() failure in the recover extension triggered by a zero value as the...
dan [Thu, 27 Oct 2022 18:35:09 +0000 (18:35 +0000)] 
Fix an assert() failure in the recover extension triggered by a zero value as the first page-number in an overflow page chain.

FossilOrigin-Name: 44c0874c33e76ce708022e5c38c74f75565a8cea9f4c5b067cc0a54079aeee20

2 years agoIn the CLI, ensure that input to utf8_width_print is not NULL, or if it is,
drh [Thu, 27 Oct 2022 18:20:08 +0000 (18:20 +0000)] 
In the CLI, ensure that input to utf8_width_print is not NULL, or if it is,
change it to an empty string.  For for the problem reported by
[forum:/forumpost/2961cf13eec61876|forum post 2961cf13eec61876].

FossilOrigin-Name: 9ecc9d25ea62a7777bbf621989a5c577b612784121a20465cda4d4023fa9634d

2 years agoChange the name of the ".recover" command option "--freelist-corrupt" to "--ignore...
dan [Thu, 27 Oct 2022 18:19:45 +0000 (18:19 +0000)] 
Change the name of the ".recover" command option "--freelist-corrupt" to "--ignore-freelist".

FossilOrigin-Name: afce8443ace57c3c99c6810be98f05ed716ae504b68098726c869843c643bbf0

2 years agospeedtest1.html: when vfs==kvvfs, increase --size from 2 to 4, as enabled by [a4d40f6...
stephan [Thu, 27 Oct 2022 14:41:38 +0000 (14:41 +0000)] 
speedtest1.html: when vfs==kvvfs, increase --size from 2 to 4, as enabled by [a4d40f6346e7]. --size 5 is 4.96mb out of (supposedly) 5mb, which works but is a bit too close to the edge.

FossilOrigin-Name: a608d584a8a68ebaf8566cffc9c33f59309b710e7b29229a15bef529702f35d5

2 years agoAutomatically set temp_store=MEMORY if the VFS is kvvfs.
drh [Thu, 27 Oct 2022 14:28:15 +0000 (14:28 +0000)] 
Automatically set temp_store=MEMORY if the VFS is kvvfs.

FossilOrigin-Name: a4d40f6346e7eb2a5239684dba86f297358122768a4d4bf6786b6028f4300e04

2 years agoDo not accept a NULL pointer for the filename in KVVFS.
drh [Thu, 27 Oct 2022 14:00:21 +0000 (14:00 +0000)] 
Do not accept a NULL pointer for the filename in KVVFS.

FossilOrigin-Name: fdecbd3b5bcdeb358015f461ac6c863f12ab180ab4624ed50734e41e557d8186

2 years agoThe kvvfs VFS should remember the page size when writing to the database.
drh [Thu, 27 Oct 2022 12:46:17 +0000 (12:46 +0000)] 
The kvvfs VFS should remember the page size when writing to the database.

FossilOrigin-Name: fc5503c8acb085042e877c9de43256a4fee27f63ab35e2ddad18e40734ed00d4

2 years agoRe-enable the .recovery and .dbinfo commands in shell.c.in in the fiddle build, as...
stephan [Thu, 27 Oct 2022 11:32:20 +0000 (11:32 +0000)] 
Re-enable the .recovery and .dbinfo commands in shell.c.in in the fiddle build, as those were fixed by [3d20d77a3511] and [cd0aa27d1732].

FossilOrigin-Name: ba3a7a4a9997f62b78467d78d95fa5b58a03ecb2e2ccb68f4d316fc08fd02f86

2 years agoDo not use sqlite3_result_text16() in the recover extension if SQLITE_OMIT_UTF16...
dan [Thu, 27 Oct 2022 11:25:08 +0000 (11:25 +0000)] 
Do not use sqlite3_result_text16() in the recover extension if SQLITE_OMIT_UTF16 is defined.

FossilOrigin-Name: 3d20d77a3511bb223474da8491e1da8aec098c41c1b81ab78ff80fbd37d5b568

2 years agoFix a problem with running ".recover" on an in-memory database.
dan [Thu, 27 Oct 2022 11:12:54 +0000 (11:12 +0000)] 
Fix a problem with running ".recover" on an in-memory database.

FossilOrigin-Name: 87b4cca2b84845cee603d40fbf16c9635d6dc2d19d2f37ae86abfeff716c9a85

2 years agoDo not use sqlite3_mutex_xxx() functions in sqlite3recover.c when built with SQLITE_T...
dan [Thu, 27 Oct 2022 10:51:49 +0000 (10:51 +0000)] 
Do not use sqlite3_mutex_xxx() functions in sqlite3recover.c when built with SQLITE_THREADSAFE=0.

FossilOrigin-Name: cd0aa27d1732abc61c8a8440118ff629f7dca185d2f515ce1f6090c49d8dc890

2 years agoMinor doc typo fixes.
stephan [Thu, 27 Oct 2022 03:57:48 +0000 (03:57 +0000)] 
Minor doc typo fixes.

FossilOrigin-Name: ed8d3f25a4d6ac04d9f7918c791d8d2c6f23ce846278ca63f8fbadb7ea27369f

2 years agoRestructure and simplify the feature-detection #defines of the recovery support in...
stephan [Thu, 27 Oct 2022 03:56:01 +0000 (03:56 +0000)] 
Restructure and simplify the feature-detection #defines of the recovery support in shell.c.in and disable it when building fiddle because it uses features we elide from the wasm build (e.g. utf16), leading to link errors.

FossilOrigin-Name: ddd10c05c5d16d7205c347c5c1e73a75faecb2b7ec88a4a15875856765e1b143

2 years agoExpose sqlite3_randomness() to WASM and add a custom binding for it which can populat...
stephan [Thu, 27 Oct 2022 03:03:16 +0000 (03:03 +0000)] 
Expose sqlite3_randomness() to WASM and add a custom binding for it which can populate a JS byte array. Add WhWasmUtil.isPtr().

FossilOrigin-Name: 333e67076b4bc967bb543ef8e265c63f6e3498c38ac121a7d1eff4a1d7a71c63

2 years agoDisable the push-down optimization for sub-queries that are INTERSECT, UNION or EXCEP...
dan [Wed, 26 Oct 2022 21:14:21 +0000 (21:14 +0000)] 
Disable the push-down optimization for sub-queries that are INTERSECT, UNION or EXCEPT compounds. dbsqlfuzz a34f455c91ad75a0cf8cd9476841903f42930a7a.

FossilOrigin-Name: 346a3b12b861ce7ba369e98cd336f79a1d4f7a7bb9acd7a4f63f37b391755bf5

2 years agoRemove an unused variable from the recovery extension.
drh [Wed, 26 Oct 2022 20:12:46 +0000 (20:12 +0000)] 
Remove an unused variable from the recovery extension.

FossilOrigin-Name: a029dddff4f4ed7275538610cbd9cea658b905b72924860ec9cda9e76dabcfac

2 years agoAdd the "recover" extension in ext/recover/, for salvaging data from corrupt databases.
dan [Wed, 26 Oct 2022 18:41:12 +0000 (18:41 +0000)] 
Add the "recover" extension in ext/recover/, for salvaging data from corrupt databases.

FossilOrigin-Name: a820792548da596ed0f8ab3fd1c04ec16647abbe51a2a5aac9e17c4f58be6d97

2 years agoRemove an undefined left-shift operation from the recover extension. recover-extension 7/head
dan [Wed, 26 Oct 2022 18:29:19 +0000 (18:29 +0000)] 
Remove an undefined left-shift operation from the recover extension.

FossilOrigin-Name: a67082357a2cc348faf8236aafa7f39eb5cb673b1d114a594c6d5bb257f85b73

2 years agoMerge further changes from trunk, including fix to dbdata.c.
dan [Wed, 26 Oct 2022 18:22:22 +0000 (18:22 +0000)] 
Merge further changes from trunk, including fix to dbdata.c.

FossilOrigin-Name: bcf6b48d52c1ce656899f50bd508c0920cae8cf2ef3c0758a7633981f0f0f484

2 years agoMake the shell .recover command and the dbdata.c module more robust in the face of...
dan [Wed, 26 Oct 2022 18:04:34 +0000 (18:04 +0000)] 
Make the shell .recover command and the dbdata.c module more robust in the face of corrupted databases.

FossilOrigin-Name: 4eef562a00ae988f2426c9af51f4165c0e4cbccd601061664a0c54c19b9cc70f

2 years agoCorrect misuse of localhost-mode-only symbol S in fiddle-worker.js, which should...
stephan [Wed, 26 Oct 2022 15:40:17 +0000 (15:40 +0000)] 
Correct misuse of localhost-mode-only symbol S in fiddle-worker.js, which should fix the outage reported in [forum:67d985ac0bbe407f|forum post 67d985ac0bbe407f].

FossilOrigin-Name: 3b5aa50c223ac35c7d73e4629420a01408cd74d19ae5b887f91b7a657d91e026

2 years agoCorrected link to fiddle in ext/wasm/index.html (broken by [3d7b4f36b7dd]).
stephan [Wed, 26 Oct 2022 15:34:51 +0000 (15:34 +0000)] 
Corrected link to fiddle in ext/wasm/index.html (broken by [3d7b4f36b7dd]).

FossilOrigin-Name: 6efa0bae1678bf719a0693feeceb4c1e252fc86502bee9ee2a6d8af9a91d9b20

2 years agoReplace the newly-removed oo1.DB.getFilename() with DB.dbFilename() with the hope...
stephan [Wed, 26 Oct 2022 11:27:33 +0000 (11:27 +0000)] 
Replace the newly-removed oo1.DB.getFilename() with DB.dbFilename() with the hope that the distinction from the dbInstance.filename property is clearer.

FossilOrigin-Name: 0b80543d75504c733b73b32f73b96074a4b0cebad64e47032926a3fefee41726

2 years agoRemove oo1.DB.hasFilename() and getFilename(), as they are unnecessary.
stephan [Wed, 26 Oct 2022 11:12:14 +0000 (11:12 +0000)] 
Remove oo1.DB.hasFilename() and getFilename(), as they are unnecessary.

FossilOrigin-Name: 75c546b982024bf2b527c85271111d54158cb010867f6e29fc89e86cc8457cc5

2 years agoRemove the sqlite3StdTypeMap global constant that was made
drh [Wed, 26 Oct 2022 11:11:31 +0000 (11:11 +0000)] 
Remove the sqlite3StdTypeMap global constant that was made
obsolete by [aa6e908619624867].

FossilOrigin-Name: 3dfdfb3f12edb3f4267942598efd05d573e13b7c5d6cdbc3404373f41b8993dd

2 years agoAdd --download-version flag to ext/wasm/version-info.c and correct dist target's...
stephan [Wed, 26 Oct 2022 06:05:44 +0000 (06:05 +0000)] 
Add --download-version flag to ext/wasm/version-info.c and correct dist target's output version format to match.

FossilOrigin-Name: 6f2a40d06dd9a56491d27928ed3785e08308c7dcea2b3f768097fc98ba91a910

2 years agoAdd doc page link to the wasm dist README.txt.
stephan [Tue, 25 Oct 2022 16:57:42 +0000 (16:57 +0000)] 
Add doc page link to the wasm dist README.txt.

FossilOrigin-Name: c2380668d9a2ad04f6f27ef052190bda17cdb112895e93b94ae1da70db6983c8

2 years agoCorrect -O level for fiddle build when built from the top-most directory (-Os instead...
stephan [Tue, 25 Oct 2022 16:04:44 +0000 (16:04 +0000)] 
Correct -O level for fiddle build when built from the top-most directory (-Os instead of -O0).

FossilOrigin-Name: ff4fc29c38b78dfd471e25942304cba352469d6018f1c09158172795dbdd438c

2 years agoRename fiddle.html to index.html and move fiddle push-to-server rules from GNUmakefil...
stephan [Tue, 25 Oct 2022 15:59:27 +0000 (15:59 +0000)] 
Rename fiddle.html to index.html and move fiddle push-to-server rules from GNUmakefile into fiddle.make.

FossilOrigin-Name: 3d7b4f36b7dd01058d57fc8ef7689d9bbf1a219166796ed427180cd59d2c189d

2 years agospeedtest1: use the current (or default) vfs->xDelete method to unlink the db. This...
stephan [Tue, 25 Oct 2022 15:38:38 +0000 (15:38 +0000)] 
speedtest1: use the current (or default) vfs->xDelete method to unlink the db. This is specifically necessary when running the opfs vfs in a wasm build of speedtest1. This worked without this fix until recently because the affected test code was performing similar acrobatics in its stead.

FossilOrigin-Name: d3c830bd37a402161b486d3631feceae5d00f89c2522aed65fcd2e666bd64238

2 years agoEnhance the sqlite3_strglob() and sqlite3_strlike() interfaces so that they
drh [Tue, 25 Oct 2022 13:44:18 +0000 (13:44 +0000)] 
Enhance the sqlite3_strglob() and sqlite3_strlike() interfaces so that they
will do sensible things with NULL string pointers.  This is an extra layer
of defense against bugs such as reported by
[forum:/forumpost/730b554179|forum post 730b554179].

FossilOrigin-Name: 8ba9c884bded52e3e044ff39c826c04838e7c31f05d802f4a14d9ce5a01ab721

2 years agoMake the ".dump" command of the CLI more robust against malformed databases.
drh [Tue, 25 Oct 2022 13:42:10 +0000 (13:42 +0000)] 
Make the ".dump" command of the CLI more robust against malformed databases.
See [forum:/forumpost/730b554179|forum post 730b554179].

FossilOrigin-Name: 0573edfb9e0b1fd51e8da20592c71b02040968c33fdec41c31a6b1b7d3e83262

2 years agoMerge latest trunk changes with this branch.
dan [Tue, 25 Oct 2022 11:05:31 +0000 (11:05 +0000)] 
Merge latest trunk changes with this branch.

FossilOrigin-Name: 757e3f585959f4f113fee48fe3d504f037604c53a95c8d47ce5c2bccfb2af8ff

2 years agoMinor doc tweaks in the JS GNUmakefile.
stephan [Tue, 25 Oct 2022 08:41:00 +0000 (08:41 +0000)] 
Minor doc tweaks in the JS GNUmakefile.

FossilOrigin-Name: 9c8df130b8137cb4705f805907d1ff754d7f4b07bf181e1d05f1798b7aa5f4f6

2 years agoRemove persistence from the 'reverse log order?' checkbox in tester1.js to eliminate...
stephan [Tue, 25 Oct 2022 08:15:57 +0000 (08:15 +0000)] 
Remove persistence from the 'reverse log order?' checkbox in tester1.js to eliminate an inconsistency between the main-thread and worker-thread modes (the latter having no option for persistence of that setting).

FossilOrigin-Name: ecf906b07f50b4fcc551d20326a1bb1189bd6c2274627fd293f9460658ebea07

2 years agoMinor cleanups and doc improvements in the OPFS sqlite3_vfs proxy.
stephan [Tue, 25 Oct 2022 08:06:17 +0000 (08:06 +0000)] 
Minor cleanups and doc improvements in the OPFS sqlite3_vfs proxy.

FossilOrigin-Name: 48645f7bcacf81c4149f26d20ee1752fbe93a02f96b85bd7e28bfa49322137e5

2 years agoFix typo in comment.
drh [Mon, 24 Oct 2022 18:42:45 +0000 (18:42 +0000)] 
Fix typo in comment.

FossilOrigin-Name: f65c95658fe4d30817da8de7eb88e823ea1cd8be40e347d626870bad3cc13359

2 years agoAdd a comment to a previously undescribed member of the Walker union.
drh [Mon, 24 Oct 2022 18:33:50 +0000 (18:33 +0000)] 
Add a comment to a previously undescribed member of the Walker union.

FossilOrigin-Name: 69d704224e9ed022fcec591beff2ffcc4daf3e7fc586debfdcf00b25c1fddd87

2 years agoUse the same "PRAGMA synchronous" setting for the output of a "VACUUM INTO" as are...
dan [Mon, 24 Oct 2022 15:51:24 +0000 (15:51 +0000)] 
Use the same "PRAGMA synchronous" setting for the output of a "VACUUM INTO" as are configured for the database being vacuumed.

FossilOrigin-Name: 86cb21ca12581cae9a29f42ba707bd9d789e667e5ddc0f64b24940d5d5c9a118

2 years agoImprove the ability of the query planner to recognize covering indexes even
drh [Mon, 24 Oct 2022 13:20:48 +0000 (13:20 +0000)] 
Improve the ability of the query planner to recognize covering indexes even
on tables with more than 63 columns and where the index is over columns
beyond the 63rd column.

FossilOrigin-Name: f058773e41495ddbae698f9e9a4f62b7003112ea8614dfad69471340058735e4

2 years agoUpdate the fuzzinvariant logic in fuzzcheck to the latest code from
drh [Mon, 24 Oct 2022 12:38:32 +0000 (12:38 +0000)] 
Update the fuzzinvariant logic in fuzzcheck to the latest code from
dbsqlfuzz.

FossilOrigin-Name: 739ad584765f1fc0eb196db870785da1726805cc2d9dd0a831a37a9e55a4afe9

2 years agoFix built-in documentation for the ".mode qbox" command in the CLI.
drh [Mon, 24 Oct 2022 11:10:40 +0000 (11:10 +0000)] 
Fix built-in documentation for the ".mode qbox" command in the CLI.

FossilOrigin-Name: 3d7ea33be1076fd21681bdcff0c489646c017594b42b4a21a74e9e2d3947890b

2 years agoTest cases for covering indexes on wide tables. covering-index-enh
drh [Mon, 24 Oct 2022 11:02:02 +0000 (11:02 +0000)] 
Test cases for covering indexes on wide tables.

FossilOrigin-Name: 64c3777eb356b15094a9e9fcc135499ba22f4d847fb117afa6ccf19986e33585

2 years agoThe wide-table covering index detection must take into account aggregate
drh [Sun, 23 Oct 2022 20:09:13 +0000 (20:09 +0000)] 
The wide-table covering index detection must take into account aggregate
queries.

FossilOrigin-Name: 9ac73f83c53b9fba10bb1b8bbfd1a8dc8a2dc4a655e811d5b96335dbf2b6fdac

2 years agoMore frequently send the complete SELECT statement into sqlite3WhereBegin()
drh [Sat, 22 Oct 2022 23:09:29 +0000 (23:09 +0000)] 
More frequently send the complete SELECT statement into sqlite3WhereBegin()
so that it can more accurately determine index coverage.

FossilOrigin-Name: f6d09c5a0df940dbaa716df70df28218985b83540b34c468989729a3421ef38c

2 years agoEnhance the query planner with the ability to discern when an index is
drh [Sat, 22 Oct 2022 20:13:46 +0000 (20:13 +0000)] 
Enhance the query planner with the ability to discern when an index is
covering even when it indexes columns well beyond the 63rd column.

FossilOrigin-Name: 1390417be45dd84e9118f6e761f23b8ff7476d26411e165bbaab678881e4eadd

2 years agoThis branch attempts to improve the detection of covering indexes. This
drh [Sat, 22 Oct 2022 14:16:02 +0000 (14:16 +0000)] 
This branch attempts to improve the detection of covering indexes.  This
first check-in merely improves a parameter name to sqlite3WhereBegin() to
be more descriptive of what it contains, and ensures that a subroutine is
not inlines so that sqlite3WhereBegin() runs slightly faster.

FossilOrigin-Name: cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244

2 years agoClarification on the meaning of SrcList and SrcItem and especially the
drh [Sat, 22 Oct 2022 13:49:35 +0000 (13:49 +0000)] 
Clarification on the meaning of SrcList and SrcItem and especially the
SrcItem.colUsed and Index.colNotIdxed fields.  Comment changes only - no
changes to code.

FossilOrigin-Name: d96f6cc8475ae5509b8bff2db75e3c6f69a214d58d8979fbc0162ae488a040dc

2 years agoAdd SQLITE_DQS to the compileoptions_used list, per request in [forum post 8b1060122b...
stephan [Fri, 21 Oct 2022 17:48:49 +0000 (17:48 +0000)] 
Add SQLITE_DQS to the compileoptions_used list, per request in [forum post 8b1060122b|forum:8b1060122b]. Force DQS=0 in sqlite3-wasm.c.

FossilOrigin-Name: fcd9e0dbe3226f3f7ccc15b11fc3aa3b8058571bef274c25a33e9753e22f7551

2 years agoMacro name typo fix in OS_KV builds.
stephan [Fri, 21 Oct 2022 17:37:05 +0000 (17:37 +0000)] 
Macro name typo fix in OS_KV builds.

FossilOrigin-Name: 9cf1142b0cdb13347e3f551c862cb4714cadfe5ad637f049cf0a4b8bb6125b32

2 years agoEnsure that the RtreeCell object in rtreeUpdate has all bytes initialized.
drh [Fri, 21 Oct 2022 17:18:58 +0000 (17:18 +0000)] 
Ensure that the RtreeCell object in rtreeUpdate has all bytes initialized.

FossilOrigin-Name: 1e38742bde09cd879eb370bcf8604ed7ed00759209bcb4ed0374350e4b9e842d

2 years agoAdd kvvfs tests to tester1.js. Fix a scopedAlloc() misuse in oo1.DB ctor caused by...
stephan [Fri, 21 Oct 2022 06:58:27 +0000 (06:58 +0000)] 
Add kvvfs tests to tester1.js. Fix a scopedAlloc() misuse in oo1.DB ctor caused by refactoring earlier this morning (and caught by these new tests).

FossilOrigin-Name: 8e0f001ab76de6dbc17295b9085f7f61ce274c43f8c432ea4d2ec3153d248ff3

2 years agoAdd timing info and OPFS sanity tests to tester1.js
stephan [Fri, 21 Oct 2022 06:26:17 +0000 (06:26 +0000)] 
Add timing info and OPFS sanity tests to tester1.js

FossilOrigin-Name: 99915b0076422487cdd181a54e55694404fba13e4a540329b5ede9e2c9e12532

2 years agoExpose sqlite3_vfs_unregister() to WASM and unregister kvvfs in Worker threads to...
stephan [Fri, 21 Oct 2022 05:27:40 +0000 (05:27 +0000)] 
Expose sqlite3_vfs_unregister() to WASM and unregister kvvfs in Worker threads to avoid its unintended use there (in contexts other than local/sessionStorage). Correct registration of window functions, extend oo1.DB.createFunction() to support window functions, and add window function tests to tester1.js. Correct an incorrect 1-arg handling case for DB.exec(). Add per-test assertion counts to tester1.js.

FossilOrigin-Name: f07ce15479b7224b0d1ba9f147a433136e70c1461aa667d2737d4a918f778f55

2 years agoMake semantics for UDF xFinal() result handling and error reporting handling more...
stephan [Thu, 20 Oct 2022 23:48:38 +0000 (23:48 +0000)] 
Make semantics for UDF xFinal() result handling and error reporting handling more flexible.

FossilOrigin-Name: 89f3e1982ec32c010af67d15ef780847df20de568669e5c9d02f3cf084f51330

2 years agoAdd more JS tests. Flesh out the aggregate UDF tests to use sqlite3_aggregate_context...
stephan [Thu, 20 Oct 2022 21:28:31 +0000 (21:28 +0000)] 
Add more JS tests. Flesh out the aggregate UDF tests to use sqlite3_aggregate_context() so that they can each be used multiple times in the same statement. Add sqlite3_js_aggregate_context() convenience helper.

FossilOrigin-Name: 9d034ef5e1bab7c9651c2450dc85765fa6365d3f1414c711550de858ff8b3ece

2 years agoApply magic.txt correction and addition reported in [forum post 2d2366a04a0385|forum...
stephan [Thu, 20 Oct 2022 18:58:14 +0000 (18:58 +0000)] 
Apply magic.txt correction and addition reported in [forum post 2d2366a04a0385|forum:2d2366a04a0385].

FossilOrigin-Name: 9bf26e2aa3579f354ed2d314e1bf3e3ef117cbd71500ef5f76caa1de5cce1edc

2 years agoRename sqlite3_web_... to sqlite3_js_... Document the worker1.close.unlink option...
stephan [Thu, 20 Oct 2022 18:31:32 +0000 (18:31 +0000)] 
Rename sqlite3_web_... to sqlite3_js_... Document the worker1.close.unlink option. Fix unlink usage in speedtest1.html. Minor JS build cleanups.

FossilOrigin-Name: ac9af71b72a749b0a040273a88480d56f49570b569389a4ea20cc055f494d8ff

2 years agoAdd a bit to the optimization disabling mask for the indexed expression
drh [Thu, 20 Oct 2022 16:30:05 +0000 (16:30 +0000)] 
Add a bit to the optimization disabling mask for the indexed expression
optimization.

FossilOrigin-Name: 56df1482ab45d4d41f937b27c5a877b52fa082bfc6809ea682b62b47a51333de

2 years agoAdd test case for previous commit.
dan [Thu, 20 Oct 2022 16:22:39 +0000 (16:22 +0000)] 
Add test case for previous commit.

FossilOrigin-Name: 535867a9c8719358380f89fd80473c484def9bb72744dd2fd28ada65999ee901

2 years agoOnly enable the bMaybeNullRow flag on IndexedExpr for an index on an
drh [Thu, 20 Oct 2022 16:12:02 +0000 (16:12 +0000)] 
Only enable the bMaybeNullRow flag on IndexedExpr for an index on an
expression, not on a virtual column.  But do enable it for the right operand
of a right join.

FossilOrigin-Name: a9657c87c53c19228a42559c82c54b504a5ad729e407e9e2c7dabcc0c949b261

2 years agoThe generalized indexed expression optimization of [2435112867fbd7b6] makes
drh [Thu, 20 Oct 2022 13:36:32 +0000 (13:36 +0000)] 
The generalized indexed expression optimization of [2435112867fbd7b6] makes
the prior [a47efb7c8520a011] enhancement from 2017 obsolete.  This check-in
removes the older optimization.

FossilOrigin-Name: 56442c9bdd7844454c79acf83323380ea3509cb2e0b9a3d538a6b51726ae6d07

2 years agoFix minor problems in test1.c test code.
dan [Thu, 20 Oct 2022 10:46:17 +0000 (10:46 +0000)] 
Fix minor problems in test1.c test code.

FossilOrigin-Name: 6e545e2b846795fc67f8a90c04de284861a8a429ac686a7476b41c8ed7aabf75

2 years agoRework sqlite3_wasm_vfs_unlink(), add sqlite3_wasm_db_vfs(), update some docs.
stephan [Thu, 20 Oct 2022 05:14:37 +0000 (05:14 +0000)] 
Rework sqlite3_wasm_vfs_unlink(), add sqlite3_wasm_db_vfs(), update some docs.

FossilOrigin-Name: cdd46858f0e63bc7bfce8e339b3db9efdec43b6443ee76563a847f53d0176831

2 years agoMinor internal JS cleanups.
stephan [Thu, 20 Oct 2022 04:00:05 +0000 (04:00 +0000)] 
Minor internal JS cleanups.

FossilOrigin-Name: 818ef0b5c909e733b643455278f7cc45533178f1cc6617058c00ed64fa44896a

2 years agoIn the CLI, never use strcmp() or strncmp() directly. Instead use
drh [Wed, 19 Oct 2022 18:04:42 +0000 (18:04 +0000)] 
In the CLI, never use strcmp() or strncmp() directly.  Instead use
wrapper functions cli_strcmp() and cli_strncmp() that work correctly even
if the input is a NULL pointer.
[forum:/forumpost/142b868da7560d0b|Forum post 142b868da7560d0b].

FossilOrigin-Name: 7450a561f8577c3ee41f84074c6ef39e29e56876cab4fd763e6489c66f603223