]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoAdd test descriptions to the speedtest1 '-- begin' markers for potential display...
stephan [Mon, 29 Aug 2022 17:41:16 +0000 (17:41 +0000)] 
Add test descriptions to the speedtest1 '-- begin' markers for potential display by the downstream JS code which uses those markers.

FossilOrigin-Name: e5b7006f0f57f10a490d7eaeb7df77251a2f684602fed8ff161d8ce60033e7bc

2 years agoAdd batch-runner.js for running batch SQL scripts with timing info.
stephan [Mon, 29 Aug 2022 12:39:34 +0000 (12:39 +0000)] 
Add batch-runner.js for running batch SQL scripts with timing info.

FossilOrigin-Name: 11f3ed61150c5940da6c157e5063e70c3aa0628dfd0023c47bb65b00af74ab1f

2 years agoAdd get/setPtrValue() to the common wasm utils.
stephan [Mon, 29 Aug 2022 12:31:57 +0000 (12:31 +0000)] 
Add get/setPtrValue() to the common wasm utils.

FossilOrigin-Name: 24d70fc458c6002d5ff3c9f8ce7c66bde299b32aca6417c2dd1236e1412b036d

2 years agoAdd begin/end comment markers to the test blocks in speedtest1 --script output to...
stephan [Mon, 29 Aug 2022 09:51:17 +0000 (09:51 +0000)] 
Add begin/end comment markers to the test blocks in speedtest1 --script output to facilitate chopping up the output into chunks for JS-side processing.

FossilOrigin-Name: ef0b7ef2d2e19b1f9437fdd7e24f040f662d9907d1fa17c6a3892fcf091b849e

2 years agooo #1 api: correct a case where a null callback is called. Rename some vars for clari...
stephan [Mon, 29 Aug 2022 08:04:55 +0000 (08:04 +0000)] 
oo #1 api: correct a case where a null callback is called. Rename some vars for clarity. Increase wasm-side memory in order to be able to load the speedtest1 output.

FossilOrigin-Name: b5058f14fadbc8a1886f27cff08593dd2c8e2b2cb6d7bed3b8733a55f031989f

2 years agoMerge changes from trunk into the fiddle-opfs branch.
stephan [Thu, 25 Aug 2022 19:38:54 +0000 (19:38 +0000)] 
Merge changes from trunk into the fiddle-opfs branch.

FossilOrigin-Name: 34279797be0922b9df05e0d4f327f8582ab25fb6fb21583f8441ddf5deded891

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 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 agoConsolidate oo1.DB.exec() and oo1.DB.execMulti() into oo1.DB.exec(). This is a bit...
stephan [Thu, 25 Aug 2022 13:27:52 +0000 (13:27 +0000)] 
Consolidate oo1.DB.exec() and oo1.DB.execMulti() into oo1.DB.exec(). This is a bit less efficient but certainly easier for a client to deal with and lightens the maintenance burden.

FossilOrigin-Name: 7eff7213dff553b76d7ce45063e3c4a19544716611a0b609593d704076b38d0b

2 years agoRefactor and expand the worker1 docs, consolidating them into the top of their file...
stephan [Thu, 25 Aug 2022 11:39:12 +0000 (11:39 +0000)] 
Refactor and expand the worker1 docs, consolidating them into the top of their file instead of scattered around the internals. Accommodate an API change from yesterday in demo-oo1.js.

FossilOrigin-Name: 0a65747047322b7b585e281ac275e437ce3f46e1d06105c19117213929a906ad

2 years agoChange DB.exec() rowMode default from 'stmt' to 'array', per /chat discussion. Add...
stephan [Wed, 24 Aug 2022 20:57:37 +0000 (20:57 +0000)] 
Change DB.exec() rowMode default from 'stmt' to 'array', per /chat discussion. Add DB.exec() rowMode option for fetching a specific column by name. Add result column names to worker1 exec() callback interface, as there's otherwise no way to get that info from a worker.

FossilOrigin-Name: 1bb37e5c477b9eb098362f74a45a55be23d450fe45cdff58c1cbff08b5b3998f

2 years agoExpand the worker1 'exec' op handling for per-row callbacks for API-level consistency...
stephan [Wed, 24 Aug 2022 18:39:46 +0000 (18:39 +0000)] 
Expand the worker1 'exec' op handling for per-row callbacks for API-level consistency and smooth some edges between worker1 core and worker1-promiser. Add worker1 'config-get' message to fetch the serializable parts of the sqlite3.config state. Improve the 'open' op's handling of the 'persistent' option (noting that we cannot yet test that case from a worker).

FossilOrigin-Name: 509f8839201ec1ea4863bd31493e6c29a0721ca6340755bb96656b828758fea7

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 agojs: resolve the mysterious "extra" unhandled exception notification, caused by inadve...
stephan [Wed, 24 Aug 2022 14:50:10 +0000 (14:50 +0000)] 
js: resolve the mysterious "extra" unhandled exception notification, caused by inadvertently forking one promise into two separate ones (failing to properly reassign a then() result). Fix a typo in new Worker 1 code which caused the DB(filename) name to be incorrect.

FossilOrigin-Name: 7467ac88801224089b51c6ba7924f93283dd87beca602a186c83632df26cfc85

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 agoMore work on how to configure the sqlite3 JS API bootstrapping process from higher...
stephan [Wed, 24 Aug 2022 05:59:23 +0000 (05:59 +0000)] 
More work on how to configure the sqlite3 JS API bootstrapping process from higher-level code. Initial version of sqlite3-worker1-promiser, a Promise-based proxy for the Worker API #1.

FossilOrigin-Name: b030f321bd5a38cdd5d6f6735f201afa62d30d2b0ba02e67f055b4895553a878

2 years agoThe very basics of a Promise-based proxy for the Worker #1 API. Still requires consid...
stephan [Wed, 24 Aug 2022 00:51:39 +0000 (00:51 +0000)] 
The very basics of a Promise-based proxy for the Worker #1 API. Still requires considerable cleanup, testing, and a solution for the exec-callback-via-event-type-name problem.

FossilOrigin-Name: 1e447849fb65887e806e3348a8a68f70ea6802bc0a1e56c385a279f27cc0cdda

2 years agoSignificant restructuring of the Worker #1 request/response object structures to...
stephan [Wed, 24 Aug 2022 00:10:45 +0000 (00:10 +0000)] 
Significant restructuring of the Worker #1 request/response object structures to improve readability and clarity.

FossilOrigin-Name: 03b9db9b98cb36faa7de5a8a64d2e13c4aeaadfefb33ac92bb41056f6be3f121

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 agoWasm build flag tweaks and documentation.
stephan [Tue, 23 Aug 2022 17:02:46 +0000 (17:02 +0000)] 
Wasm build flag tweaks and documentation.

FossilOrigin-Name: c8eb3aa8e0f487f14791214caf70d1aa03866e01345c7fa1d5607c24c39dde1d

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 agoMore experimentation with how client-side config state can be passed on to initialize...
stephan [Mon, 22 Aug 2022 21:37:17 +0000 (21:37 +0000)] 
More experimentation with how client-side config state can be passed on to initialize the JS-side sqlite3 API.

FossilOrigin-Name: ea2acc454c012a62556f6d0623d6eff60736d24aa214a64462b423623ef44d47

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 agoMerge in trunk.
stephan [Mon, 22 Aug 2022 14:03:11 +0000 (14:03 +0000)] 
Merge in trunk.

FossilOrigin-Name: e215d55a97e1ccbca3101621374444d2381d87ef8e8fde5271e31c8b714e43e9

2 years agoRefactor JS API amalgamation such that the bootstrapping/configuration is deferred...
stephan [Mon, 22 Aug 2022 13:34:13 +0000 (13:34 +0000)] 
Refactor JS API amalgamation such that the bootstrapping/configuration is deferred until the whole amalgamation is available, to facilitate providing clients with a way to initialize the API with their own config (noting that we're still one small level of refactoring away from being able to actually do that).

FossilOrigin-Name: 9dbe9a6aecec43b51057375ef1d2d632db0d17eac8b7552c20cc91fc2f1a55d1

2 years agowasm: accommodated a JS API rename.
stephan [Mon, 22 Aug 2022 08:55:10 +0000 (08:55 +0000)] 
wasm: accommodated a JS API rename.

FossilOrigin-Name: 00991335c4dae56232e999398e5e82d8161903ba7d084b16a73a150e83f1f782

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 agoAdd notes to ext/wasm/README.md explaining how to run tests on a remote
drh [Thu, 18 Aug 2022 15:53:27 +0000 (15:53 +0000)] 
Add notes to ext/wasm/README.md explaining how to run tests on a remote
machine.

FossilOrigin-Name: 7a3c444fb515413254b426908e4d3528ccc664a629628c23b7b85bd21c060d0e

2 years agojavascript: rename and simplify DB.callInTransaction() as DB.transaction(). Add DB...
stephan [Thu, 18 Aug 2022 12:21:58 +0000 (12:21 +0000)] 
javascript: rename and simplify DB.callInTransaction() as DB.transaction(). Add DB.savepoint(), which works the same as transaction() but uses savepoints. Correct concatenation of arguments to SQLite3Error to use spaces instead of commas. Test that demo-oo1.js works with persistent OPFS storage (output differs due to persistent rows, but the demo works).

FossilOrigin-Name: e8c323f12b6223bc9dcbbec40698969c7917128aa50cf599c247df23f607ae61

2 years agoImprove an exception check in demo-oo1.js.
stephan [Thu, 18 Aug 2022 11:16:27 +0000 (11:16 +0000)] 
Improve an exception check in demo-oo1.js.

FossilOrigin-Name: 55e1b775fa7ec492817cc847036df7794c3c22b78558e9e9c513f24c775dedab

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 agoMinor cleanups, reorgs, and doc updates for the JS APIs. Renamed sqlite3(-api)-worker...
stephan [Wed, 17 Aug 2022 16:44:05 +0000 (16:44 +0000)] 
Minor cleanups, reorgs, and doc updates for the JS APIs. Renamed sqlite3(-api)-worker.js to sqlite3(-api)-worker1.js, for symmetry with sqlite3-api-oo1.js.

FossilOrigin-Name: f5059ee6f9fc55a381cbf08a30dfb9a5636c0b44341e42f4e9f12a3b109b5507

2 years agowasm: minor cleanups in the OO API #1 demo.
stephan [Tue, 16 Aug 2022 17:29:59 +0000 (17:29 +0000)] 
wasm: minor cleanups in the OO API #1 demo.

FossilOrigin-Name: b9cdcc06a8f70694d10ee5b1a0fd9f08f4c705ce576e5103bbafb36fc9cc2122

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 agowasm: add a small demo/presentation app for JS OO API #1 and make a few minor additio...
stephan [Tue, 16 Aug 2022 16:36:19 +0000 (16:36 +0000)] 
wasm: add a small demo/presentation app for JS OO API #1 and make a few minor additions to that API.

FossilOrigin-Name: d6d79b661a1c6137d4693393e02416da4858d58dc84d144081a48d523655b483

2 years agowasm: move another file and update testing1/testing2 to account for [e38d00c2b82d...
stephan [Tue, 16 Aug 2022 16:16:25 +0000 (16:16 +0000)] 
wasm: move another file and update testing1/testing2 to account for [e38d00c2b82d]. Disable wasmfs by default as it breaks the worker-based module loader (reason as yet unknown).

FossilOrigin-Name: 6dad5e0573ee866657ee10b43e55b86fc9caac7a66c13bdbd35c3625a4783f14

2 years agowasm: accommodate moving generated sqlite3.js in the previous checkin.
stephan [Tue, 16 Aug 2022 16:11:20 +0000 (16:11 +0000)] 
wasm: accommodate moving generated sqlite3.js in the previous checkin.

FossilOrigin-Name: 41762f9518bb51b8b23ae6507628d6d3256044e1f2aca6e7251dc57722062c42

2 years agowasm: disable shared cache mode by default. Experimentally move wasm-build generated...
stephan [Tue, 16 Aug 2022 16:06:12 +0000 (16:06 +0000)] 
wasm: disable shared cache mode by default. Experimentally move wasm-build generated files up one dir to rule the extra dir out as a problem for Emscripten-related worker-loading failures.

FossilOrigin-Name: e38d00c2b82d7e51ec04cd739514f255edde679b8ddab31fa944b3517d45c3ea

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 worker-style variant of the tests added in [ae24ac0f7dd9], but building this...
stephan [Sat, 13 Aug 2022 17:13:16 +0000 (17:13 +0000)] 
Add worker-style variant of the tests added in [ae24ac0f7dd9], but building this with wasmfs causes them to throw inexplicable exceptions from the Emscripten glue (without wasmfs it builds and runs fine, but storage is not persistent).

FossilOrigin-Name: 6401595e59179c5c0f6e51c5362cf4391787e7a55b9c6ca655746e30d3251f2b

2 years agowasmfs: use unix-none VFS by default to avoid locking errors in non-OPFS mode.
stephan [Sat, 13 Aug 2022 16:36:06 +0000 (16:36 +0000)] 
wasmfs: use unix-none VFS by default to avoid locking errors in non-OPFS mode.

FossilOrigin-Name: 75561dea1a1afe9cb0a7d58dd82fa519e51cf42e330922cfd8e9ccdf6db4dc0f

2 years agoAdd scratchpad/test app for WASMFS/OPFS running in the main window thread. Enable...
stephan [Sat, 13 Aug 2022 16:11:38 +0000 (16:11 +0000)] 
Add scratchpad/test app for WASMFS/OPFS running in the main window thread. Enable WASMFS by default in the library build.

FossilOrigin-Name: ae24ac0f7dd9e12a40de0f6ccd61a16f010804da454085f886c217cc600cdba4

2 years agoCleanups in the wasmfs/opfs integration but disable it in order to get the build...
stephan [Sat, 13 Aug 2022 13:56:00 +0000 (13:56 +0000)] 
Cleanups in the wasmfs/opfs integration but disable it in order to get the build into a known-working state before continuing with experimentation.

FossilOrigin-Name: 41045be752a5bd7966849638f3ca56f4905308df70f79f2cb6196ca7dce9d525

2 years agoRemove OPFS from the fiddle build for the time being - will re-enable once the breaka...
stephan [Sat, 13 Aug 2022 13:51:56 +0000 (13:51 +0000)] 
Remove OPFS from the fiddle build for the time being - will re-enable once the breakage is figured out via testing with the core API.

FossilOrigin-Name: 3bc510a614973eafa60960a99bedb063594a693bdbfd80d7eb480b293b4ab811

2 years agowasm OO API #1: added DB.callInTransaction() and Stmt.stepFinalize().
stephan [Sat, 13 Aug 2022 13:46:19 +0000 (13:46 +0000)] 
wasm OO API #1: added DB.callInTransaction() and Stmt.stepFinalize().

FossilOrigin-Name: e37dddc1dd9c0530e4b1c6cb0ca7cba7451caa37734d383c9b47f378d7222242

2 years agoCorrected TextDecoder.decode() usage to run when its input references a SharedArrayBu...
stephan [Sat, 13 Aug 2022 13:42:07 +0000 (13:42 +0000)] 
Corrected TextDecoder.decode() usage to run when its input references a SharedArrayBuffer.

FossilOrigin-Name: d4d773405c579e7efd95be8d81fe14d71218e62e44c523d38e02f89424ba6ce8

2 years agoUse new -DSQLITE_DEFAULT_UNIX_VFS="unix-none" for fiddle build to bypass OPFS locking...
stephan [Fri, 12 Aug 2022 18:54:08 +0000 (18:54 +0000)] 
Use new -DSQLITE_DEFAULT_UNIX_VFS="unix-none" for fiddle build to bypass OPFS locking errors.

FossilOrigin-Name: b3a93ec75acb38535691d6eaceb5a1a218a5ee3f755a1e12c9255b90567fc795

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 agoUpdated fiddle deps to ensure that sqlite3.c is built first.
stephan [Fri, 12 Aug 2022 18:07:22 +0000 (18:07 +0000)] 
Updated fiddle deps to ensure that sqlite3.c is built first.

FossilOrigin-Name: f0ca02611484f5031076d7fae88845e9931715e9108ec0572629200d4f6636ef

2 years agoBuild fiddle with WASMFS OPFS support and attempt to use it if available. It does...
stephan [Fri, 12 Aug 2022 17:57:09 +0000 (17:57 +0000)] 
Build fiddle with WASMFS OPFS support and attempt to use it if available. It does not work because of an inexplicable exception in Emscripten-generated code and perpetually-locked db, but it's not yet clear why.

FossilOrigin-Name: a16f0a46ec88c560f73d5664e4bf53fb5dd1a22e99a92c11b5c8d784816c3282

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

2 years agoFix a rounding error caused by scalar->logarithm->scalar conversion when using stat4...
dan [Sat, 6 Aug 2022 15:28:37 +0000 (15:28 +0000)] 
Fix a rounding error caused by scalar->logarithm->scalar conversion when using stat4 data to estimate some range scans.

FossilOrigin-Name: 86e30d7c4bb1cebe25b66686d6d1ee170c1a88e5a6c1bed6652ebbb024d62062

2 years agoAvoid having fts3 read uninitialized values when processing deferred tokens.
dan [Fri, 5 Aug 2022 17:16:00 +0000 (17:16 +0000)] 
Avoid having fts3 read uninitialized values when processing deferred tokens.

FossilOrigin-Name: 98729c5fa6c4c418ca9779c35e6874c930e5cee5a90b5eb32b284a0f3762269e

2 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Fri, 5 Aug 2022 05:30:07 +0000 (05:30 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: e36217f2536d89f7a15a879fe3ead32307909c71ced42e1ae7b35f43d4744a80

2 years agoFix a problem with the query optimizer for LIMIT/OFFSET queries when
drh [Thu, 4 Aug 2022 17:15:00 +0000 (17:15 +0000)] 
Fix a problem with the query optimizer for LIMIT/OFFSET queries when
underlying query is a UNION ALL and both arms of the UNION ALL are
subqueries with an ORDER BY clause.  This bug was reported at
[forum:/forumpost/6b5e9188f0657616|forum post 6b5e9188f0657616].  The
problem was introduced in 2015 (SQLite version 3.9.0) by check-in
[4b631364354068af].  See also ticket [b65cb2c8d91f6685].

FossilOrigin-Name: 6c806f64bbc9e98891bad0868575ee2ec5d0951ceb0c71d3ed417b45d5f27561

2 years agoFix a typo on a comment used to generate bytecode documentation.
drh [Thu, 4 Aug 2022 14:02:35 +0000 (14:02 +0000)] 
Fix a typo on a comment used to generate bytecode documentation.

FossilOrigin-Name: 64348d0b665f61c3a89f51341f23ca87f939dd9e306dc58c2004e46ab04e696e

2 years agoPerformance optimization to the math opcodes of the bytecode engine.
drh [Wed, 3 Aug 2022 19:53:54 +0000 (19:53 +0000)] 
Performance optimization to the math opcodes of the bytecode engine.

FossilOrigin-Name: 597347d9c39f6ed068ac942a8c9853b1b745fce1eb5e9dd30f6c1cb312b36f53

2 years agoSmall performance increase on the binding interfaces.
drh [Wed, 3 Aug 2022 19:37:25 +0000 (19:37 +0000)] 
Small performance increase on the binding interfaces.

FossilOrigin-Name: aab24c37fb444804fb91177b4b522909ef1bb85383444d97d82a758f919047d2

2 years agoImprovement on the previous check-in.
drh [Wed, 3 Aug 2022 17:26:32 +0000 (17:26 +0000)] 
Improvement on the previous check-in.

FossilOrigin-Name: c1ab0ea2959259cbd29f624bfd5e7366035f2dbcaab72c0bf55723c0919b7a79

2 years agoFor an IN operator used with a RIGHT JOIN, use the number of terms in the
drh [Wed, 3 Aug 2022 15:58:44 +0000 (15:58 +0000)] 
For an IN operator used with a RIGHT JOIN, use the number of terms in the
vector, not the number of equality terms, to size the column map.
dbsqlfuzz 14cfdad6ca45e607163f54049ddf5065183dc657.

FossilOrigin-Name: b184c8d9222da6b420b5d7c439bbe4b737d92ffa27f5e933f4e1a9c8117b0ee5

2 years agoIn the xUpdate method of the GeoPoly virtual table, make sure that the
drh [Mon, 1 Aug 2022 13:14:03 +0000 (13:14 +0000)] 
In the xUpdate method of the GeoPoly virtual table, make sure that the
number of updated columns does not exceed the underlying implementation, even
if the virtual table object records an excess number of column in the nAux
field due to table constraints in the table definition.
Fix for the problem reported by
[forum:/forumpost/a096ab7d96bb057a|forum post a096ab7d96bb057a].

FossilOrigin-Name: a04dd475c2c8afdded0afecfd34c6c4c2f48cce520e09b7fa5172ff30f09209e

3 years agoRestore a VDBE coverage macro that is mistakenly deleted for
drh [Tue, 26 Jul 2022 19:10:13 +0000 (19:10 +0000)] 
Restore a VDBE coverage macro that is mistakenly deleted for
check-in [92ac01d41d46ab73].

FossilOrigin-Name: 01de7ec44fb1e8e6f847eaef433216b3163a44a8789451718e1c419ef840ddfb

3 years agoFix another problem related to aggregate query LEFT JOIN flattening.
dan [Tue, 26 Jul 2022 18:43:45 +0000 (18:43 +0000)] 
Fix another problem related to aggregate query LEFT JOIN flattening.

FossilOrigin-Name: 8e12c6f59bcb67be4ff131feecc5af68f4bb0afbcced2e2f7e73289aaf95d99d

3 years agoOmit a unused variable initialization in order to suppress a harmless compiler
drh [Tue, 26 Jul 2022 15:41:34 +0000 (15:41 +0000)] 
Omit a unused variable initialization in order to suppress a harmless compiler
warning.

FossilOrigin-Name: 2d703c5e941cac72efc21d58e1e35c446b338b2927a42f587ab788826fd7f3f1

3 years agoAdd test cases related to fix [e717e029]. flatten-left-join
dan [Tue, 26 Jul 2022 15:39:32 +0000 (15:39 +0000)] 
Add test cases related to fix [e717e029].

FossilOrigin-Name: 2909f36bfba8f34b818e5d9ecd8c759f05bbe25765089e78bb022de2b77a4f0f

3 years agoMake sure IF_NULL_ROW expressions receive a separate slot in the sorter used
drh [Tue, 26 Jul 2022 15:32:02 +0000 (15:32 +0000)] 
Make sure IF_NULL_ROW expressions receive a separate slot in the sorter used
to implement GROUP BY.

FossilOrigin-Name: 2bda4fca06ab6be5ad02377a7d1fd9fb9586e3181f1052e4b4937958bdd45efe

3 years agoImproved AggInfo.aCol debugging output, intended to debug a problem with
drh [Tue, 26 Jul 2022 14:37:04 +0000 (14:37 +0000)] 
Improved AggInfo.aCol debugging output, intended to debug a problem with
LEFT JOIN flattening into an aggregate query with GROUP BY.

FossilOrigin-Name: e717e029bde4ee68b6ea77a68721c02ddb6e296f1d310a368137ea3c4164f68c

3 years agoAdd a OOM term to a single assert() statement.
drh [Tue, 26 Jul 2022 10:16:25 +0000 (10:16 +0000)] 
Add a OOM term to a single assert() statement.

FossilOrigin-Name: 217fc3ebd423e050508d6af97e0664f301824ef9a997ed2d302c006a41227917

3 years agoPerformance optimization: avoid unnecessary calls to computeLimitRegisters().
drh [Tue, 26 Jul 2022 01:20:18 +0000 (01:20 +0000)] 
Performance optimization:  avoid unnecessary calls to computeLimitRegisters().

FossilOrigin-Name: f48bd8f85d86fd93329dda7ba57f468854a732b89e4126e9c5beec3495d24b31