drh [Wed, 19 Dec 2012 16:25:55 +0000 (16:25 +0000)]
Additional test cases involving the use of a result column specified by its
"AS" name as a logical term of the WHERE clause.
Ticket [a7b7803e8d1e8699cd].
drh [Tue, 18 Dec 2012 19:36:11 +0000 (19:36 +0000)]
Optimize the degenerate case of a FROM clause table name enclosed all by
itself inside parentheses. Generate code as if the parentheses did not
exist, rather than the old behavior of manifesting the parenthesized table
into a transient table. Also, tag every FROM-clause SELECT subquery that is
generated by a parenthesized FROM-clause expression using the SF_NestedFrom
flag. The new SF_NestedFrom flag is not yet used for anything.
dan [Tue, 18 Dec 2012 11:59:39 +0000 (11:59 +0000)]
On atomic-write capable systems, if copying the contents of an in-memory journal to disk fails, close the (on disk) journal file before returning the error to the caller. This causes the subsequent rollback operation to use the in-memory journal. Fix for [df678d738adb].
drh [Mon, 17 Dec 2012 20:40:39 +0000 (20:40 +0000)]
Enhance the error message for "foreign key mismatch" to include the names of
the child and parent tables. Begin adding test cases for
PRAGMA foreign_key_check. Make sure PRAGMA foreign_key_check gets all
necessary table locks.
drh [Fri, 14 Dec 2012 15:36:17 +0000 (15:36 +0000)]
Fix the virtual table IN optimizer so that it work even if the virtual table
implementation leaves the sqlite3_index_info.aConstraintUsage[].omit flag
clear for an equality constraint that it intends to use.
drh [Thu, 13 Dec 2012 18:57:31 +0000 (18:57 +0000)]
Generalize the min/max optimization so that if an appropriate index exists,
the index it can be used by any aggregate query that contains only a single
max() or min() and does not contain a GROUP BY clause.
dan [Thu, 13 Dec 2012 16:37:10 +0000 (16:37 +0000)]
Attempt to further generalize the min/max optimization so that, if an appropriate index exists, it can be used by any aggregate query that contains only a single aggregate of the form max(colname) or min(colname) and does not contain a GROUP BY clause.
drh [Mon, 10 Dec 2012 22:19:14 +0000 (22:19 +0000)]
When an arithmetic operation with two integer operands must give a
floating-point answer due to overflow, make sure the answer is not
rounded back to integer by affinity.
dan [Mon, 10 Dec 2012 10:22:48 +0000 (10:22 +0000)]
Modify releasetest.tcl so that it runs the "checksymbols" test on a build without SQLITE_DEBUG defined. If SQLITE_DEBUG is defined, the sqlite3WhereTrace variable causes the test to fail.
drh [Sat, 8 Dec 2012 21:51:24 +0000 (21:51 +0000)]
Refactor collating-sequence handling as a fix for ticket [71e333e7d2e642].
The Expr.pColl field is removed from the Expr object. The COLLATE operator
now becomes a separate instance of Expr in the expression tree. The code
generator looks up the correct collating function as needed, rather than
referring to Expr.pColl.
drh [Sat, 8 Dec 2012 00:52:14 +0000 (00:52 +0000)]
Recognize TK_COLLATE operators that have been transformed into TK_REGISTER.
Skip both TK_COLLATE and TK_AS operators when looking for the top of an
expression.
drh [Thu, 6 Dec 2012 21:16:43 +0000 (21:16 +0000)]
Remove the Expr.pColl field and compute the collating sequence as it is needed.
This fixes the test script "shared9.test", though there is still a memory leak.
And there are other problems. Consider this a work-in-progress.
dan [Wed, 5 Dec 2012 14:37:55 +0000 (14:37 +0000)]
Fixes to a test case in shared_err.test. The fix is to prevent sqlite3_prepare() from being called when the test intends to test the response of sqlite3_step() to an OOM condition.
drh [Wed, 5 Dec 2012 14:31:13 +0000 (14:31 +0000)]
Make sure memory is freed using a routine that is compatible with the
routine used to allocate the memory. The SQLITE_MEMDEBUG compile-time
option enforces this.
dan [Wed, 5 Dec 2012 10:01:35 +0000 (10:01 +0000)]
If the atomic-write property is enabled, a transaction may be committed in journal_mode=DELETE mode without ever actually creating a journal file on disk. In this case, do not attempt to unlink() the journal file when committing the transaction.
drh [Mon, 3 Dec 2012 17:04:40 +0000 (17:04 +0000)]
Make sure that the optimization that set the maximum column that will be used
on a particular query does not mistakenly change an opcode other than
OP_OpenRead or OP_OpenWrite. In particular, make sure it does not overwrite
the P4 field of an OP_SorterOpen.
dan [Tue, 27 Nov 2012 10:56:39 +0000 (10:56 +0000)]
Fix problems in test_sqllog.c. Clarify the experimental SQLITE_CONFIG_SQLLOG interface. Handle at least the more likely error conditions in test_sqllog.c.
drh [Tue, 20 Nov 2012 15:06:57 +0000 (15:06 +0000)]
Have the windows implementation of xDelete return SQLITE_IOERR_DELETE_NOENT
if the file to be deleted does not exist. The unix implementation was
previously modified to behave this way. The current changes simply brings
the two implementations into alignment.
drh [Tue, 13 Nov 2012 11:08:49 +0000 (11:08 +0000)]
Use preprocessor macros to automatically detect whether or not
posix_allocate() is available. (It is generally available on Linux
but not on Mac.) Ticket [5eaa61ea1881040b17449ca043b6f8fd9ca55dc3]
drh [Tue, 13 Nov 2012 10:54:12 +0000 (10:54 +0000)]
When available, use posix_fallocate() rather than ftruncate() to allocate
space for mmap()ed -shm files, since posix_fallocate() gives an error if
no disk space is available whereas ftruncate() is silent and leaves the system
vulnerable to a SIGBUS upon first write to the mmap()ed region.
Ticket [5eaa61ea1881040b17449ca043b6f8fd9ca55dc3]
drh [Fri, 9 Nov 2012 21:40:02 +0000 (21:40 +0000)]
Only log unlink() errors if the error is something other than
SQLITE_IOERR_DELETE_NOENT. The error is still reported up the stack, it
is simply not added to the sqlite3_log().