dan [Tue, 24 Feb 2015 20:10:49 +0000 (20:10 +0000)]
Prevent partial indexes on the table on the left hand side of a LEFT JOIN from being incorrectly qualified by a constraint in the ON clause of the join. This relaxes the rule introduced by the previous commit (as the partial indexes on the table on the rhs of the LEFT JOIN may now be qualified by terms within the ON clause).
drh [Tue, 24 Feb 2015 20:04:59 +0000 (20:04 +0000)]
Make sure partial indexes are not qualified incorrectly by a constraint that
is inside the ON clause of a LEFT JOIN. Fix for ticket [2326c258d02ead33].
drh [Tue, 24 Feb 2015 16:48:59 +0000 (16:48 +0000)]
This additional fix prevents a partial index from being qualified for use
if the constraint that qualifies the partial index is part of the ON clause of
a LEFT JOIN.
drh [Sat, 21 Feb 2015 15:42:57 +0000 (15:42 +0000)]
Update document on sqlite3_mprintf() and related functions. Discuss the
%w format and point out that obscure ANSI-C formats are not supported.
No changes to code.
drh [Sat, 21 Feb 2015 00:19:25 +0000 (00:19 +0000)]
Keep track of the optimal number of reserved bytes (by looking at reserve
byte requests in calls to sqlite3BtreeSetPageSize()) and then change the
reserve byte count to the optimal when doing a VACUUM or when using the
backup API.
drh [Mon, 9 Feb 2015 18:28:03 +0000 (18:28 +0000)]
Propagate COLLATE operators upward through function calls and CASE operations.
And do not flatten an aggregate subquery into a query that uses other
subqueries. Fixes for tickets [ca0d20b6cdddec5] and
[2f7170d73bf9], respectively.
drh [Mon, 9 Feb 2015 15:21:36 +0000 (15:21 +0000)]
Disable the query flattener for aggregate subqueries if the parent query
uses other subqueries in its result set or WHERE clause or ORDER BY clause.
Preliminary fix for ticket [2f7170d73bf9abf8]. However it still contains
a defect similar to the COLLATE problem of [ca0d20b6cddd].
drh [Mon, 9 Feb 2015 13:42:59 +0000 (13:42 +0000)]
In selecttrace 0x100 mode, show the parse tree after name resolution instead
of before flattening, so that it is always seen even if flattening does not
occur. Also: add the hex pointer value to the top of each SELECT tree.
drh [Sat, 7 Feb 2015 15:16:35 +0000 (15:16 +0000)]
Fix potential 32-bit integer overflow problems on the offset and length
parameters to sqlite3_blob_read() and sqlite3_blob_write(). For
sqlite3_blob_open(), make sure the *ppBlob return parameter is zeroed if
the interface fails with SQLITE_MISUSE.
drh [Fri, 6 Feb 2015 14:51:13 +0000 (14:51 +0000)]
Change the name of ".info" to ".dbinfo" and add an optional second argument
which is the ATTACH-ed DB about which information is provided. Provide
".indexes" as an alternative name to the legacy ".indices" command.
drh [Fri, 6 Feb 2015 01:07:15 +0000 (01:07 +0000)]
Add the index_xinfo pragma which gives information about the fields that
reference the table PRIMARY KEY in addition to the index key fields.
Add extra columns "desc", "coll", and "key" to the index_info and index_xinfo
pragmas. Add the "origin" and "partial" columns to the index_list pragma.
drh [Fri, 30 Jan 2015 20:59:27 +0000 (20:59 +0000)]
Change SQLITE_TESTCTRL_INITMODE to SQLITE_TESTCTRL_IMPOSTER. Revise the order
of parameters. Give it the ability to reset the schema parse table so that
imposter tables can be erased.
dan [Thu, 29 Jan 2015 19:12:12 +0000 (19:12 +0000)]
Ensure that "PRAGMA wal_checkpoint = TRUNCATE|FULL|RESTART" block on other connections and truncate the database file as required even if the entire wal file has already been checkpointed.
drh [Tue, 27 Jan 2015 13:17:05 +0000 (13:17 +0000)]
Fix a (almost always harmless) read past the end of a memory allocation
that comes about because the Expr.pTab field is checked on an
EXPR_REDUCEDSIZE Expr object before checking the Expr.op field to
know that the Expr.pTab field is meaningless.
drh [Sat, 24 Jan 2015 12:12:57 +0000 (12:12 +0000)]
In the command-line shell, make sure stderr is unbuffered so that it
automatically flushes. This has always been the case already for unix and
on Windows when the output is a console, but apparently was not the case
on Windows when the output was a pipe.
drh [Thu, 22 Jan 2015 12:00:17 +0000 (12:00 +0000)]
Make sure errors in the FROM clause of a SELECT cause analysis to abort
and unwind the stack before those errors have a chance to mischief
in the "*" column-name wildcard expander. Fix for ticket [32b63d542433ca67].
drh [Mon, 19 Jan 2015 21:36:05 +0000 (21:36 +0000)]
Ensure that the KeyInfo.nXField value for ephemeral tables used to implement
ORDER BY or GROUP BY clauses is set correctly, so that the
sqlite3VdbeFindCompare() routine can choose the correct comparison function.
Add assert() statements to the high-speed comparison functions to detect
cases where they are inappropriately chosen.
Fix for ticket [f97c4637102a3ae72b7911].
drh [Mon, 19 Jan 2015 20:59:34 +0000 (20:59 +0000)]
Make sure that the KeyInfo.nXField value of ephermeral tables used for
ORDER BY and GROUP BY is set correctly, so that the correct comparison
function can be choosen by sqlite3VdbeFindCompare().
drh [Mon, 19 Jan 2015 19:48:52 +0000 (19:48 +0000)]
An alternative way of implementing the assert() that verifies the relative
values of KeyInfo.nField+KeyInfo.nXField and the number of columns in a record.
This version of the assert() only fires when the high-speed comparison
routines are used - which is to say it only fires when the constraint
actually matters.
drh [Thu, 15 Jan 2015 15:47:06 +0000 (15:47 +0000)]
Makefile enhancements: (1) Rename autoconf/tea/configure.in to
autoconf/tea/configure.ac so that it works with the latest versions of
autoconf. (2) Add the "amalgamation-tarball" targets to Makefile.in and
main.mk (renamed from "dist" in the latter case). (3) Update the
README.first file in autoconf/ (4) The TOP macro
in Makefile.in is now an absolute rather than a relative path.
drh [Tue, 13 Jan 2015 21:26:17 +0000 (21:26 +0000)]
Simplify some code in rtree, to avoid confusing the optimizer in GCC on
some macs:
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00).
Prior to these changes, compiling with -O3 would cause incorrect code to
be generated. The change to the nodeGetCell() routine is key. The other
changes are merely cosmetic details discovered while bug hunting.
drh [Sat, 10 Jan 2015 16:49:23 +0000 (16:49 +0000)]
Improvements to compile-time-option hygiene. Use "#if OPTION" instead of
"#ifdef OPTION" in cases where that makes sense, so that -DOPTION=0 will work.
Add the "Have-Not" configuration in releasetest.tcl which disables all of
the "HAVE_component" compile-time options.