drh [Fri, 17 Jun 2022 15:11:31 +0000 (15:11 +0000)]
Fix the virtual table detection mechanism to avoid false-positives that were
blocking all failures. Then fix a few of the additional problems that are
revealed by that fix. More fixes are needed.
drh [Fri, 17 Jun 2022 12:25:33 +0000 (12:25 +0000)]
Fix the new --query-invariants option on fuzzcheck so that it does not
use an unprotected sqlite3_value object as an argument to sqlite3_value_int64().
drh [Wed, 15 Jun 2022 14:57:04 +0000 (14:57 +0000)]
When running an incremental vacuum, detect growth in the size of the database
file (which can only occur if the file is corrupt) and fail with SQLITE_CORRUPT.
drh [Wed, 15 Jun 2022 12:32:27 +0000 (12:32 +0000)]
Dbsqlfuzz discovered a case where a bytecode branch is in fact taken, so change
the designator from VdbeCoverageNeverTaken() to VdbeCoverage(). Test case
in TH3.
drh [Mon, 13 Jun 2022 12:42:24 +0000 (12:42 +0000)]
Do not remove the EP_CanBeNull flag from expressions during a LEFT JOIN
strength reduction if the query also contains a RIGHT JOIN. Fix for
the problem identified by
[forum/forumpost/b40696f50145d21c|forum post b40696f50145d21c].
drh [Fri, 10 Jun 2022 16:41:54 +0000 (16:41 +0000)]
The same restrictions on the use of WHERE clause terms to drive indexes
in the presence of RIGHT JOINs also apply to the use of WHERE clause terms
to manufacture automatic indexes. This fixes a problem identified by
[forum:/forumpost/51e6959f61|forum post 51e6959f61].
stephan [Fri, 10 Jun 2022 15:43:03 +0000 (15:43 +0000)]
fiddle: minor style tweaks, including using swapped colors for the input/output fields to help (hopefully) reduce the "which field is which?" dissonance.
drh [Fri, 10 Jun 2022 11:28:52 +0000 (11:28 +0000)]
Do not allow constant propagation between WHERE-clause terms and ON-clause terms
as this can confuse RIGHT JOIN. Fix for the problem reported by
[forum:/forumpost/8e4c352937e82929|forum post 8e4c352937e82929].
drh [Thu, 9 Jun 2022 20:26:06 +0000 (20:26 +0000)]
Do not allow the subtype of a value to cross a subquery boundary. This
fixes the problem identified by
[forum:/forumpost/3d9caa45cbe38c78|forum post 3d9caa45cbe38c78].
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.