drh [Wed, 10 Jun 2009 19:33:28 +0000 (19:33 +0000)]
Do not let the reverse_unordered_selects pragma force the use of an index that
would not otherwise be used. Ticket #3904.
Also: remove an test which is always true. (CVS 6745)
drh [Tue, 9 Jun 2009 19:53:58 +0000 (19:53 +0000)]
Remove the actual checks that verify that memory pools (such as set up
using SQLITE_CONFIG_HEAP) are 8-byte aligned. But document that 8-byte
alignment is required. (CVS 6742)
drh [Tue, 9 Jun 2009 13:42:24 +0000 (13:42 +0000)]
Enable cell overflow checking in sqlite3BtreeInitPage() using the
compile-time option SQLITE_ENABLE_OVERSIZE_CELL_CHECK. Change the tests
so that they recognize different error messages depending on the setting
of this macro. (CVS 6735)
danielk1977 [Tue, 9 Jun 2009 11:34:10 +0000 (11:34 +0000)]
Avoid calling fillInCell() to create an internal node intkey cell from balance_nonroot(). A single putVarint() does the same thing more quickly. (CVS 6734)
danielk1977 [Tue, 9 Jun 2009 09:41:00 +0000 (09:41 +0000)]
Do not clear the MemPage.nFree variable when insertCell() adds an overflow cell to a page. Not doing this means balance_quick() can avoid a call to sqlite3BtreeInitPage(). (CVS 6732)
drh [Sat, 6 Jun 2009 15:17:27 +0000 (15:17 +0000)]
Make sure the result of sqlite3VdbeGetOp() is not used as an array following
an OOM error, since after (6691) it might be a single-entry dummy opcode. (CVS 6724)
danielk1977 [Sat, 6 Jun 2009 14:13:26 +0000 (14:13 +0000)]
When building in debug mode with gcc, force the nullMem variable in function columnMem() to be aligned to an 8-byte boundary. Otherwise an assert() statement may fail. (CVS 6723)
drh [Fri, 5 Jun 2009 14:17:21 +0000 (14:17 +0000)]
Take care that a corrupt variable-length integer does not cause 32-bit
integer overflow when parsing a record format, nor cause excessively large
memory allocations. (CVS 6719)
drh [Thu, 4 Jun 2009 17:02:51 +0000 (17:02 +0000)]
Fix an assertion fault in balance_quick() that occurs when an interior
btree node has zero cells due to database corruption. Also update the
corrupt7.test result vectors for a couple of cases where the error report
on database corruption changed due to earlier detection. (CVS 6717)
drh [Wed, 3 Jun 2009 21:04:35 +0000 (21:04 +0000)]
Change the pcache1.c implementation so that the "header" occurs at the end
of page buffer, not at the beginning. This insures that the 20 bytes
immediately following the page buffer are mapped if a read of the page
buffer overruns due to a malformed cell. (CVS 6711)
danielk1977 [Wed, 3 Jun 2009 17:26:17 +0000 (17:26 +0000)]
Add corruptD.test, a container for testing the "cell overflow" problem. Also shuffle a small amount of code in BtreeInitPage() to check that the page header pointer to the start of the cell offset array is set to a sane value. (CVS 6710)
danielk1977 [Wed, 3 Jun 2009 11:25:07 +0000 (11:25 +0000)]
Define a set of constants to use as the "index" argument to sqlite3BtreeGetMeta and UpdateMeta. This makes some parts of the code easier to follow. (CVS 6709)
drh [Tue, 2 Jun 2009 15:21:42 +0000 (15:21 +0000)]
Add the vdbe-compress.tcl script which automatically refactors the
sqlite3VdbeExec() routine to use less stack space. Use this script
when constructing the amalgamation. (CVS 6704)
drh [Mon, 1 Jun 2009 18:18:20 +0000 (18:18 +0000)]
Malloc for space to hold the Parse object in sqlite3_prepare() and friends.
Or, if compiled with SQLITE_USE_ALLOCA, obtain space for the object from
alloca(). (CVS 6702)
drh [Fri, 29 May 2009 19:00:12 +0000 (19:00 +0000)]
Enhance the sqlite3VdbeGetOp() routine so that it always returns a pointer
to VdbeOp, even following an OOM fault. This simplifies error handling in
callers. Cleanup to the column cache logic and the expr.c source module. (CVS 6691)
drh [Fri, 29 May 2009 10:55:29 +0000 (10:55 +0000)]
The hasHotJournal() fix of check-in (6687) causes some minor problems in
various alternative operating modes, such as locking_mode=EXCLUSIVE. This
additional patch attempts to fix those concerns. Ticket #3883. (CVS 6688)
drh [Fri, 29 May 2009 00:30:30 +0000 (00:30 +0000)]
Modify the hasHotJournal() routine to return a false-positive if it is
unable to open the journal file to check its header due to a race
condition. Processing downstream of hasHotJournal() already knows how to
deal with false-positives. Ticket #3883. (CVS 6687)
danielk1977 [Thu, 28 May 2009 11:05:57 +0000 (11:05 +0000)]
Workaround the need for internal API sqlite3BtreeCursorDb(). It was only being used for an assert() statement, which can be done differently. (CVS 6683)
drh [Thu, 28 May 2009 01:00:55 +0000 (01:00 +0000)]
Additional refinements to Expr handling. Restore compression of trigger
expressions. Change Expr.zToken to Expr.u.zToken and added Expr.u.iValue.
Remove an unnecessary ExprDup from CHECK constraint processing. And so forth. (CVS 6682)
drh [Wed, 27 May 2009 10:31:29 +0000 (10:31 +0000)]
Simplifications to the Expr object: Remove Expr.span completely and convert
Expr.token into a char* Expr.zToken. Also simplify the Token object by
removing the Token.dyn and Token.quoted fields. (CVS 6681)
drh [Mon, 25 May 2009 11:46:29 +0000 (11:46 +0000)]
When pinning a temp register after it is reused by the column cache, make
sure all instances of that register in the cache are pinned so that the
register is never reused for a different purpose. Ticket #3879. (CVS 6676)
drh [Fri, 22 May 2009 10:53:29 +0000 (10:53 +0000)]
Make sure sqlite3_shutdown() completely disables the default pager cache
mechanism in pcache1.c. Ticket #3872. Also fix some comments associated
with configuring the page cache. (CVS 6668)
drh [Thu, 21 May 2009 15:15:00 +0000 (15:15 +0000)]
In the CLI in the ".dump" command, do not attempt to clear the sqlite_sequence
table until the first row of content of that table is seen. Ticket #3867 (CVS 6664)
drh [Wed, 20 May 2009 20:10:47 +0000 (20:10 +0000)]
Fix a memory leak that occurs when an out-of-memory error occurs while
preparing a statement that has multiple virtual table updates within
triggers. Other virtual table changes to support full-coverage testing. (CVS 6661)
drh [Tue, 19 May 2009 14:21:28 +0000 (14:21 +0000)]
Improvements to the SQLITE_INT_TO_PTR macro to reduce the number of
warnings. For some platforms it might be necessary to compile with
the -DHAVE_STDINT_H flag. Ticket #3860. (CVS 6657)