drh [Sun, 12 Jan 2020 22:38:17 +0000 (22:38 +0000)]
Better than removing the incorrect assert() is to change it into a
testcase() together with a comment indicating where an appropriate test case
can be found, and the ticket that provoked the change.
Ticket [614b25314c766238]
drh [Sun, 12 Jan 2020 22:25:58 +0000 (22:25 +0000)]
Change the zipfile virtual table so that the xBestIndex method gives a
reasonable cost estimate even if no filename is specified. The missing
filename error continues to be raised in the xFilter method. Meanwhile,
the more reasonable cost estimate avoids unnecessary wierdness in the query
planner.
drh [Sat, 11 Jan 2020 21:08:59 +0000 (21:08 +0000)]
New apis: sqlite3_filename_database(), sqlite3_filename_journal(), and
sqlite3_filename_wal(). Also sqlite3_uri_key(). And the other sqlite3_uri
functions now work using the journal or wal filename in addition to the
database file. And the sqlite3_db_filename() result is guaranteed to work
as an argument to the sqlite3_uri functions.
drh [Fri, 10 Jan 2020 18:05:55 +0000 (18:05 +0000)]
Rearchitect the way in which filenames are stored in the Pager object so that
the sqlite3_uri_parameter() interface will work from journal and WAL filenames
too. This check-in implements the central idea, and compile and runs somewhat,
but crashes on an extended test.
drh [Wed, 8 Jan 2020 12:17:46 +0000 (12:17 +0000)]
When doing a test-to-double conversion on a BLOB with an odd number of bytes
and assuming a UTF16 encoding, ignore the last byte.
Ticket [9eda2697f5cc1aba].
drh [Mon, 6 Jan 2020 20:48:45 +0000 (20:48 +0000)]
In the typeof() optimization in OP_Column, expand the size of the bogus buffer
provided for data so that it is big enough to cover the increased number of
bytes displayed during register tracing from check-in [54553bf16fabd72d].
This is the correct fix for ticket [bbd55a97e66ff50d], though the earlier one
does not hurt and is useful to retain.
drh [Mon, 6 Jan 2020 19:23:41 +0000 (19:23 +0000)]
Rewrite the (debugging use only) sqlite3VdbeMemPrettyPrint() function to use
the safer StrAccum interface rather than writing directly into a static string
buffer. Perhaps this will address ticket [bbd55a97e66ff50d], which we are
unable to reproduce.
drh [Sat, 4 Jan 2020 19:58:28 +0000 (19:58 +0000)]
Enhance PRAGMA function_list to show internal functions if the direct use
of internal functions is enabled via the SQLITE_TESTCTRL_INTERNAL_FUNCTIONS
test control.
drh [Sat, 4 Jan 2020 15:21:47 +0000 (15:21 +0000)]
Fix a false-positive in the register validity tracking logic by moving the
temporary register release call before the jump that uses that temporary
register.
drh [Sat, 4 Jan 2020 14:50:06 +0000 (14:50 +0000)]
Back out another NEVER added by check-in [7b62555e285f32d3] - the test case
was already in test/fuzzdata3.db, but it only occurs if compiled without
SQLITE_ENABLE_PREUPDATE_HOOK.
drh [Sat, 4 Jan 2020 01:43:02 +0000 (01:43 +0000)]
Enhance PRAGMA function_list so that it shows all instances of each FuncDef,
the number of arguments, the encoding, the type, and the flags. Use this
capability to locate and fix incorrect function flags in the standard build.
drh [Fri, 3 Jan 2020 21:57:53 +0000 (21:57 +0000)]
Invert the SQLITE_FUNC_SAFE bit to be SQLITE_FUNC_UNSAFE. The external
bit is still SQLITE_INNOCUOUS. It gets inverted as the appdef function
is registered.
drh [Fri, 3 Jan 2020 14:16:43 +0000 (14:16 +0000)]
Fix the OP_Copy-coalesce optimization so that if the previous row happens
to end with OP_Copy but is not a candidate for the optimization due to jumps,
then the optimization is correctly bypassed.
drh [Fri, 3 Jan 2020 02:20:37 +0000 (02:20 +0000)]
When generating the name of a view (or common table expression) because the
SQL does not specify a name, avoid the names "true" and "false" which might
be confused for the boolean literals of the same name, leading to an
inconsistent abstract syntax tree.
dan [Thu, 2 Jan 2020 16:24:22 +0000 (16:24 +0000)]
Handle blobs that are the return values of functions being cast to text in utf16 databases in the same way as blobs read directly from the database. Fix for [771fe617].
drh [Thu, 2 Jan 2020 14:42:42 +0000 (14:42 +0000)]
Enhancements to aid testing and debugging:
In PRAGMA vdbe_trace=on output, show pScopyFrom dependencies on register
values. Add the sqlite3VdbeRegisterDump() procedure, callable from a
debugger, that shows the values of all registers. Pass the VDBE pointer
into test_trace_breakpoint() so that sqlite3VdbeRegisterDump() is callable
from the breakpoint.
drh [Thu, 2 Jan 2020 13:26:49 +0000 (13:26 +0000)]
Add the test_trace_breakpoint() subroutine that is invoked after each
instruction is printed while running PRAGMA vdbe_trace=on. Only works for
SQLITE_DEBUG builds. Also add parameters "pc" and "pOp" to
test_addop_breakpoint() to make it easier to set conditionals.
drh [Wed, 1 Jan 2020 23:02:35 +0000 (23:02 +0000)]
Provide the -DSQLITE_ENABLE_INTERNAL_FUNCTIONS=1 compile-time option. Fix
the ".testctrl internal_function" command in the CLI so that it does not
signal an error on a valid input.
drh [Wed, 1 Jan 2020 21:14:30 +0000 (21:14 +0000)]
When generating code for a subquery, make a copy of the Select object and
generate the code out of the copy, in case the code generator makes
modifications to expression and the Select object needs to be reused.
dan [Wed, 1 Jan 2020 20:17:15 +0000 (20:17 +0000)]
Ensure that when code for a scalar SELECT featuring window functions is generated more than once by the planner, separate ephemeral tables are opened for each instance.
drh [Wed, 1 Jan 2020 15:43:30 +0000 (15:43 +0000)]
New test-only SQL functions: implies_nonnull_row(), expr_compare(), and
expr_implies_expr(). The SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control
is modified to toggle internal function access on and off for a single
database connection.