drh [Wed, 17 Jun 2009 22:50:41 +0000 (22:50 +0000)]
Avoid an assertion fault if an out-of-memory error occurs while trying
to run the string-concatentation operator on a zero-blob. (This is an
absurd thing to do, but even so, we still should not fault.) (CVS 6778)
drh [Wed, 17 Jun 2009 21:42:33 +0000 (21:42 +0000)]
Fix a problem in vdbe.c that could cause a double-free of memory if the
SQLITE_LIMIT_LENGTH is changed after a statement is prepared but before
it is run. Also remove debugging statements from tkt3841.test. (CVS 6777)
drh [Tue, 16 Jun 2009 17:49:36 +0000 (17:49 +0000)]
Changes sqlite3_prepare_v2() (and related routines) so that if it fails due
to a missing table and the schema is out of date, it retries once before
returning SQLITE_SCHEMA. Other changes to prepare.c to facilitate coverage
testing. (CVS 6769)
drh [Fri, 12 Jun 2009 17:46:19 +0000 (17:46 +0000)]
Change lemon so that it does not generate yytestcase() macros on destructor
cases since destructors are commonly unreachable in a reasonable grammar.
For the reduce-rule switch, gather all no-ops into the "default:" case. (CVS 6757)
drh [Fri, 12 Jun 2009 13:53:51 +0000 (13:53 +0000)]
The lemon parser generator now inserts yytestcase() macros on reduce action
and on each destructor, to verify that all have been executed. yytestcase()
is a no-op by default but can be set to something more useful inside
of %include. (CVS 6755)
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)