drh [Tue, 21 Jan 2014 00:19:43 +0000 (00:19 +0000)]
Add support for the LEVEL pseudo-column in the recursive part of
a common table expression. LEVEL has the value of 1 on the first iteration
and successively larger integer values of subsequent iterations. It cannot
have a table qualifier. Actual columns named "level" can still be accessed
by including the table name qualifier.
dan [Mon, 20 Jan 2014 18:25:44 +0000 (18:25 +0000)]
Handle a few obscure problems that could manifest if a database corrupted in a certain way was written by a connection in the middle of a SELECT statement on the same db.
dan [Fri, 17 Jan 2014 11:48:24 +0000 (11:48 +0000)]
Remove some code from resolve.c that was only required for recursive cte references in sub-queries. Also a stray "finish_test" command in pagerfault.test.
drh [Thu, 16 Jan 2014 15:31:41 +0000 (15:31 +0000)]
Always use available indices to optimize LIKE operators even if the pattern
of the LIKE operator has a COLLATE modifier. This fixes an ineffiency that
was introduced into 3.7.15 by check-in [8542e6180d4] on 2012-12-08.
dan [Wed, 15 Jan 2014 18:12:00 +0000 (18:12 +0000)]
When resolving names, consider a reference to a recursive CTE column as equivalent to a reference to the outermost name-context. This ensures that correlated sub-queries are correctly identified as such.
drh [Mon, 13 Jan 2014 20:38:35 +0000 (20:38 +0000)]
In the command-line shell, defend against a NULL-pointer dereference in the
case where sqlite3_column_name() returns NULL (as might happen following an
OOM error).
drh [Sat, 11 Jan 2014 12:52:25 +0000 (12:52 +0000)]
In LEMON, limit the size of the grammar file to 100MB. This ensures that
the program will never experience integer overflow. To be doubly sure,
use calloc() instead of malloc() when allocating arrays.
drh [Sat, 11 Jan 2014 03:27:37 +0000 (03:27 +0000)]
Add the "%token_class" directive to the LEMON parser generator. This opens up
the possibility of simplifying the parser. Also remove all calls to
sprintf(), strcpy(), and strcat() from LEMON to avoid compiler warnings
on OpenBSD. (Aside: It is this change to avoid harmless compiler warnings
that was the cause of the reason spat of bugs.)
drh [Sat, 11 Jan 2014 03:06:18 +0000 (03:06 +0000)]
In LEMON, fix a bug in the text formatter introduced by the previous
commit. Also add the new "%token_class" directive for defining symbolic
names that stand any one of a collection of tokens.
dan [Sat, 4 Jan 2014 19:58:29 +0000 (19:58 +0000)]
Add the usual "fts3" prefix to new static method setEstimatedRows() in fts3.c. This fixes a problem when compiling the amalgamation, as the r-tree module also contains a static method named setEstimatedRows.
dan [Sat, 4 Jan 2014 14:46:39 +0000 (14:46 +0000)]
Have FTS assign extremely high costs to plans that feature unusable MATCH constraints. This discourages the planner from choosing such plans, which lead to "unable to use function MATCH in the requested context" errors.
dan [Sat, 4 Jan 2014 14:42:14 +0000 (14:42 +0000)]
Instead of having the planner ignore plans with unusable MATCH constraints, have FTS assign extremely high costs to such plans in order to discourage the planner from using them.
dan [Sat, 4 Jan 2014 14:16:06 +0000 (14:16 +0000)]
Have the planner detect cases where a MATCH constraint is applied to a virtual table, and ignore any plans that do not allow the virtual table implementation to implement the MATCH filtering.
drh [Wed, 1 Jan 2014 14:00:13 +0000 (14:00 +0000)]
Enhance sqlite3_randomness(N,P) such that it resets the internal PRNG
if N is less than 1. Subsequent calls to sqlite3_randomness() will reinitialize
the internal PRNG by calling the xRandomness() method of the default VFS.
drh [Sat, 21 Dec 2013 16:06:47 +0000 (16:06 +0000)]
Fix harmless compiler warnings in FTS4. This involved corrupting
Martin Porter's beautifully written and elegant stemmer code, making it
a little less beautiful and a little less elegant. Today is a sad
day. But the warnings from GCC grow increasingly verbose and irksome
with each new release and so something had to be done.
drh [Sat, 21 Dec 2013 15:46:06 +0000 (15:46 +0000)]
Fix the ".echo on" dot-command of the shell so that it echos comments in
addition to SQL statements and dot-commands. Add the --explain option
to speedtest1 so that the output can be piped into the command-line shell
to show nicely-formated VDBE code for the entire test.
drh [Fri, 20 Dec 2013 15:59:20 +0000 (15:59 +0000)]
Combine adjacent single-register OP_Copy instructions into a single
multi-register OP_Copy, where possible. Fix the Synopsis comment for
multi-register OP_Copy instructions to show the correct register ranges.
drh [Fri, 20 Dec 2013 13:11:45 +0000 (13:11 +0000)]
Simplify the accumulator reset for aggregate query processing so that it
uses a single multi-register OP_Null rather than a separate OP_Null for each
register.
drh [Thu, 19 Dec 2013 16:26:05 +0000 (16:26 +0000)]
Make sure errors encountered while initializing extensions such as FTS4
get reported out from sqlite3_open(). This fixes a bug introduced by
check-in [9d347f547e7ba9]. Also remove lots of forgotten "breakpoint"
commands left in test scripts over the years.
drh [Wed, 18 Dec 2013 18:44:43 +0000 (18:44 +0000)]
Remove an unnecessary column-cache flush operation. Add code to trace the
column cache when compiled with SQLITE_DEBUG and using
PRAGMA vdbe_addoptrace=ON.
drh [Wed, 18 Dec 2013 16:27:48 +0000 (16:27 +0000)]
Remove an unnecessary column-cache flush. Add another test case to the
speedtest1.c program to accentuate the benefit of not flushing the cache at
that point.
drh [Sat, 14 Dec 2013 13:44:22 +0000 (13:44 +0000)]
Allow the SQLITE_DETERMINISTIC flag to be ORed into the preferred text encoding
of application-defined functions, to mark the function as deterministic.
drh [Fri, 13 Dec 2013 19:35:21 +0000 (19:35 +0000)]
Create and use a new pager interface sqlite3PagerUnrefNotNull() that works
just like sqlite3PagerUnref() but guarantees that its argument is not a
NULL pointer.