drh [Thu, 9 Jun 2022 16:19:01 +0000 (16:19 +0000)]
The subtype of a value should not propagate across a subquery boundary.
Proposed fix for the problem reported by
[forum:/forumpost/3d9caa45cbe38c78|forum post 3d9caa45cbe38c78].
Additional works is needed as not all cases are covered.
drh [Wed, 8 Jun 2022 15:38:16 +0000 (15:38 +0000)]
Fix the query flattener so that it refuses a flattening that might leave both
an inner-join and outer-join ON-clause constraint (or equivalent) on the same
term of the FROM clause.
drh [Wed, 8 Jun 2022 15:30:39 +0000 (15:30 +0000)]
Add restriction (29) to the query flattener - do not allow flattening that
would leave both EP_InnerON and EP_OuterON constraints on the same join term.
drh [Wed, 8 Jun 2022 12:46:58 +0000 (12:46 +0000)]
Do not allow a partial index scan on the left table of a RIGHT JOIN, because
since the index is partial, some rows will be omitted from the scan, and
those rows will subsequently be picked up by the no-match logic in the
right-join post-processing loop.
[forum:/forumpost/c4676c4956|forum post c4676c4956].
drh [Tue, 7 Jun 2022 10:14:22 +0000 (10:14 +0000)]
Preserve the database encoding on the CAST operator in the
sqlite3ValueFromExpr() routine.
[forum:/forumpost/800eecf5e6cdc3f4|Forum thread 800eecf5e6cdc3f4].
Test case in TH3.
drh [Mon, 6 Jun 2022 15:27:42 +0000 (15:27 +0000)]
Do not allow a WHERE clause constraint to be used to drive an index for
the right operand of a RIGHT JOIN, since this can cause problem if the
constraint implies a not-NULL value for one of the columns for the left
operand of the same join. See
[forum:/forumpost/206d99a16dd9212f|forum post 206d99a16dd9212f].
stephan [Mon, 6 Jun 2022 04:09:44 +0000 (04:09 +0000)]
shell: in WASM mode, permit ATTACH because the filesystem is a virtual sandbox and ATTACH can be used to provide more import/export options. Minor doc updates in sqlite3-api.js.
dan [Thu, 2 Jun 2022 16:26:21 +0000 (16:26 +0000)]
Fix a problem with flattening and window functions causing an "IS <column>" to be transformed to "IS TRUE" or "IS FALSE" when <column> is a view or sub-select expression that is the literal value "TRUE" or "FALSE".
drh [Wed, 1 Jun 2022 16:05:25 +0000 (16:05 +0000)]
Ensure that subqueries associated with row-values are invoked before being
used when processing a RIGHT JOIN. Fix for the problem described by
[forum:/forumpost/087de2d9ec87305b|forum post 087de2d9ec87305b].
stephan [Wed, 1 Jun 2022 16:04:29 +0000 (16:04 +0000)]
fiddle: added another UI element to the list of those which are disabled during long-running activities. Added DB.close() binding to the Worker-based wasm binding.
drh [Wed, 1 Jun 2022 11:05:59 +0000 (11:05 +0000)]
Move the sqlite_offset() function implementation to be an in-line function,
thereby avoiding special case code and freeing up a bit in the
FuncDef.flags field.
stephan [Wed, 1 Jun 2022 08:09:06 +0000 (08:09 +0000)]
Initial proof of concept code for a JavaScript binding which runs in the main window thread but acts on a db handle running in a Worker thread. Expanded the DB.exec() and DB() constructor to simplify certain use cases.
stephan [Tue, 31 May 2022 02:03:29 +0000 (02:03 +0000)]
Updated the wasm builds to generate gzip'ed copies of relevant files to take advantage of althttpd's new capability of substituting gzip files in place of requested files. This cuts over-the-wire size of the fiddle app by more than half.
drh [Mon, 30 May 2022 17:33:22 +0000 (17:33 +0000)]
For an outer join, then ON-clause constraints need to be evaluated at just
the right moment - not too early and not too late. Fix for the problem
reported by [forum:/forumpost/3902c7b833|forum post 3902c7b833].
stephan [Sat, 28 May 2022 11:59:46 +0000 (11:59 +0000)]
fiddle: changed the internal key of the session/local storage to avoid conflicts with the pikchr fiddle app (which is derived from this one) when running from the same HTTP origin as an instance of that app in a dev environment.
stephan [Fri, 27 May 2022 03:27:10 +0000 (03:27 +0000)]
fiddle: added an option to completely wipe/reset the db. The Options area can now be toggled on/off via tapping the label at its top. Running the input SQL is now limited to the selected area if any text is currently selected, per suggestion in the forum.
stephan [Thu, 26 May 2022 05:08:25 +0000 (05:08 +0000)]
Makefile.in: added explanations, intended for maintainers and hackers, of the various emcc flags used for building the wasm files. No code or build rule changes.
drh [Wed, 25 May 2022 12:49:59 +0000 (12:49 +0000)]
Do not allow the right operand of a RIGHT JOIN to be reordered with other
FROM clause terms that are even further to the right. Fix for the issue
identified by [forum:/forumpost/5cfe08eed6|forum post 5cfe08eed6].
stephan [Wed, 25 May 2022 08:51:07 +0000 (08:51 +0000)]
Got the sqlite3-api JS bits wrapped up in deferred-load module. Whether that's going to be easier to use, in practice, remains to be seen. Consolidated two of the test-related JS files.
stephan [Tue, 24 May 2022 22:16:12 +0000 (22:16 +0000)]
fiddle: added support for exporting (downloading) the current db file. To do this we had to fall back to named dbs, instead of defaulting to an in-memory one, but the virtual filesystem is an in-memory FS, so the end effect is the same.
drh [Tue, 24 May 2022 16:05:41 +0000 (16:05 +0000)]
When an ON clause on an INNER JOIN references a table to the right of
of the join, just convert the ON clause to an ordinary WHERE clause term,
in order to be compatible with older versions of SQLite. See
[forum:/forumpost/687b0bf563a1d4f1|forum thread 687b0bf563a1d4f1] for details.
stephan [Tue, 24 May 2022 14:36:45 +0000 (14:36 +0000)]
fiddle: lots of generic refactoring, restructuring, and cleanup in the higher-level code. Added push-fiddle ext/fiddle/Makefile target to push the fiddle app to a remote server via rsync.
drh [Mon, 23 May 2022 12:37:54 +0000 (12:37 +0000)]
New test cases to further demonstrate the difference in name matching rules
for LEFT JOIN versus RIGHT JOIN that protect legacy behavior.
[forum:/forumpost/e90a8e6e6fa652ac|Forum thread e90a8e6e6fa652ac].
drh [Mon, 23 May 2022 10:57:20 +0000 (10:57 +0000)]
Do not run the subroutine that materializes a view or subquery until just
before the materialization is actually needed, so that if the materialization
turns out to never been needed, unnecessary work can be avoided.
stephan [Mon, 23 May 2022 01:11:49 +0000 (01:11 +0000)]
WASM: removed the in64-related bindings, as MDN says that calling a wasm function which has an int64 type in its signature will currently throw because JS has no 64-bit integer support. Those bindings now use doubles and simply hope that the user doesn't exceed their integer precision (2^53-1, approx 9 quadrillion).
stephan [Sun, 22 May 2022 19:09:59 +0000 (19:09 +0000)]
Implemented Stmt.get() and friends for WASM OO #1 wrapper. Added basic tests for prepare/step/get. Restructured module init output to introduce only 1 global-scope symbol instead of 2.
stephan [Sun, 22 May 2022 16:25:43 +0000 (16:25 +0000)]
WASM: added bindings for sqlite3_compileoption_get/used(), moved OO #1 into sqlite3-api.js since it can only be used from the same thread as that API and separating them complicates client-side use. Started adding test utilities and tests for the OO1 API.