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.
(check-in: f66c1db2 user: drh tags: ticket-71e333e7)

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.
(check-in: fd011cb2 user: drh tags: ticket-71e333e7)

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.
(check-in: 40c14395 user: dan tags: trunk)

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.
(check-in: 9f6c6885 user: drh tags: trunk)

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.
(check-in: 11aa47b0 user: dan tags: trunk)

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.
(check-in: b0c1ba65 user: drh tags: trunk)

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.
(check-in: d4c36d49 user: drh tags: trunk)

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](Closed-Leaf
check-in: 597333f1 user: drh tags: tkt-5eaa61ea18)

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](check-in: 35625961 user: drh tags: tkt-5eaa61ea18)

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().
(check-in: 5a3b07f0 user: drh tags: trunk)

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.
(check-in: bed9c172 user: dan tags: trunk)

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.
(Closed-Leaf
check-in: 51bfd63b user: drh tags: inner-loop-cost)

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.
(check-in: 6d42d806 user: drh tags: trunk)

Make sure all virtual table cursors have been closed on a prepared statement
prior to unlinking the perpared statement from its database connection.
(Closed-Leaf
check-in: f7c5abe8 user: drh tags: deferred-close-order)

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.
(check-in: 33f4f981 user: dan tags: trunk)

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).
(check-in: 317c80cb user: drh tags: trunk)

Ensure that when the source of a backup is a database that is zero bytes
in size, the final destination database consists of at least one page.
Truncating it to zero bytes is equivalent to zeroing the schema cookie
and change counter, which can cause problems for existing clients.
(check-in: ca86138b user: drh tags: trunk)

Ensure that when the source of a backup is a database that is zero bytes in size, the final destination database consists of at least one page. Truncating it to zero bytes is equivalent to zeroing the schema cookie and change counter, which can cause problems for existing clients.
(check-in: af5c9ee4 user: dan tags: zero-byte-backup-fix)