mistachkin [Thu, 4 Jan 2018 23:49:08 +0000 (23:49 +0000)]
In the 'fileio' extension code for Win32, use the FILE_FLAG_BACKUP_SEMANTICS flag when setting the file times, just in case the file is actually a directory.
drh [Tue, 2 Jan 2018 18:11:11 +0000 (18:11 +0000)]
In the constraint resolution logic, be careful not to cache column values
in registers whose initialization might be bypassed by an OP_NoConflict opcode.
Fix for ticket [dc3f932f5a147771] reported by OSSFuzz.
drh [Tue, 2 Jan 2018 00:04:37 +0000 (00:04 +0000)]
The ".schema" command in the command-line shell now shows the structure of
table-valued functions and eponymous virtual tables if they are named on the
".schema" command line. Example: ".schema sql%" shows the structure of
the "sqlite_dbstat" and "sqlite_stmt" virtual tables.
drh [Fri, 29 Dec 2017 17:21:21 +0000 (17:21 +0000)]
Add support for the sqlite_unsupported_offset() SQL function if and only
if compiled using -DSQLITE_ENABLE_OFFSET_SQL_FUNC. Use that definition
when compiling the command-line shell.
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.
dan [Sat, 16 Dec 2017 19:11:26 +0000 (19:11 +0000)]
Do not use the compress() and uncompress() functions in ext/misc/compress.c -
they are not quite compatible with the spec. Instead use new functions in
ext/misc/sqlar.c.
dan [Thu, 14 Dec 2017 19:15:07 +0000 (19:15 +0000)]
Have the writefile() function optionally set the modification-time of the
files it writes or creates. And many small fixes to the new code on this
branch.
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.