drh [Sat, 12 May 2018 23:56:22 +0000 (23:56 +0000)]
In the CLI, allow comment lines that begin with '#', but only in a context
where a dot-command is allowed. In other words, '#' at the beginning of a
line in the middle of an SQL statement is just part of the SQL.
drh [Wed, 9 May 2018 13:46:26 +0000 (13:46 +0000)]
Make the internal dynamic string interface available to extensions using
the new sqlite3_str object and its associated methods. This is mostly just
a renaming of internal objects and methods to use external names, through
there are a few small wrapper functions.
drh [Mon, 7 May 2018 11:48:22 +0000 (11:48 +0000)]
On an UPDATE, try to overwrite an existing btree cell with the modified
content, if the old and new cell are the same size. Use memcmp() first
to avoid dirtying pages that are unchanged.
drh [Sat, 5 May 2018 16:50:35 +0000 (16:50 +0000)]
In an ORDER BY LIMIT, make sure the ORDER BY expression evaluator does not
try to reuse values from the result set if the result set has not yet
be computed. This fixes a bug in the recent deferred-row loading
optimization, check-in [c381f0ea57002a264fd958b28e].
OSSFuzz discovered the problem.
drh [Thu, 3 May 2018 23:20:06 +0000 (23:20 +0000)]
In ORDER BY LIMIT queries, try to evaluate the ORDER BY terms first, and it
it becomes clear that the row will not come in under the LIMIT, then skip
evaluation of the other columns.
drh [Thu, 3 May 2018 21:51:30 +0000 (21:51 +0000)]
Improved security for VACUUM. This check-in combines the fixes
of [ab0d99d0b5ede] and [27754b74ddf646] in a way that is less likely to
to be broken by future changes.
drh [Thu, 3 May 2018 19:56:50 +0000 (19:56 +0000)]
Overhaul of EXPLAIN QUERY PLAN. The output is now in the form of a tree.
More details of the query plan are shown, and what is shown is truer to what
actually happens.
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 18:00:17 +0000 (18:00 +0000)]
Fix test cases so that they work with the new EXPLAIN QUERY PLAN output
format. Only some of the cases have been fixed. This is an incremental
check-in.
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.