drh [Sat, 26 May 2018 16:00:26 +0000 (16:00 +0000)]
Store application-defined function names as lower-case to avoid the need
for case conversions before calling xFindFunction on virtual tables.
Avoid using lookaside to store the destructors for application defined
functions, as lookaside should be reserved for transient allocations.
drh [Thu, 24 May 2018 23:51:57 +0000 (23:51 +0000)]
When doing a one-pass UPDATE or DELETE on virtual tables, close the cursor
prior to running VUpdate. This allows one-pass to work on virtual tables
that do not allow concurrent reads and writes. Enhance rtree to take
advantage of this new capability.
drh [Thu, 24 May 2018 22:31:01 +0000 (22:31 +0000)]
Do not allow RTree writes when a read cursor is active on the same virtual
table, as the writes might rebalance and disrupt the read cursors. Return
the new SQLITE_LOCKED_VTAB error code if this happens.
drh [Thu, 24 May 2018 17:38:00 +0000 (17:38 +0000)]
In the OOM testing logic, add the sqlite3FirstFault() routine as a place to
set a breakpoint the first time any simulated OOM fault occurs for a single
test case.
drh [Wed, 23 May 2018 16:50:21 +0000 (16:50 +0000)]
Verify that the sqlite_sequence table exists and is in approximately the
correct format prior to using it to process an autoincrement table.
Fix for ticket [d8dc2b3a58cd5dc2918a1d4a].
drh [Wed, 16 May 2018 17:57:30 +0000 (17:57 +0000)]
Initial implementation of the ability to have auxiliary columns in an rtree
virtual table that store arbitrary content. It mostly works, but there are
some minor issues in OOM corner cases.
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]