drh [Fri, 29 Dec 2017 15:04:49 +0000 (15:04 +0000)]
Change the function name to sqlite_unsupported_offset(X). Only enable the
function if compiled with -DSQLITE_ENABLE_OFFSET_SQL_FUNC. The makefiles add
that definition to shell builds.
drh [Fri, 29 Dec 2017 14:33:54 +0000 (14:33 +0000)]
Enhance location(X) so that it works with indexes and WITHOUT ROWID tables.
The function might return an offset to the main table or to an index,
depending on whether the column X would be loaded from the main table or
from the index.
drh [Wed, 27 Dec 2017 22:09:53 +0000 (22:09 +0000)]
The output of sqlite3_trace() now shows each command of a trigger as it is
evaluated. This feature involved major changes to the parser, such as
removing the ExprSpan object and replacing it with a new mechanism for
capturing the original SQL text of phrases in the input SQL.
drh [Wed, 27 Dec 2017 18:19:06 +0000 (18:19 +0000)]
Enhance the Lemon parser generator so that it creates a faster parser at the
cost of slightly larger parser tables. Add the ability to measure coverage
of the generated state machine when compiling with the -DYYCONVERGE option.
In SQLite, add the SQLITE_TESTCTRL_PARSER_COVERAGE test-control to query the
new parser coverage feature.
drh [Wed, 27 Dec 2017 17:14:50 +0000 (17:14 +0000)]
Change the coverage measurement logic in the lemon-generated parser so that
it only checks for coverage of state/lookahead pairs that are valid syntax.
It turns out that some states are unreachable if the lookahead is not valid
syntax, because the states are only reachable through a shift following a
reduce, and the reduce does not happen if the lookahead is a syntax error.
drh [Mon, 25 Dec 2017 04:15:38 +0000 (04:15 +0000)]
Enhance LEMON so that it generates the action table in such a way that no
range check is needed on the lookahead table to verify that the next input
token is valid. This makes the lookahead table slightly larger (about 120
bytes) but helps the parser to run faster.
drh [Sun, 24 Dec 2017 23:38:10 +0000 (23:38 +0000)]
In the LEMON-generated parser, rearrange the meanings of integer action codes
so that reduce actions occur last. This means that the most common case
(reduce actions) can be recognized with a single comparison operation, thus
speeding up the main parser loop, slightly.
drh [Sun, 24 Dec 2017 18:56:28 +0000 (18:56 +0000)]
Fix a NULL pointer dereference after a syntax error that can occur as a
result of check-in [6b2ff26c25bb9da3] yesterday. This problem was
discovered by the OSSFuzz.
drh [Sat, 23 Dec 2017 12:33:40 +0000 (12:33 +0000)]
Move the generation of output column names earlier in the case of a
CREATE TABLE AS. This is a fix for ticket [3b4450072511e62] and a
continuation of check-in [ade7ddf1998190b2b63] that fixes cases of
ticket [de3403bf5ae5f72ed6] that were missed previously.
drh [Sat, 23 Dec 2017 11:51:40 +0000 (11:51 +0000)]
Add a SELECTTRACE() macro to indicate when column names are assigned to
a SELECT statement. This helps with debugging for tickets like
[de3403bf5ae5f72e] and [3b4450072511e621].
drh [Fri, 22 Dec 2017 00:52:50 +0000 (00:52 +0000)]
Modify the new sqlite3_vtab_collation() interface so that it takes a
pointer to the sqlite3_index_info object passed into xBestIndex rather than
an sqlite3 connection pointer, which the xBestIndex method might not have
access to.
drh [Thu, 21 Dec 2017 18:23:26 +0000 (18:23 +0000)]
Change the name of SQLITE_DBCONFIG_FULL_EQP to be SQLITE_DBCONFIG_TRIGGER_EQP
(which we can do without breaking compatibility because the former name has
not yet appeared in an official release) and streamline its implementation.
drh [Sat, 16 Dec 2017 20:20:37 +0000 (20:20 +0000)]
Add an experimental location(X) SQL function that attempt to return the
location of the payload within the database for the record that contains
column X. location(X) returns NULL if X is not an ordinary table column or
if SQLite cannot figure out the location because it is using a covering index.
dan [Sat, 16 Dec 2017 19:36:52 +0000 (19:36 +0000)]
Add the sqlite3_vtab_collation() function, which allows an xBestIndex callback
to determine the collation sequence that SQLite will use for a comparison. And
the SQLITE_DBCONFIG_FULL_EQP configuration option, which enhances the output
of "EXPLAIN QUERY PLAN" so that it includes statements run by triggers. And
the code for the sqlite3_expert extension and command line application.
drh [Wed, 13 Dec 2017 20:02:29 +0000 (20:02 +0000)]
New result code SQLITE_READONLY_DIRECTORY is returned when an attempt is
made to write on a database file that is in a read-only directory and hence
the journal file could not be created. This situation formerly returned
SQLITE_CANTOPEN, which less helpful.
dan [Wed, 13 Dec 2017 15:32:33 +0000 (15:32 +0000)]
Change some LSM code internal typenames from "Blob" and "Pgno" to "LsmBlob"
and "LsmPgno". This allows the LSM code to be compiled as a single unit with
sqlite3.c.
dan [Fri, 8 Dec 2017 16:23:38 +0000 (16:23 +0000)]
Add compile time switch SQLITE_ENABLE_ICU_COLLATIONS. For enabling ICU
collations without also enabling the tokenizer, the LIKE operator, the
REGEXP operator, or the unicode aware upper()/lower() scalar functions.
dan [Tue, 28 Nov 2017 13:39:41 +0000 (13:39 +0000)]
Lock the wal file for all snapshot transactions, even if they would not
otherwise require this, preventing checkpointers and writers from wrapping the
wal file. This means that if one connection has an open snapshot transaction
it is guaranteed that a second connection can open a transaction on the same
snapshot.
dan [Tue, 28 Nov 2017 07:52:00 +0000 (07:52 +0000)]
Add experimental feature to detect threading bugs in apps that use
SQLITE_CONFIG_MULTITHREADED. Enabled at compile time using
SQLITE_ENABLE_MULTITHREADED_CHECKS.
dan [Sat, 25 Nov 2017 17:51:01 +0000 (17:51 +0000)]
Add experimental feature to detect threading bugs in apps that use
SQLITE_CONFIG_MULTITHREADED. Enabled at compile time using
SQLITE_ENABLE_MULTITHREADED_CHECKS.
drh [Tue, 21 Nov 2017 23:38:48 +0000 (23:38 +0000)]
Fix the skip-ahead-distinct optimization on joins for cases there the table
in the inner loop of the join does not contribute any columns to the
result set. Proposed fix for ticket [ef9318757b152e3a2]
dan [Mon, 20 Nov 2017 15:46:10 +0000 (15:46 +0000)]
Fix a problem preventing the planner from identifying scans that visit at most
one row in cases where that property is guaranteed by a unique, not-null,
non-IPK column that is the leftmost in its table.
dan [Mon, 20 Nov 2017 14:40:03 +0000 (14:40 +0000)]
Fix a problem preventing the planner from identifying scans that visit at most
one row in cases where that property is guaranteed by a unique, not-null,
non-IPK column that is the leftmost in its table.
drh [Fri, 17 Nov 2017 21:01:04 +0000 (21:01 +0000)]
Improved fix for ticket [da78413751863] that does not require disabling the
query flattener as was done in [005d5b870625]. This also makes the code
generator for vector IN operators a little easier to understand.