drh [Thu, 3 May 2018 03:59:02 +0000 (03:59 +0000)]
The sqlite3BtreeInsert() routine tries to overwrite an existing cell with
modified content if the new content is the same size. Pages are only dirtied
if they change. This prototype works some, but still has issues.
drh [Wed, 2 May 2018 15:00:26 +0000 (15:00 +0000)]
Prevent VACUUM from running any commands in sqlite_master.sql other than
CREATE statements. That is all that should be there anyhow. This fixes
a problem discovered by OSSFuzz. Test cases in TH3.
dan [Wed, 2 May 2018 08:12:22 +0000 (08:12 +0000)]
Fix a problem in the xBestIndex method of the closure extension causing it to
allocate non-contiguous argvIndex values in some cases (an "xBestIndex
malfunction" error).
drh [Tue, 1 May 2018 18:39:31 +0000 (18:39 +0000)]
The SQLITE_ALLOW_SQLITE_MASTER_INDEX compile-time option allows a CREATE INDEX
statement against the sqlite_master table. Once created, the index works, and
is usable by legacy instances of SQLite.
dan [Sat, 28 Apr 2018 18:20:01 +0000 (18:20 +0000)]
Fix an RBU problem causing spurious SQLITE_CONSTRAINT errors when restarting
an RBU update in which more than one source table writes to a single target
database table.
Add the SQLITE_DBCONFIG_RESET_DATABASE control for resetting a corrupt
database file without closing any database connections. Added the
".dbconfig" command to the CLI.
Add the SQLITE_DBCONFIG_RESET_DATABASE control as a replacement for
the reset_database pragma. Resetting the database should be hard enough
to do that it cannot be done by accident.
Add the "PRAGMA reset_database=ON|OFF" command. When on, it causes the
database to appear to be empty, causing the next transaction to reset it to
an empty database.
The previous fix for ticket [d85fffd6ffe856092ed8da] in check-in
[0a514e62ad1ebe5c12da8dae] did not completely address the
probably in that it only worked for cases where the OP_SCopy that loaded
the register was the last instruction in the sequence for the expression, which
is not necessarily the case for expressions like CASE...END. This revision
prevents the registered that will be recomputed from being cached in the first
place.
dan [Thu, 26 Apr 2018 17:43:35 +0000 (17:43 +0000)]
When processing an "ORDER BY ... LIMIT" that does not use an index, check
whether or not a record may appear in the final result set before adding it to
the temp b-tree used for sorting.
dan [Thu, 26 Apr 2018 16:13:47 +0000 (16:13 +0000)]
When processing an "ORDER BY ... LIMIT" that does not use an index, check
whether or not a record may appear in the final result set before adding it to
the sorter.
Ensure that new.* values of an UPDATE do not get clobbered after the
BEFORE triggers run when unmodified columns of the row being updated are
reloaded. Fix for ticket [d85fffd6ffe856092ed8da]
Clarification of the behavior of a BEFORE UPDATE trigger when the trigger
changes the values of some of the columns used to compute new columns in
the UPDATE.
Add the new SQLITE_SHELL_INIT_PROC compile-time entry point to the CLI. This
is needed to work around the tighter sqlite3_config() constraints now in the
CLI.
dan [Tue, 24 Apr 2018 14:05:14 +0000 (14:05 +0000)]
Do not attempt to read values from indexes-on-expressions if the index is on
the RHS of a LEFT JOIN. This won't work if the index cursor points at a
null-row. Fix for [7fa80496].
Enhance the CLI to render EXPLAIN QUERY PLAN using an ASCII-art graph.
This works with ".eqp" modes and when the query begins with exactly
"EXPLAIN QUERY PLAN". To see the original output format, add extra space
characters in between words of the initial "EXPLAIN QUERY PLAN".
In EXPLAIN QUERY PLAN output, do not show an EXECUTE LIST SUBQUERY line for
IN operators where the RHS is a list and not a subquery, since in that case
there is no SUBQUERY to execute.
The ".selecttrace 0x2000" command causes just the top-level parse tree to
be displayed, after all transformations, and showing the EQP iSelectId at
each level.
Enhance LEMON to track which symbols actually carry semantic content.
Output the list of symbols that do not carry content at the end of the
report, but do not (yet) do anything else with the information.
dan [Fri, 20 Apr 2018 15:34:08 +0000 (15:34 +0000)]
Add test cases for UPSERT. And a fix for a "REPLACE INTO ... ON CONFLICT"
statement where the new row conflicts with both the IPK and the ON CONFLICT
indexes.
Fix the handling of "PRAGMA count_changes=ON" with UPSERT. Also improved
the implementation of count_changes in other places, without changing the
behavior.
dan [Thu, 19 Apr 2018 20:06:10 +0000 (20:06 +0000)]
Modify a test case in zipfile2.test to take into account that with some
platform/file-system combinations it is possible to fopen() and fread() (but
not fwrite()) a directory.
Add the ext/misc/tmeplatevtab.c template for virtual tables. This is a
work-in-progress as it still needs improvements to the comments in order to
be useful as a template.
Fix the table name aliasing on INSERT so that it occurs before the column list
rather than afterwards, just as it does for PostgreSQL. Add table name
aliasing to UPDATE and DELETE.
dan [Wed, 18 Apr 2018 19:56:14 +0000 (19:56 +0000)]
Add the "sorter-reference" optimization, allowing SQLite to be configured so
that some required values may be loaded from the database after external
sorting occurs for SELECT statements with ORDER BY clauses that are not
satisfied by database indexes.
Fix a problem in the sqlite3ExprCompare() function that caused two
dissimilar expressions to match if they have the same "COLLATE name" at
the outer layer.
Fixes to the logic for constraint check reordering during upsert.
Improved comments on constraint check bytecode. Add an assert that
prevents the same label from being resolved more than once.