stephan [Sun, 21 Sep 2025 00:59:23 +0000 (00:59 +0000)]
Resolve the non-functional 64-bit JS vtabs and VFSes. All wasm tests now pass on a 64-bit build. Investigation of the fiddle failure on a second db import is still pending.
stephan [Sat, 20 Sep 2025 22:11:19 +0000 (22:11 +0000)]
Add missing sqlite3_vtab::xIntegrity wasm mapping. Correct signatures for the (unused) xDlOpen and xDlError bindings. Disable OPFS-related tests in tester1.js in 64-bit builds.
stephan [Sat, 20 Sep 2025 22:10:59 +0000 (22:10 +0000)]
Add missing sqlite3_vtab::xIntegrity wasm mapping. Correct signatures for the (unused) xDlOpen and xDlError bindings. Disable OPFS-related tests in tester1.js in 64-bit builds.
stephan [Sat, 20 Sep 2025 20:23:59 +0000 (20:23 +0000)]
Further tweaks towards 64-bit wasm. Fiddle is failing intermittently from the C level when importing a db and it's not yet clear what's happening there.
stephan [Sat, 20 Sep 2025 20:17:17 +0000 (20:17 +0000)]
Improve deps handling of fiddle's gzipped output files to help avoid stale gz files during development (althttpd will prefer those over the uncompressed ones). Only compress the larger files, not the small html/js pieces.
stephan [Sat, 20 Sep 2025 03:02:36 +0000 (03:02 +0000)]
Get about 1/3rd of the tests running with MEMORY64=1, but the code noise level added by the BigInt/Number discrepancy is making this very unattractive. There are apparently irreconcilable differences between MEMORY64=1 and 2, in that they have different argument type expectations for methods such as WebAssembly.Table.get(), where MEMORY64=1 requires a BigInt a MEMORY64=2 requires a Number. We have no way to make that distinction from the JS code, and don't know what other APIs are affected by that quirk.
stephan [Fri, 19 Sep 2025 23:21:00 +0000 (23:21 +0000)]
Initial experimentation with a -sMEMORY64=1 wasm build (full 64-bit). This compiles but does not pass tests due to friction between BigInt and Number types (e.g. Number(null)===0 but BigInt(null) throws, many functions are fussy about which of those types they'll take, and we cannot simply mix and match the two types transparently (1n+1 is not legal (but 1n>=1 is), so we can no longer do pointer arithmatic without hoop-jumping)). The library bootstraps but it's failing early on in tests due to this friction.
stephan [Fri, 19 Sep 2025 19:28:13 +0000 (19:28 +0000)]
Initial build-side tweaks to pave the way for a 64-bit WASM build. Such a build does not yet work for reasons given in the makefile comments, but is an eventual goal.
Improve imposter tables: (1) Read-only unless writeable_schema=ON
(2) --unsafe-testing no longer required (3) Does not interfere with
PRAGMA integrity_check.
stephan [Fri, 19 Sep 2025 17:24:47 +0000 (17:24 +0000)]
Diverse cleanups and docs in the JS and kvvfs pieces. Functional changes: (A) ensure that the 'i32' JS/WASM func arg/result conversion works properly with a 64-bit-memory WASM build (which we neither use nor test but [https://webassembly.org/news/2025-09-17-wasm-3.0/ | the newly-ratified WASM 3.0] brings within potential reach). (B) Fix sqlite3_js_posix_create_file() to not deallocate its input array if the client passes in raw memory (the library has never used it that way but the API permits it).
Improvements to imposter tables: (1) They are read-only unless writable-schema
is enabled. (2) Because they are now read-only, the ".imposter" command
in the CLI no longer requires the --unsafe-testing command-line option.
(3) Imposter tables do not participate in a PRAGMA integrity_check and hence
do not cause false-positive errors. However, you can still do an
integrity_check on the the imposter table itself by naming the imposter
table as the argument to integrity_check.
stephan [Fri, 19 Sep 2025 14:21:09 +0000 (14:21 +0000)]
Wasm: (A) diverse internal doc updates. (B) when generating automated JS-to-WASM function proxies for converters which require an additional middle-man proxy, e.g. sqlite3_exec(), use the client-provided function, not the proxy function, as the cache key, to keep from re-generating the conversion in some common use patterns.
In the date/time functions, a timezone suffix of "+00:00" should work
the same as "Z".
[forum:/forumpost/2025-09-17T10:12:14z|Forum post 2025-09-17T10:12:14z].
stephan [Mon, 15 Sep 2025 14:11:55 +0000 (14:11 +0000)]
Diverse internal cleanups in the JS/WASM pieces. A potential fix for a hypothetical db-close-time resource leak of a subset of automated JS-to-WASM function conversions in Safari. That browser exposes WASM-exported functions via nullary wrappers, which causes a handful of them to misbehave (not clean up) at sqlite3_close_v2()-time.
stephan [Sun, 14 Sep 2025 12:14:42 +0000 (12:14 +0000)]
Expose the new sqlite3_set_errmsg() to wasm. Refactor JS's sqlite3__wasm_db_error() to wrap that instead of the WASM-specific routine which previously did that job. This resolves the TODO added in [ead8a3a94e].
Add --enable-dbstat and --enable-dbpage options to configure. Fix the
".dbtotxt" command in the CLI so that it uses the correct filename of
the database it is rendering as text.
Enhance the integerValue() routine in the CLI so that when its text input
specifies an out-of-range integer, the routine returns the nearest integer
that is representable as 64-bit twos-complement.
Fix a harmless compiler warning in the CLI. Gcc generates identical
machine code before and after this change.
[forum:/forumpost/8bda0d896f|Forum post 8bda0d896f].
stephan [Thu, 11 Sep 2025 10:08:19 +0000 (10:08 +0000)]
In mkautoconfamal.sh use $MAKE if it's set so that it can be made to work on platforms where 'make' from the PATH is not usable, e.g. HP-UX's standard make. This means that 'make snapshot-tarball' will inherit that value from the outer makefile and set it appropriate when the in-use make is named gmake.
Do not allow the local_getline() function in the CLI to allocate more
memory than can be counted using a 32-bit integer, thus limiting the
length of an input line to about one gigabyte.
[forum:/forumpost/c83b9affa2|Forum post c83b9affa2].
Add the ability to compile with -DOS_VXWORKS=1 on Linux systems, in an
effort to debug the VxWorks capabilities without actually having to
run VxWorks.
stephan [Fri, 5 Sep 2025 12:14:22 +0000 (12:14 +0000)]
Build portability fixes for HP-UX, reported in [forum:d80ecdaddd885149 | forum post d80ecdaddd8]. The full fix also requires a patch to autosetup/cc-shared.tcl, but that's pending because it's upstream code.
Use Pgno instead of int for the pgno field in the DbpageCursor object.
The same machine code is generated, but using an unsigned value seems
safer in the long run.
[forum:/forumpost/ccec20a858|Forum post ccec20a858].
stephan [Mon, 1 Sep 2025 00:32:43 +0000 (00:32 +0000)]
Fix a line-wrap change made in [50234bc9e9fe58da] which broke the docsrc build by splitting a link reference across two lines, which the doc processor does not like. Problem reported in [forum:ea1fe5f421549899 | forum post ea1fe5f4215].
stephan [Thu, 28 Aug 2025 15:04:52 +0000 (15:04 +0000)]
Remove sqlite3expert.h from the compiler invocation for that tool, as it (A) doesn't need to be there and (B) it causes some compilers problems (as reported in [forum:a1085109e7db4cf3 | forum post a1085109e7]). This bug was faithfully carried over from the legacy build.
dan [Mon, 25 Aug 2025 14:27:31 +0000 (14:27 +0000)]
Check that certain ON clauses do not refer to tables to their right as a separate step after parsing a SELECT statement, instead of as part of the planner stage. For for [forum:ccfb3b5052 | forum post ccfb3b5052].
drh [Fri, 22 Aug 2025 19:17:44 +0000 (19:17 +0000)]
Remember if a SELECT statement contains an ON clause. If it does, then after
name resolution, scan the WHERE clause to verify that the ON clause does not
reference tables to its right.