drh [Tue, 18 Oct 2022 22:37:07 +0000 (22:37 +0000)]
If a virtual column whose value is constant gets indexed, do not include
that column in the IndexedExpr list.
dbsqlfuzz 59ac17a99b9a5c4930ee71cc153c9428a0c0e794
drh [Tue, 18 Oct 2022 10:27:06 +0000 (10:27 +0000)]
Fix sqlite3VdbeRecordCompareWithSkip() so that it sorts the internal-use
serial-type of 10 together with NULLs.
dbsqlfuzz 5ff35e9d49a5fcca5051e23960ff2f483a538bab
stephan [Mon, 17 Oct 2022 16:47:59 +0000 (16:47 +0000)]
Repair version-info.c after a local mishap caused all of the intended edits from [36e197cb3d0c]/[e9b407a4d0a0] to get deleted before checkin. Simplify version-info build (only requires sqlite3.h, not the library).
drh [Mon, 17 Oct 2022 16:09:33 +0000 (16:09 +0000)]
Fix a potential call to strlen() with a null argument in the command-line shell
following an OOM error. [forum:/forumpost/9c4f2ebe22|forum post 9c4f2ebe22].
stephan [Sun, 16 Oct 2022 18:50:55 +0000 (18:50 +0000)]
Add aggregate function support to sqlite3.oo1.DB.createFunction(). Change signature of the options object used by that function so that the callback property names match those of the corresponding C APIs.
dan [Fri, 14 Oct 2022 19:30:34 +0000 (19:30 +0000)]
Fix a problem with using the push-down optimization on compound SELECTs where component SELECTs use different collation sequences. dbsqlfuzz 11516f050100243e5a845f5a2b48a90ed2efaf2e.
dan [Fri, 14 Oct 2022 15:10:36 +0000 (15:10 +0000)]
Fix a problem in the LIKE and GLOB operators that may occur when the character immediately following a "%" or "*" wildcard is U+80. Reported by [forum:61bf7ccbdf].
drh [Thu, 13 Oct 2022 21:08:34 +0000 (21:08 +0000)]
This experimental branch attempts to use columns for an index-on-expression
in place of the expression that is being indexed. This particular check-in
mostly works, but there are still issues.
stephan [Thu, 13 Oct 2022 16:48:35 +0000 (16:48 +0000)]
Move the rest of testing1.js into tester1.js and eliminate the dependency on jaccwabyt_test.c. Extend the list of default config-related #defines in sqlite3-wasm.c and reorganize them for maintainability.
drh [Thu, 13 Oct 2022 15:09:44 +0000 (15:09 +0000)]
Optimize the IS NULL and IS NOT NULL operators so that they avoid loading
large strings or blobs off of disk if all it needs to know is whether or
not the string or blob is NULL.
drh [Thu, 13 Oct 2022 12:47:33 +0000 (12:47 +0000)]
Proposed optimization to the IS NULL and NOT NULL operators that avoids
loading the entire content of larges strings and BLOBs. Response to
[forum:/info/3c08d4715dc05b00|forum post 3c08d4715dc05b00].
drh [Tue, 11 Oct 2022 12:02:42 +0000 (12:02 +0000)]
Improved the ability of the CLI to handle very long input lines.
Potentially a fix for the bug reported by
[forum:/forumpost/fa4bb2941a|forum post fa4bb2941a].
drh [Mon, 10 Oct 2022 23:54:17 +0000 (23:54 +0000)]
Enhance the "PRAGMA integrity_check" statement so that it verifies datatype
constraints on non-STRICT tables: (1) Columns with TEXT affinity should not
contain numeric values, and (2) columns with NUMERIC affinity should not
contain TEXT values that could be converted into numbers.
drh [Mon, 10 Oct 2022 18:25:05 +0000 (18:25 +0000)]
An attempt to enhance PRAGMA integrity check so that it does data type
checking on non-STRICT tables. Specifically: (1) Columns with TEXT affinity
should not contain numeric values, and (2) columns with numeric affinity should
not contain text values that can be converted to numeric.
drh [Mon, 10 Oct 2022 12:02:53 +0000 (12:02 +0000)]
Improved detection of database corrupting when moving pages on an
autovacuumed database when creating a new btree.
dbsqlfuzz 9a55397eae13cec64aebf1fd35489c3a90bdaac5
stephan [Sun, 9 Oct 2022 13:26:15 +0000 (13:26 +0000)]
Refactor kvvfs JS bits to make use of [ea370b9b05f7ed7eaa]. At main-thread startup, if kvvfs is available, replace the kvvfs I/O methods with JS impls. Checkin part 2 of 2, to account for cherrypicking [ea370b9b05f7ed7eaa] into the kv-vfs branch.
stephan [Sun, 9 Oct 2022 13:19:27 +0000 (13:19 +0000)]
Refactor os_kv.c so that the kvvfs read/write/delete methods can be swapped out at runtime by JS implementations. This eliminates the kvvfs dependency on Emscripten. Checkin part 1 of 2, to account for cherrypicking.
dan [Fri, 7 Oct 2022 18:57:15 +0000 (18:57 +0000)]
Fix a problem causing the seek-scan optimization to skip over valid rows that could occur when it is used with expressions of the form (a IN (?,?..) AND b >= ?). dbsqlfuzz ab1db6dc0efb04cba1cd3431ee6da4894fdc4520.
dan [Thu, 6 Oct 2022 14:10:11 +0000 (14:10 +0000)]
Fix a problem that occurred when using a bloom filter to optimize an (ipk = ?) lookup in the case where the RHS of the expression is a TEXT value. First reported by [forum:/forumpost/f61a8b7053|forum post f61a8b7053].
drh [Tue, 4 Oct 2022 14:50:46 +0000 (14:50 +0000)]
Attempt to clarify the operation of the xLock and xUnlock VFS I/O methods.
Assert() statements added to prove that they behave as the documentation says.
drh [Tue, 4 Oct 2022 10:35:10 +0000 (10:35 +0000)]
Change the name of the autoconf-generated configuration file from "config.h"
to "sqlite_cfg.h" to work around a bug in a dependency checker, reported
in [https://twitter.com/josecastillo/status/1577136108097314816|a tweet from Jose Castillo].
stephan [Tue, 4 Oct 2022 00:54:00 +0000 (00:54 +0000)]
Add a test/debug mechanism to shut down the OPFS async listener so that it can be inspected (it normally can't be because its tight event-listening loop ties up the thread) and then restarted.
stephan [Mon, 3 Oct 2022 13:03:41 +0000 (13:03 +0000)]
Export sqlite3_trace_v2() to wasm and use it to ensure that the new per-VFS post-open SQL support in the DB ctor works. Default opfs vfs to journal_mode=truncate, as it's faster in that mode. Add 't' DB open-mode flag to enable SQL tracing to console.log().
stephan [Mon, 3 Oct 2022 11:33:35 +0000 (11:33 +0000)]
Experimentally relinquish the OPFS VFS sync access handle when the db is idle and reacquire it on demand, the goal being to help alleviate cross-tab locking issues.
stephan [Mon, 3 Oct 2022 09:21:37 +0000 (09:21 +0000)]
OPFS VFS now lazily opens its sync access handle, as a step towards experimenting with relinquishing it during idle times to help avoid cross-tab and page-reload locking issues.
stephan [Sun, 2 Oct 2022 22:50:04 +0000 (22:50 +0000)]
More cleanups in the UDF argument and result handling, in particular int64. Consolidate some duplicate int64/bigint range checking code. Expose the UDF low-level utilities (arg/result conversion) to client code. Add the sqlite3_context pointer to the JS-side UDF wrappers for API consistency.
stephan [Sun, 2 Oct 2022 20:08:53 +0000 (20:08 +0000)]
JS: clean up create_function() wrapper and add support for create_window_function(). Eliminate an extraneous blob copy when a UDF returns a blob. Make use of newfound JS-fu to clean up how sqlite3ApiBootstrap() config is initialized.
stephan [Sun, 2 Oct 2022 18:47:39 +0000 (18:47 +0000)]
js: implement a hand-written wrapper for sqlite3_create_function_v2() which converts, if necessary, JS-function-type args to WASM function wrappers. Replace DB.createFunction() impl with the new one.