drh [Tue, 30 Oct 2018 16:25:35 +0000 (16:25 +0000)]
Split the SQLITE_WriteSchema flag in two flags, WriteSchema and
SQLITE_NoSchemaError. Set only WriteSchema on a VACUUM to avoid problems
when trying to vacuum a corrupt database. With this change, the size
of the flags field on sqlite3 must grow from 32 to 64 bytes.
drh [Tue, 30 Oct 2018 15:31:22 +0000 (15:31 +0000)]
Modify the CLI so that the --deserialize option is only available if it is
compiled with SQLITE_ENABLE_DESERIALIZE. DESERIALIZE is now off by default
for the main.mk makefile, but on for Makefile.in and Makefile.msc.
drh [Tue, 30 Oct 2018 14:36:21 +0000 (14:36 +0000)]
In the CLI, when opening a file that begins with the normal SQLite prefix,
open the file as a normal database even if it has a ZIP for AppendVFS record
at the end.
drh [Tue, 30 Oct 2018 13:19:49 +0000 (13:19 +0000)]
Enable sqlite3_deserialize() in the CLI. The --deserialize option associated
with opening a new database cause the database file to be read into memory
and accessed using the sqlite3_deserialize() API. This simplifies running
tests on a database without risk of modifying the file on disk.
dan [Fri, 26 Oct 2018 15:36:53 +0000 (15:36 +0000)]
Prevent an == constraint specified using the table-valued-function argument
syntax from being used to optimize any scan not related to the virtual table
for which it was specified as an argument.
drh [Thu, 25 Oct 2018 14:15:37 +0000 (14:15 +0000)]
In the WHERE-constraint propagation optimization, if there are duplicate
constraint, make sure only one of them propagates. Proposed fix for
ticket [cf5ed20fc8621b165].
dan [Sat, 20 Oct 2018 13:48:09 +0000 (13:48 +0000)]
Add the sqlite3changeset_start_v2() - a new version of _start() that accepts a flags parameter - and a streaming equivalent to the sessions module. Also add the SQLITE_CHANGESETSTART_INVERT flag, used with start_v2() to invert a changeset while iterating through it.
drh [Thu, 11 Oct 2018 13:51:48 +0000 (13:51 +0000)]
On the first connection to a WAL-mode database that was not cleanly shut down
and contains a left-over -shm file, truncate the -shm file to 3 bytes instead
of to 0 bytes. Avoiding a truncation to 0 means that system monitoring tools
can better detect if a process illegitimately tries to truncate a -shm file.
Such a rogue process might think it is being helpful by cleaning up old files,
but there is a race condition that can cause damage to the database.
drh [Mon, 8 Oct 2018 18:55:56 +0000 (18:55 +0000)]
Replace the new geopoly_reverse() function with geopoly_ccw(). The
geopoly_ccw() function only reverses the vertex order if doing so is necessary
to get the correct right-hand winding rule on the polygon.
drh [Mon, 1 Oct 2018 13:54:30 +0000 (13:54 +0000)]
Fix a potential crash that can occur while reading an index from a corrupt
database file. The corruption is a record-header-size that is larger than
0x7fffffff. Problem detected by OSSFuzz against GDAL and reported to us
(with a suggested fix) by Even Rouault. The test case is in TH3.
Add the PRAGMA table_vinfo command (with an extra "v" before "info") that
works like PRAGMA table_info (without the "v") except that it also shows
hidden columns on virtual tables.
Ensure that the OP_VColumn opcode does set sqlite3_vtab_nochange() unless
the OPFLAG_NOCHNG bit is set in P5. Fix for ticket
[69d642332d25aa3b7315a6d385]
Enhancements to sqlite_memstat:
(1) Add an extra "schema" column to show the schema name for ZIPVFS stats.
(2) Only show ZIPVFS stats to schema that use ZIPVFS
(3) Put a NULL in unused columns of the output.
Begin revamping the ".help" command in the command-line shell so that it
can accept an argument and will do a search for commands that match that
argument.
dan [Wed, 26 Sep 2018 16:05:07 +0000 (16:05 +0000)]
Tweak spellfix.c so that if SQLITE_SPELLFIX_5BYTE_MAPPINGS is defined at
compile time the Transliteration structure has space for 5 byte (instead of 4
byte) mappings.
Slightly smaller and faster alternative to [507d892c3a40a0bacbd47] that
fixes a problem with views that use window function as part of complex
expressions.
Use compile-time options SQLITE_QUERY_PLANNER_LIMIT and
SQLITE_QUERY_PLANNER_LIMIT_INCR to control the value for
WhereLoopBuilder.iPlanLimit, rather than embedding magic numbers in the
code.
Put a limit counter on the query planner that restricts the number of
index+constraint options that can be considered for each table in a join.
This prevents certain pathological queries from taking up too much time
in the query planner.
Add the "PRAGMA legacy_alter_table=ON" command to enable the pre-3.25.0
behavior of ALTER TABLE that does not modify the bodies of triggers or
views or the WHERE clause of a partial index. Enable the legacy behavior
by default when running the xRename method of virtual tables.
Combine the Expr.pTab and Expr.pWin fields into a union named "y". Add a new
EP_WinFunc property that is only true if Expr.y.pWin is a valid pointer.
This reduces the size of the Expr object by 8 bytes, reduces the overall
amount of code, and shaves over 1 million cycles off of the speed test.
dan [Tue, 18 Sep 2018 17:00:06 +0000 (17:00 +0000)]
Enhance tester.tcl so that when "--malloctrace=1" is specified, the test
generates self-contained Tcl scripts that present GUIs instead of *.sql files
that require a separate program to interpret.
dan [Tue, 18 Sep 2018 16:06:42 +0000 (16:06 +0000)]
Minor improvements to the permutations.test script. Most notably, a command
like "permutations.test alter%" now runs all test scripts with names that
match the LIKE pattern "alter%". Or, say, "permutations wal alter%" to run all
alter% tests in wal mode.
Further optimizations to the UPDATE logic to avoid making changes to partial
indexes if none of the columns mentioned in the WHERE clause are modified by
the UPDATE.
Disable the ORDER BY LIMIT optimization in queries using window functions.
This fixes a problem that was introduced by check-in [206720129ed2fa8875a286]
which attempted to fix ticket [9936b2fa443fec03ff25f9]. This changes is
a fix for the follow-in tocket [510cde277783b5fb5de628].
Fix a false-positive in the post-ALTER-TABLE schema verification logic that
prevents ALTER TABLE from working if the table being altered has a trigger
that references any column of a virtual table. Ticket [b41031ea2b537237].