drh [Mon, 5 Nov 2018 16:38:10 +0000 (16:38 +0000)]
Eponymous virtual tables appear to exist in all schemas. This is an alternative
and improved fix to the eponymous virtual table in trigger problem that
was previously addressed by checkin [1fa74930ab56171e].
drh [Mon, 5 Nov 2018 07:53:17 +0000 (07:53 +0000)]
Disable the IS NOT NULL optimization when the IS NOT NULL operator is part
of the ON clause of a LEFT JOIN. Fix for ticket [65eb38f6e46de8c75e188a17ec].
drh [Sat, 3 Nov 2018 13:11:24 +0000 (13:11 +0000)]
Fix a assert() in the query planner that can arise when doing row-value
operations on a PRIMARY KEY that contains duplicate columns.
Ticket [1a84668dcfdebaf12415d].
drh [Wed, 31 Oct 2018 19:01:13 +0000 (19:01 +0000)]
Add support for the SQLITE_PREPARE_NORMALIZED flag and the
sqlite3_normalized_sql() when compiling with SQLITE_ENABLE_NORMALIZE.
Also remove unnecessary whitespace from Makefiles.
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.