drh [Wed, 9 Jan 2013 11:44:20 +0000 (11:44 +0000)]
Fix an over-aggressive optimization of ORDER BY on a three-way join where the
second table is UNIQUE and the ORDER BY occurs on the third table.
Ticket [598f5f7596b0557].
drh [Wed, 19 Dec 2012 17:10:16 +0000 (17:10 +0000)]
Backport to the 3.7.15 branch
the fix to the segfault problem of ticket [a7b7803e8d1e869] which involved
the use of "AS" named result columns as logical terms of the WHERE clause.
Also, change the version number to 3.7.15.1.
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().
dan [Fri, 9 Nov 2012 20:17:26 +0000 (20:17 +0000)]
Change os_unix.c to propagate ENOENT errors back to sqlite as SQLITE_IOERR_DELETE_NOENT. Have SQLite ignore these where they are benign and propagate them back to the caller where they may indicate a file-system malfunction of some description.
drh [Fri, 9 Nov 2012 18:22:26 +0000 (18:22 +0000)]
Disable the table selection rule that tried to prevent full table scans from
migrating to the outer loop unless they were optimal. The new scaling of
outer-loop costs by cost of inner loops obviates the need for that step. And,
in fact, that step causes problems with the new inner-loop cost accounting.
drh [Fri, 26 Oct 2012 00:55:07 +0000 (00:55 +0000)]
Make sure all virtual table cursors have been closed on a prepared statement
prior to unlinking the perpared statement from its database connection.
The test case for this is in TH3, in the main39.test module.
dan [Thu, 25 Oct 2012 19:25:39 +0000 (19:25 +0000)]
Fix a bug in fts3 causing it to return SQLITE_NOMEM when NEAR, OR and some auxiliary functions were used together. Also a segfault in vtab.c that could follow an OOM condition.
drh [Thu, 25 Oct 2012 15:23:14 +0000 (15:23 +0000)]
Improvements to the command-line argument parsing in the
command-line shell. Command-line options can now occur either before
or after the database name and first command and are still accepted and
processed. Command-line options are processed even if no database name
is given (and :memory: is assumed).