stephan [Thu, 25 Jul 2024 16:21:19 +0000 (16:21 +0000)]
Strip progress handlers and window functions from the wasm bare-bones (formerly 'minimal') JS bits, noting that we can't yet use OMIT_WINDOWFUNC (for the C parts) without a custom amalgamation. Currently at 604kb.
stephan [Thu, 25 Jul 2024 14:00:26 +0000 (14:00 +0000)]
More work on the minimal-mode wasm build (now 603kb uncompressed). Remove the hard-coded feature-enable flags from sqlite3-wasm.c and rely on the build to provide them. Some wasm build cleanup, but attempts to completely overhaul it have been thwarted by my inability to make script-generated makefile code more legible/maintainable than the current eval spaghetti.
stephan [Wed, 24 Jul 2024 23:58:28 +0000 (23:58 +0000)]
wasm minimal build: strip authorizers and JSON support (saves approx 35kb). Strip vtab support from the JS bits but cannot yet strip it from the C bits because that requires a custom-configured sqlite3.c.
Enhance the percentile() extension function to include the median()
variant. Update the implementation to implement its own sorting
algorithm, so that the extension no longer depends on qsort().
stephan [Mon, 22 Jul 2024 21:21:25 +0000 (21:21 +0000)]
Move a block of JS code which was inadvertently (and harmlessly) moved in the previous checkin. Clarify the semantics of an internal-use-only API. Add another WAL-related JS test.
stephan [Mon, 22 Jul 2024 20:58:51 +0000 (20:58 +0000)]
OPFS VFSes: remove the on-open() pragma calls, as those (A) already reflected the build-time default settings and (B) they made it illegal to run locking_mode=exclusive, which is a requirement for WAL mode without shared memory. Modify part of the test suite to demonstrate that the SAHPool VFS can run in WAL mode so long as locking_mode=exclusive is used.
stephan [Sat, 13 Jul 2024 01:02:57 +0000 (01:02 +0000)]
Add an option to the opfs-sahpool VFS which tells it to ignore a previous init failure and retry, as an opt-in workaround for a browser quirk which occasionally denies OPFS access on the first attempt and permits it on subsequent attempts. This resolves [https://github.com/sqlite/sqlite-wasm/issues/79|issue #79 of the npm distribution].
stephan [Fri, 12 Jul 2024 13:49:54 +0000 (13:49 +0000)]
Work around a difficult-to-trigger Atomics API message-passing quirk in the OPFS VFS which appears in rare instances in some browsers when running high I/O loads. This resolves [https://github.com/sqlite/sqlite-wasm/issues/12 | issue #12 of the npm distribution].
stephan [Fri, 12 Jul 2024 13:45:15 +0000 (13:45 +0000)]
sqldiff: if the first db argument does not exist, fail instead of creating an empty db. Resolving that for the second argument is trickier, as discussed in [forum:ec2d429e32 | forum post ec2d429e32].
stephan [Thu, 11 Jul 2024 12:36:28 +0000 (12:36 +0000)]
Proposed workaround for the "errant op" case in the OPFS VFS, as discussed in [https://github.com/sqlite/sqlite-wasm/issues/12 | issue #12 of the npm distribution].
stephan [Thu, 11 Jul 2024 11:04:17 +0000 (11:04 +0000)]
Add an option to force the opfs-sahpool VFS init to re-run after it fails on a first attempt, as a workaround for flaky environments where initial access to OPFS sync access handles is rejected but then permitted on a second attempt. Reported and discussed in [https://github.com/sqlite/sqlite-wasm/issues/79|issue #79 of the npm distribution].
Use a mini Bloom filter to help reduce the number of pointless searches for
prior SubrtnSig objects when generating code for IN operators with subqueries
as their right operand.
Disable the reuse of IN-clause subqueries if the subquery is an explicit
"SELECT ALL". The ALL keyword is almost never used in actual practice (most
developers don't even know it can be used) so this should not interfere with
the optimization, but it does give us a convenient way to turn it off for
testing purposes.
Be more aggressive about reusing subqueries that appear on the RHS of IN
operators that have been replicated due to the predicate push-down optimization.
stephan [Thu, 4 Jul 2024 09:45:23 +0000 (09:45 +0000)]
For shell completion, use pragma_table_xinfo instead of pragma_table_info, so that generated columns are handled, as reported in [forum:f0735e05d8d7e857|forum post f0735e05d8d7e857].
Reword the deliberate_fall_through macro along the lines suggested by
[forum:/forumpost/7ec11023dd|forum post 7ec11023dd] so that it works better
with LLVM, while preserving compatibility with MSVC and older GCCs.
In the CLI, if the XDG_CONFIG_HOME environment variable is not set, then also
search in ~/.config/sqlite3/sqliterc for the initialization file.
See [forum:/forumpost/5cc6d059e9e092ed|forum thread 5cc6d059e9e092ed].
drh [Sat, 29 Jun 2024 12:22:32 +0000 (12:22 +0000)]
Add a NEVER() around a branch in sqlite3ExprAffinity() that is designed to
prevent an infinite loop, but which can now never be reached due to recent
changes.
drh [Fri, 28 Jun 2024 17:14:00 +0000 (17:14 +0000)]
Do not convert an expression node that is already TK_REGISTER into a
new TK_REGISTER. This is a follow-up to [663f5dd32d9db832] that fixes a
bug discovered by dbsqlfuzz.
drh [Wed, 19 Jun 2024 16:38:17 +0000 (16:38 +0000)]
Enhance lemon.c so that when it shows the compile-time options in the header
comment of the generated output file, it shows all options, even those not
used, and it shows them in sorted order.
stephan [Tue, 18 Jun 2024 20:40:11 +0000 (20:40 +0000)]
Add fiddle-debug make target to ext/wasm. It builds the same target files as a non-debug build, as opposed to a new copy, but adds various debug-related flags.
drh [Tue, 18 Jun 2024 12:19:13 +0000 (12:19 +0000)]
Update sqlite3_analyzer to report on the number of WITHOUT ROWID tables and
to provide separate aggregate statistics for WITHOUT and WITH ROWID tables.
drh [Fri, 14 Jun 2024 23:13:54 +0000 (23:13 +0000)]
Do not omit the ORDER BY clause from a recursive CTE just because the
query that contains the CTE also contains an ORDER BY clause. Plus
other changes imported from the recursive-cte-orderby-fix branch.
stephan [Wed, 12 Jun 2024 22:15:25 +0000 (22:15 +0000)]
Remove some dead JS code. Improve the exception-to-C-result-code conversion to account for the case of a file disappearing while the OPFS VFS is waiting to acquire a lock on it.
stephan [Wed, 12 Jun 2024 12:36:02 +0000 (12:36 +0000)]
OPFS VFS: change the xCheckReservedLock() impl to always return false, as discussed in [forum:a2f573b00cda1372|forum thread a2f573b00cda1372]. This does not impact any current tests, and may have no direct impact at all because of how that VFS handles locking, but is hypothetically a more correct solution than the previous one.
drh [Tue, 11 Jun 2024 14:36:56 +0000 (14:36 +0000)]
Change constant expressions to pre-computed constants, because apparently
MSVC on ARM requires that.
[forum:/forumpost/4feb1685cced0a8e|Forum thread 4feb1685cced0a8e].
drh [Mon, 10 Jun 2024 12:43:03 +0000 (12:43 +0000)]
Improved header comment on the sqlite3FpDecode() implementation.
For the fpdecode() SQL function (available in debug builds only) limit
the value of the third parameter (mxRound) to be positive.