drh [Fri, 5 Dec 2014 14:51:22 +0000 (14:51 +0000)]
When closing a (shared-cache) database connection, be sure to clear out
all KeyInfo objects cached on Index objects.
Fix for ticket [e4a18565a36884b00edf].
drh [Thu, 4 Dec 2014 16:29:21 +0000 (16:29 +0000)]
If a table is the right operand of a LEFT JOIN, then any column of that
table can be NULL even if that column has a NOT NULL constraint.
Fix for ticket [6f2222d550f5b0ee7ed].
drh [Mon, 17 Nov 2014 17:13:06 +0000 (17:13 +0000)]
When a SELECT statement is terminated by a ROLLBACK TO operation, make the
error message be "abort due to ROLLBACK" rather than
"callback requested query abort".
drh [Mon, 17 Nov 2014 15:32:47 +0000 (15:32 +0000)]
Fix a bug in the sqlite3TripAllCursors() routine that prevents it from
reporting errors. It is unknown at this time whether or not this omission can
result in any incorrect result in an actual query.
drh [Thu, 13 Nov 2014 13:42:39 +0000 (13:42 +0000)]
When a transaction or savepoint rollback occurs, save the positions of all open read-cursors so that they can be restored following the rollback operation. Cherry-pick of check-in [dd03a2802f3f27]
drh [Wed, 29 Oct 2014 01:26:25 +0000 (01:26 +0000)]
Fix problems with running UPDATE and DELETE against a VIEW and referencing
the rowid in the WHERE clause. This is a cherrypick of [95f8ebdbf87326f2]
and [8523670d50004f3].
drh [Wed, 29 Oct 2014 01:13:58 +0000 (01:13 +0000)]
In the OP_Column opcode, when extracting a field that is past the end of
a short record (because the row was originally inserted prior to ALTER TABLE
ADD COLUMN) then make sure the output register is fully NULL and does not
contain leftover flags (such as MEM_Ephem) from its previous use.
Fix for ticket [43107840f1c02]. This is a cherrypick of
check-in [24780f8ddc1683fc].
drh [Wed, 29 Oct 2014 01:07:21 +0000 (01:07 +0000)]
Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and
when synchronous=FULL in order to ensure that transactions are durable
across a power loss that happens moments after the commit. Proposed
fix for [https://bugzilla.mozilla.org/show_bug.cgi?id=1072773].
This is a cherrypick of [3e922208b68563489].
dan [Thu, 16 Oct 2014 11:45:14 +0000 (11:45 +0000)]
Update the vdbe-compress.tcl script to account for expressions of the form (123>var), where "var" should be replaced with a reference to a union member.
drh [Mon, 13 Oct 2014 20:12:47 +0000 (20:12 +0000)]
Use the padding word in the Mem object as temporary storage for
serial_type value in OP_Record, and thus avoid a redundant computation of
the serial_type for each column.
drh [Mon, 13 Oct 2014 13:00:58 +0000 (13:00 +0000)]
Remove the OPFLAG_CLEARCACHE flag from OP_Column. In its place, change the
P3 parameter of OP_SorterData to be the index of the pseudo-table cursor whose
record header cache is to be cleared. This gives a small size reduction
and performance increase.
drh [Sun, 12 Oct 2014 22:37:22 +0000 (22:37 +0000)]
Remove the VdbeCursor.lastRowid cache of the current rowid, since maintaining
the correct cache value uses more CPU cycles than just recomputing the rowid
on the occasions when it is actually needed. Replace it with the
VdbeCursor.aOffset field which used to be computed from VdbeCursor.aType
when needed. Saves 100 bytes of code space and runs 0.2% faster.
drh [Sat, 11 Oct 2014 17:22:55 +0000 (17:22 +0000)]
Simplification to the insertCell() routine in btree.c, resulting in a
performance boost and a very small size decrease. It turns out that the
extra work involved in sometimes avoiding an memcpy() of the first four bytes
of a record takes more time than just unconditionally copying those
four bytes.
dan [Fri, 10 Oct 2014 19:10:59 +0000 (19:10 +0000)]
Fix a failing test case in index5.test. Also tweak the way cache memory is divided between read-only and dirty pages when using SQLITE_CONFIG_PAGECACHE to reduce IO in some cases.
drh [Fri, 10 Oct 2014 17:20:39 +0000 (17:20 +0000)]
Add the estimated number of output rows to the EXPLAIN QUERY PLAN output
if compiled with SQLITE_EXPLAIN_ESTIMATED_ROWS. This feature is off by
default for the time being.
dan [Thu, 9 Oct 2014 15:08:17 +0000 (15:08 +0000)]
Allow FTS tokenizers to choose whether or not to consider the "*" character part of tokens or not. This restores the pre-[e21bf7a2ad] behaviour. Also fix a problem causing FTS to interpret tokens beginning with "*" characters as EOF.
drh [Tue, 7 Oct 2014 23:02:24 +0000 (23:02 +0000)]
Make sure the sqlite3VdbeMemClearAndResize() routine is never called with a
zero size parameter, since a size of zero could lead to either a memory leak
or an assertion fault.
drh [Sat, 4 Oct 2014 00:07:44 +0000 (00:07 +0000)]
Avoid leaking Index.aiRowEst memory if an OOM causes a rollback which deletes
the index before the aiRowEst deletion code in sqlite3AnalysisLoad() routine
has a chance to run. Since the aiRowEst now might be deleted from freeIndex()
which does not always have a db pointer, make sure the aiRowEst memory is
not held in lookaside.
drh [Fri, 3 Oct 2014 16:00:51 +0000 (16:00 +0000)]
Add requirements marks on the sqlite3_db_status() interface implementation.
Fix a typo in the documentation. Fix the new sqlite3_result_text64() routine
so that it works correctly with an encoding parameter of SQLITE_UTF16.
drh [Fri, 3 Oct 2014 14:54:47 +0000 (14:54 +0000)]
Update to requirements marks related to changes in the memory allocation
interface and enhancement of the documentation regarding DEFAULT clauses
in CREATE TABLE.
drh [Thu, 2 Oct 2014 21:52:35 +0000 (21:52 +0000)]
Avoid a NULL pointer deference when processing the IS operator if the
right-hand side is an illegal "#ID" style variable.
Fix for ticket [8c32a33a53092c85a15b]
Improvements to the new syntax-tree output routines: Omit the "END SELECT"
mark and instead terminate the graph at the last item. Increase the maximum
tree depth to 100.
Enable the query planner to deal with WHERE clauses that have OR terms
nested within AND terms that are nested within OR terms. Also remove an
unused function declaration.
Remove the SQLITE_ENABLE_TREE_EXPLAIN compile-time option. Add alternative
debugging display routines: sqlite3TreeViewExpr(), sqlite3TreeViewExprList(),
and sqlite3TreeViewSelect().
Fix the "PRAGMA integrity_check" command so that it avoids formatting error
message context messages until it actually needs to generate an error message.
This avoids much formatting, and hence greatly improves the performance of
"PRAGMA integrity_check" in the common case when there are no errors. It also
makes the code a little smaller.