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.
stephan [Sun, 22 May 2022 00:27:19 +0000 (00:27 +0000)]
Build refactoring for the fiddle/wasm bits. Set up wasm binding of a chunk of the core C API and added some infastructure for creating test pages for it.
stephan [Sat, 21 May 2022 21:13:44 +0000 (21:13 +0000)]
Minor fiddle-related build restructuring to support upcoming development of the C-style wasm sqlite3 interface, plus some commentary about the plans and goals for that.
drh [Sat, 21 May 2022 15:12:41 +0000 (15:12 +0000)]
Use the newer OP_BeginSubrtn opcode instead of OP_Integer to start the
subroutine used to matrialize a view. This does not change execution but
does make the byte code a little easier to read.
stephan [Sat, 21 May 2022 14:19:05 +0000 (14:19 +0000)]
fiddle: refactor into main thread (UI) and worker thread (wasm module). Added bits needed to support triggering sqlite3_interrupt() but do not yet have a second SharedWorker to test it with.
stephan [Sat, 21 May 2022 00:01:45 +0000 (00:01 +0000)]
In the shell WASM build, call open_db() early so that we can get access to the global db handle from certain experimentation-only function without having to first run some SQL code.
stephan [Thu, 19 May 2022 16:49:15 +0000 (16:49 +0000)]
When building fiddle from its own directory (e.g. from emacs instead of the normal build process), force -O0 the sake of compilation speed. The top-level build now defaults to -Oz, which is more appropriate for that case.
stephan [Thu, 19 May 2022 15:58:13 +0000 (15:58 +0000)]
Numerous layout tweaks, the most significant being that the layout now adapts to the window size. Swapped positions of the input/output areas. This version supports, by uncommenting a few bits, a jquery.terminal-based view but alternatives to that 300kb dependency are still under investigation.
stephan [Thu, 19 May 2022 10:38:54 +0000 (10:38 +0000)]
Ensure that the output area is cleared of any init-time messages which the emscripten bootstrapping process emits when downloading of the wasm module is slow.
stephan [Thu, 19 May 2022 09:55:14 +0000 (09:55 +0000)]
Split the fiddle JS code into separate pre-/post-init files to simplify editing. emcc will combine these into the final fiddle.js, so the number of output deliverables does not change.
stephan [Wed, 18 May 2022 22:58:34 +0000 (22:58 +0000)]
In wasm builds, ifdef out shell commands which require file I/O, pipes, or which trigger an exit() (.quit and .exit). Documented some of the quirks and limitations of the C/WASM crossover. Keep the JS code from calling into the C code after an exit() has been triggered.
stephan [Wed, 18 May 2022 21:18:21 +0000 (21:18 +0000)]
Improved handling/reporting of conditions which trigger an exit() from native code, e.g. calling the '.read' command. Added a Help button which simply submits the '.help' command. Added commented-out variants of various -Ox flags to simplify experimenting with them.
drh [Sat, 14 May 2022 19:05:13 +0000 (19:05 +0000)]
Do not allow an index scan on an index-on-expression for a RIGHT JOIN because
the index might not be positioned on the correct row when running the
the right-join no-match loop.
dbsqlfuzz 39ee60004ff027a9e2846cf76e02cd5ac0953739
drh [Sat, 14 May 2022 15:59:42 +0000 (15:59 +0000)]
Improvements to the decision of when to check ON constraints for an inner
join that is an operand to a RIGHT JOIN. Fix for issue identify by
[forum:/forumpost/c06b10ad7e|forum post c06b10ad7e].
drh [Fri, 13 May 2022 19:50:29 +0000 (19:50 +0000)]
Walk back the optimization from check-in [cc458317bd77046c] that tries to
reuse the same ephemeral cursor of a list subquery when that subquery is
reused, as it does not work in cases where the list subquery is used both
for lookups and for scans.
drh [Fri, 13 May 2022 17:45:52 +0000 (17:45 +0000)]
Defer generating WHERE clause constraints for a RIGHT JOIN until after the
ON-clause processing for the RIGHT JOIN has done its own row elimination.
This fixes and incorrect output from some RIGHT JOINs that was identified
by [forum:/forumpost/41cc3851d864c5e6|forum post 41cc3851d864c5e6].
drh [Fri, 13 May 2022 15:31:30 +0000 (15:31 +0000)]
New test cases for outer joins. Case joinE-32 currently gets an incorrect
answer. See [forum:/forumpost/41cc3851d8|forum post 41cc3851d8] for the bug
report.
drh [Thu, 12 May 2022 11:45:20 +0000 (11:45 +0000)]
Add IS NOT DISTINCT FROM and IS DISTINCT FROM binary operators which are
equivalent to IS and IS NOT, respectively, for compatability with PostgreSQL
and hence standard SQL.
larrybr [Wed, 11 May 2022 19:59:31 +0000 (19:59 +0000)]
Change .echo on effect so that SQL is echoed before prepare. This slightly alters echoed output when multiple SQL statements are submitted at once. Also sync with trunk.
drh [Wed, 11 May 2022 16:46:27 +0000 (16:46 +0000)]
For the unix VFS, rewrite the xFullPathname method so that it automatically
resolves all symbolic links, rendering a canonical pathname that contains
no symlinks.
drh [Fri, 6 May 2022 00:43:06 +0000 (00:43 +0000)]
Prevent an infinite loop on SQLITE_ERROR_RETRY when trying to modify a
corrupt schema while PRAGMA writeable_schema=ON is active.
dbsqlfuzz ded83609f475cc989c7339d45efb5151c1495501