drh [Mon, 30 Jan 2023 20:44:54 +0000 (20:44 +0000)]
Additional tweaks to the enhancement at [609fbb94b8f01d67] to further reduce
the cost estimate for constructing an automatic index on an ephemeral table,
in order to resolve the performance problem described by
[forum:/forumpost/1d571c0296|forum post 1d571c0296].
stephan [Sun, 29 Jan 2023 05:09:39 +0000 (05:09 +0000)]
Correct the handling of the worker1 and promiser JS files in the face of the bundler-friendly changes. Those files require separate, bundler-friendly copies.
dan [Sat, 28 Jan 2023 17:37:37 +0000 (17:37 +0000)]
Fix a problem causing "PRAGMA quick_check" to return spurious corruption errors for a WITHOUT ROWID for which all columns are either virtual or part of the primary key, and for which the order of the columns in the primary key definition is different from the order in the table.
dan [Sat, 28 Jan 2023 16:37:30 +0000 (16:37 +0000)]
Update sqllimits1.test to account for the fact that if an odd value is specified as the length in bytes of a utf-16 string, it is truncated to the largest smaller even number.
stephan [Sat, 28 Jan 2023 09:11:08 +0000 (09:11 +0000)]
Overhaul ext/wasm/GNUmakefile to consolidate what amounts to much copy/paste/slightly-edit duplication into a single function, called once per distinctive build mode (vanilla, ESM, bundler-friendly).
stephan [Fri, 27 Jan 2023 17:14:55 +0000 (17:14 +0000)]
Extract emcc version in JS build and use it to conditionally set build flags. Initially a workaround for [https://github.com/emscripten-core/emscripten/issues/18610|Emscripten ticket #18610] but may have other uses.
stephan [Fri, 27 Jan 2023 02:21:16 +0000 (02:21 +0000)]
Resolve a nested if-block bug in ext/wasm/c-pp.c which caused output after a nested block to be unduly elided. Remove a kludge, added in the previous check-in, which worked around that bug.
drh [Wed, 25 Jan 2023 19:05:04 +0000 (19:05 +0000)]
Defer calling the destructor for the user data on a module until after the
module has disconnected.
[forum:/forumpost/b68391eb71fdff73|Forum post b68391eb71fdff73].
drh [Wed, 25 Jan 2023 16:56:24 +0000 (16:56 +0000)]
Enhance the sqlite3_vtab_in_first() and sqlite3_vtab_in_next() interfaces so
that they reliably return SQLITE_ERROR (and not SQLITE_MISUSE) if they are
invoked on a parameter that did not have multi-value IN processing enabled
via a prior call to sqlite3_vtab_in(). See
[forum:/forumpost/a823d4a3d5f73def|forum thread a823d4a3d5f73def].
dan [Tue, 24 Jan 2023 11:24:28 +0000 (11:24 +0000)]
Fix a problem with using fts3 auxiliary functions with expressions like "E AND ...", where E is a NEAR expression that consists entirely of deferred tokens.
drh [Mon, 23 Jan 2023 21:41:41 +0000 (21:41 +0000)]
Suppress a harmless compiler warning.
[forum:forumpost/e3f72e9291189925|Forum post e3f72e9291189925]. The code
was legal and correct. The revised code is actually less clear in its intent.
But at least now there will (hopefully) be no warning.
drh [Mon, 23 Jan 2023 20:45:47 +0000 (20:45 +0000)]
Due to a coding error, check-in [8efd61e8518594e3] did not actually use
just read transactions if the operation is read-only and the
SQLITE_MAX_ATTACHED macro is set to 31 or more. This was due to a misuse
of the writeMask field of Parse, pointed out by
[forum:/forumpost/aa173c18d5|forum post aa173c18d5].
dan [Fri, 20 Jan 2023 17:50:24 +0000 (17:50 +0000)]
Ensure that the database encoding cannot be changed while there are statements running. And that the connection is left in a valid state after an obscure OOM within sqlite3_deserialize().
stephan [Wed, 18 Jan 2023 17:39:04 +0000 (17:39 +0000)]
Emit sqlite3-api.(m)js during the JS build process, which are the JS APIs without the Emscripten/wasm-loading parts. They are hypothetically useful for arbitrary build environments/toolchains but have notable caveats related to the wasm imports, as elaborated on in the makefile.
drh [Tue, 17 Jan 2023 13:33:51 +0000 (13:33 +0000)]
Add test cases to confirm that the schema parsing quirk in which an
ON CONFLICT clause is accepted and ignored on table CHECK constraints but
raises an error on column CHECK constraints. We want to continue supporting
this harmless quirk to avoid breaking legacy applications and databases that
accidentally use it.
drh [Sat, 14 Jan 2023 19:53:42 +0000 (19:53 +0000)]
Omit the long-disused FTS1 and FTS2 implements from the active source tree.
The code will persist forever in the source repository, but there is no point
in carrying it around in the latest tarballs where it is never used.
drh [Fri, 13 Jan 2023 19:29:46 +0000 (19:29 +0000)]
In expression nodes of type REGISTER with sub-type COLUMN, ensure that the
iColumn field is set correctly, as otherwise the "IS NULL" operator might
be incorrectly optimized. Fix for the problem described by
[forum:/forumpost/d010a26798915b53|forum post d010a26798915b53].
drh [Fri, 13 Jan 2023 15:54:25 +0000 (15:54 +0000)]
Enhance query planning so that it check for sqlite3_interrupt() calls and
periodically invokes the progress handler callback (if any) during long
query analyses.
drh [Thu, 12 Jan 2023 19:51:49 +0000 (19:51 +0000)]
Fix sqlite3_prepare() so that it only invokes the progress handler on every
N-th call to sqlite3ProgressCheck(), where N is the progress handler step
count. Also fix faulty asserts exposed by the ability to interrupt in the
middle of sqlite3_prepare().
dan [Thu, 12 Jan 2023 17:13:44 +0000 (17:13 +0000)]
When deleting any old OAL file before starting an RBU update or vacuum, use the same VFS as will be used for the target database, even if this is not the system default.
drh [Thu, 12 Jan 2023 13:25:48 +0000 (13:25 +0000)]
Attempt to provide a mechanism to do early termination of long-running
statement preparation by invoking the progress handler at strategic points
during sqlite3_parpare(). This experiment shows that sqlite3_prepare() might
leave the resulting prepared statement uninitialized following an interrupt.
drh [Wed, 11 Jan 2023 17:50:24 +0000 (17:50 +0000)]
If OP_Rewind has P2 of zero, that is an assertion that the table is never
empty. This fixes a false-positive in the out-of-subroutine jump detection
logic added in version 3.39.0, and which was causing the assertion on the
previous check-in.
drh [Wed, 11 Jan 2023 16:44:57 +0000 (16:44 +0000)]
Add an assert() to the byte-code engine that goes off if the OP_Halt opcode
is invoked with SQLITE_INTERNAL. This causes the RIGHT JOIN error
"Opcode jumps to ... which is outside the subroutine ..." to fail immediately,
causing it to come more readily to tester's attention. There is at least
one testcase in test/fuzzdata8.db that asserts due to this change.
drh [Wed, 11 Jan 2023 00:27:06 +0000 (00:27 +0000)]
Add a new sqlite3_is_interrupted() interface that can be used by long-running
app-defined functions and similar to see if they need to exit early due to
an sqlite3_interrupt() call.
drh [Tue, 10 Jan 2023 19:57:26 +0000 (19:57 +0000)]
When computing the datatypes for columns in a view, use the same datatype name
as the underlying table if such is available and is consistent with
the computed affinity of the column.
[forum:/forumpost/7fb1fe9dcf310ef5|Forum thread 7fb1fe9dcf310ef5].
drh [Thu, 5 Jan 2023 01:26:58 +0000 (01:26 +0000)]
In the zipvfile extension (which is not part of the SQLite amalgamation, but
which is included in the CLI by default) ensure that fopen() is not invoked
using a NULL filename. Fix for the issue reported by
[forum:/forumpost/d1c96a9032e564f8|forum post d1c96a9032e564f8].
dan [Wed, 4 Jan 2023 17:46:29 +0000 (17:46 +0000)]
Ensure that LIMIT clauses may be passed through to virtual table implementations even if the WHERE clause uses operators that may only be optimized by virtual, not built-in, tables (!=, functions, MATCH etc.).
drh [Wed, 4 Jan 2023 15:18:52 +0000 (15:18 +0000)]
Enhance PRAGMA integrity_check so that it verifies that the string values
stored in indexes are byte-for-byte identical to the values in the table, and
not just equivalent according to the collating sequence.
dbsqlfuzz 686e2e205e0c0594d3fb524bea0c25e621d1a870.
stephan [Wed, 4 Jan 2023 03:14:06 +0000 (03:14 +0000)]
Remove the JS-side SQLITE_WASM_DEALLOC sanity check which triggers the problem mentioned in [688c5c13d156] and [ae0196d86ee8], for reasons covered in the code comments, per discussion in [forum:e5b20e1feb|forum post e5b20e1feb].