drh [Mon, 22 Jun 2009 12:05:10 +0000 (12:05 +0000)]
Make sure sqlite3BtreeCreateTable() returns an error code if the largest
rootpage field is invalid in auto_vacuum mode. Update file-format comments
to describe all of the "meta" values. (CVS 6797)
danielk1977 [Sat, 20 Jun 2009 18:52:49 +0000 (18:52 +0000)]
When recovering from the error-state in pagerSharedLock(), do not search for a hot-journal in the file-system if the pager is configured to use an anonymous temp file as the journal. (CVS 6793)
danielk1977 [Sat, 20 Jun 2009 11:54:39 +0000 (11:54 +0000)]
If after obtaining an exclusive lock to rollback a hot-journal file it is found that the journal file has been deleted, do not return an SQLITE_BUSY error. Just downgrade the lock and continue with the current operation. This eliminates a spurious SQLITE_BUSY error caused by a race condition. (CVS 6792)
danielk1977 [Fri, 19 Jun 2009 17:50:01 +0000 (17:50 +0000)]
If a call is made to sqlite3PagerAcquire when there are no outstanding references to any pages and the pager is in the error-state, try to exit the error-state at this point. Previously this was only attempted if the pager was configured to use exclusive mode. (CVS 6788)
drh [Fri, 19 Jun 2009 14:06:03 +0000 (14:06 +0000)]
Reorganize and cleanup the prepared statement object. Remove code that has
been commented out for ages and is no longer relevant to anything. (CVS 6786)
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)