drh [Fri, 11 Feb 2011 06:59:02 +0000 (06:59 +0000)]
Fix a bug in the new WHERE-clause processing that tries to use an
index to resolve IS NOT NULL constraints when SQLITE_ENABLE_STAT2 is
defined. The bug could cause memory overruns and segfaults. The bug
was new to the code and has not appeared in an official release.
Found during structural testing.
drh [Thu, 10 Feb 2011 17:46:14 +0000 (17:46 +0000)]
Prevent a segfault when automatic indices try to use a column with an
unknown collating function. Ticket [77aa3b1e6592582e38605d36]. This
check-in also removes some stray \r characters unrelated to the problem.
dan [Wed, 9 Feb 2011 18:19:20 +0000 (18:19 +0000)]
Do not report corruption if the the db size header field is greater than the file size on disk unless the two change-counter header fields are identical. Fix for ticket [89b8c9ac54].
drh [Wed, 9 Feb 2011 03:04:27 +0000 (03:04 +0000)]
Use macros to define the relative costs of search and seek operations when
computing costs in the query planner. Current constants seems wrong and
need to be fixed, but doing so will alter test results. Need more
experimentation to determine accurate relative costs.
dan [Mon, 7 Feb 2011 15:12:12 +0000 (15:12 +0000)]
Change blocking-checkpoint tests so that they run once using "PRAGMA wal_checkpoint" and once using calls to sqlite3_wal_checkpoint_v2(). Also fix edge cases surrounding the output variables set by wal_checkpoint_v2().
drh [Fri, 4 Feb 2011 05:47:51 +0000 (05:47 +0000)]
If a deferred foreign key constraint fails on a statement that is not part
of a larger transation, make sure that the statement fully ends so that
subsequent invocations of the same statement will not pass the constraint
because they think the transaction is not closed. This is a merge of
the deferred-fk-quirk branch together with a test case.
drh [Fri, 4 Feb 2011 00:51:16 +0000 (00:51 +0000)]
Fix the ATTACH command so that the filename argument can be any expression
and so that if authorizer callback gets a NULL pointer for the filename
if the filename argument is anything other than a string literal.
Ticket [9013e13dba5b58c7]
dan [Tue, 1 Feb 2011 16:34:32 +0000 (16:34 +0000)]
Add virtual table module "fts4aux", used to inspect the full-text index of an fts4 table directly. Also add the "compress" and "uncompress" fts4 options.
drh [Fri, 28 Jan 2011 01:57:41 +0000 (01:57 +0000)]
Change the weighting of binary searches on tables to 1/10th the cost of a
search on an index. Change the assumed reduction in search space from a
indexed range constraint from 1/3rd to 1/4th. Do not let the estimated
number of rows drop below 1.
drh [Wed, 26 Jan 2011 19:46:22 +0000 (19:46 +0000)]
Update all built-in VFSes to return SQLITE_OK for the
SQLITE_FCNTL_SYNC_OMITTED file-control operation. Also change the
xFileControl methods to return SQLITE_NOTFOUND for unrecognized
operation codes.
dan [Wed, 26 Jan 2011 07:25:32 +0000 (07:25 +0000)]
Update mutex1.test so that it works with the memsubsys1 permutation (pagecache memory). Change a few instances of SQLITE_MUTEX_STATIC_LRU2 in comments and test code to STATIC_PMEM.
drh [Wed, 26 Jan 2011 00:07:03 +0000 (00:07 +0000)]
Rename the PCache1.mxPinned field to n90pct (since it is 90% of nMax) in order
to distinguish it from PGroup.mxPinned. Fix the computation of n90pct so that
it does not overflow adversely on excessively large cache sizes.
drh [Tue, 25 Jan 2011 16:48:56 +0000 (16:48 +0000)]
Make sure the return code from doing an xSync is correctly initialized
so that a valid return code is produced regardless of the path taken through
the logic.
drh [Tue, 25 Jan 2011 16:20:16 +0000 (16:20 +0000)]
Change the name of SQLITE_FCNTL_SYNC to SQLITE_FCNTL_SYNC_OMITTED and only
send it when PRAGMA synchronous=OFF. Add better documentation to explain
what that file-control opcode is used for.
dan [Mon, 24 Jan 2011 16:00:58 +0000 (16:00 +0000)]
Ensure that if a deferred FK constraint is violated by a statement that creates its own implicit transaction, the statement is not an "active-write" after sqlite3_step() returns.
dan [Sat, 22 Jan 2011 13:32:29 +0000 (13:32 +0000)]
Modify the trace callback mechanism so that SQL commands executed from within virtual table or user function callbacks are passed to the trace callback without parameter expansion and enclosed in SQL comments.
drh [Fri, 21 Jan 2011 18:18:13 +0000 (18:18 +0000)]
Adjustments to the result row estimator for the IN operator so that it gives
the same estimates as the equivalent OR operator. Test cases for the same.
drh [Thu, 20 Jan 2011 02:56:37 +0000 (02:56 +0000)]
The first of a planned series of enhancements to the query planner that
enable it to make better use of sqlite_stat2 histograms when the table
has many repeated values.
drh [Tue, 18 Jan 2011 17:03:26 +0000 (17:03 +0000)]
Do not use mutexes in the pcache implementation unless
SQLITE_ENABLE_MEMORY_MANAGMENT is defined. This is a performance enhancement.
A side effect is that pcaches will not steal pages from one another unless
ENABLE_MEMORY_MANAGEMENT is set, or unless SQLITE_THREADSAFE=0.
drh [Tue, 18 Jan 2011 15:17:57 +0000 (15:17 +0000)]
Do not use SQLITE_MUTEX_STATIC_MEM2 since it has been reused as STATIC_OPEN.
Instead, create a new static mutex STATIC_PMEM which is an alias for the
unused STATIC_LRU2.
drh [Mon, 17 Jan 2011 21:32:24 +0000 (21:32 +0000)]
Here is a completely new implementation of the mutex-free-pcache. This
one uses a common code base and automatically selects whether or not to
use mutexes depending on compile-time and start-time options.
drh [Mon, 17 Jan 2011 17:42:37 +0000 (17:42 +0000)]
Add the SQLITE_OMIT_AUTORESET compile-time option which if enabled causes
the sqlite3_step() routine to return SQLITE_MISUSE if it is called after
it has previously returned anything other than SQLITE_ROW, SQLITE_BUSY, or
SQLITE_LOCKED.
drh [Sun, 16 Jan 2011 22:37:09 +0000 (22:37 +0000)]
On a backup from a smaller to a larger page size, do not begin committing
the transaction until the source pages after the pending byte have been
copied.
drh [Sun, 16 Jan 2011 00:56:19 +0000 (00:56 +0000)]
Make sure the change-counter and SQLite-version fields of the header are
set correctly even when doing a VACUUM with locking_mode=EXCLUSIVE.
Ticket [5d863f876ee9561b].
drh [Sat, 15 Jan 2011 21:42:23 +0000 (21:42 +0000)]
Make sure the change counter and SQLite version numbers in the header are
set correctly, even when running in WAL mode and when VACUUMing in WAL mode.
Ticket [5d863f876ee9561b9].
dan [Thu, 13 Jan 2011 10:58:26 +0000 (10:58 +0000)]
Fix a segfault that can occur in matchinfo if an fts4 table contains mostly zero-length documents. Specifically, if the table contains more rows than it does bytes of text.