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.
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.
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.
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).
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.
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.
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).
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].
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.
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).
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.
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.
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).
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.
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.
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].
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.
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].
Fix an error in the aggregate query LEFT JOIN flattening optimization from
[2cf373b10c9bc4cb] and further enhance that optimization so that it works
even if there is a GROUP BY clause.
TK_IF_NULL_ROW expressions must be accumulated in the same way as TK_COLUMN
expressions in an aggregate query. Proposed fix for the problem identifyed by
dbsqlfuzz 8e17857db2c5a9294c975123ac807156a6559f13.
Use sqlite3ParserAddCleanup() rather than pParse->pConstExpr to implement
sqlite3ExprDeferredDelete(). This is a better solution than check-in
[c538d07535092722].
In a TK_BLOB Expr node, the Expr.zToken might not be a well-formed
BLOB literal if there has been a prior OOM.
dbsqlfuzz 23871e5805d6c45b392f9b7aa1e8a2b98f3c27cd.