dan [Thu, 10 Jun 2010 06:53:26 +0000 (06:53 +0000)]
Store the MemPage structure in memory following, instead of preceding, the page data for cached pages. This reduces the likelihood of a corrupt database page image causing SQLite to read past the end of a buffer.
dan [Wed, 9 Jun 2010 16:58:49 +0000 (16:58 +0000)]
When restarting (wrapping) a log file, set all unused aReadMark[] slots to READMARK_NOT_USED instead of 0. Setting them to 0 does not cause a problem, but may cause SQLite to obtain and release a few more file locks than would otherwise be necessary.
drh [Wed, 9 Jun 2010 14:45:12 +0000 (14:45 +0000)]
Shift the meaning of aReadMark[] back so that +1 offset from mxFrame is
removed. Add the new READMARK_NOT_USED value (0xffffffff) instead of
zero to signal an aReadMark[] that is not in use.
dan [Tue, 8 Jun 2010 15:50:53 +0000 (15:50 +0000)]
Close database opened by tester.tcl when it is sourced in all.test. Because test scripts are now run in slave interpreters, this connection was not being closed by the first script run as it was previously.
dan [Sat, 5 Jun 2010 18:12:23 +0000 (18:12 +0000)]
Remove a condition from sqlite3WalRead() that is unreachable as of the changes to clear entries out of the wal-index hash tables on transaction or savepoint rollback.
dan [Fri, 4 Jun 2010 11:56:22 +0000 (11:56 +0000)]
If an attempt to sync the database file as part of a checkpoint fails, do not update the shared "nBackfill" variable. Otherwise, another process could wrap the log and overwrite content before it is synced into the database.
dan [Thu, 3 Jun 2010 09:17:38 +0000 (09:17 +0000)]
If an error (OOM or SQLITE_FULL error) occurs while executing an SQL statement and a statement-transaction is automatically rolled back as a result, if a second error occurs during the statement rollback do a full transaction rollback instead. Otherwise the client can be left with an inconsistent cache.
dan [Wed, 2 Jun 2010 17:15:24 +0000 (17:15 +0000)]
If an error occurs while writing frames to the log to commit a transaction, do not mark the pages as clean in the cache. Otherwise, the subsequent rollback does not roll them back (leaving the client to continue with a cache that makes it appear that the transaction was committed - inconsistent with the database on disk).
drh [Wed, 2 Jun 2010 15:59:05 +0000 (15:59 +0000)]
Make sure the directory used by os_unix.c for shared-memory files is always
the same, regardless of individual client permissions and environment
variable settings.
drh [Wed, 2 Jun 2010 15:43:18 +0000 (15:43 +0000)]
When walTryBeginRead() encounters an I/O error trying to set a lock
(as opposed to SQLITE_BUSY) be sure to propagate that error back up
the call stack.
drh [Wed, 2 Jun 2010 12:58:22 +0000 (12:58 +0000)]
Undo one of the "const" markers from the previous check-in because the
value needs to be changable, even if it is not actually ever changed in
the current implementation.
drh [Tue, 1 Jun 2010 21:02:51 +0000 (21:02 +0000)]
The shared-memory used by WAL on linux now really is shared memory in /dev/shm.
On other unix flavors, the file is in a temporary directory rather than in the
same directory as the database.
dan [Tue, 1 Jun 2010 15:44:57 +0000 (15:44 +0000)]
Delay the decision to restart the log file until data is actually ready to be written to the log file (instead of at the start of a write transaction).
drh [Mon, 31 May 2010 16:56:14 +0000 (16:56 +0000)]
Fix an inconsistent #ifdef in wal.c. Fix os_unix.c so that it does not allow
moving an SHM lock directly exclusive to shared without going through unlocked.
drh [Sun, 30 May 2010 19:55:15 +0000 (19:55 +0000)]
Initial code for incremental checkpoint in WAL mode. This check-in compiles
on unix and runs as long as you do not engage WAL mode. WAL mode crashes and
burns. Consider this check-in a baseline implementation for getting the new
capability up and running.
drh [Wed, 26 May 2010 15:06:38 +0000 (15:06 +0000)]
Change the semantics of xShmGet() such that it will never increase the size
of shared memory. xShmSize() must be used to grow the size of shared memory.
A shared memory segment size cannot be shrunk (except by dropping it).
drh [Tue, 25 May 2010 13:40:03 +0000 (13:40 +0000)]
Update header comments in wal.c to correctly describe the WAL file format.
Update the locking region offsets in os_unix.c and os_win.c and add assert()
statement to verify that the locking region offsets are correct.
dan [Tue, 25 May 2010 10:50:56 +0000 (10:50 +0000)]
If a writer exits unexpectedly in the middle of a transaction, have the following writer remove any wal-index hash-table entries left by the interrupted transaction.
dan [Mon, 24 May 2010 13:57:42 +0000 (13:57 +0000)]
Change the checksum used in WAL files so that each frames checksum depends on the content of the WAL header and all frame headers and content up to and including the frame to which the checksum is attached.
dan [Mon, 24 May 2010 10:39:36 +0000 (10:39 +0000)]
Change the WAL file format to support two kinds of checksums - one that is fast to calculate on little-endian architectures and another that is fast on big-endian architectures. A flag in the wal-header indicates which the file uses.
drh [Sat, 22 May 2010 00:55:39 +0000 (00:55 +0000)]
Add several EXPENSIVE_ASSERT code blocks to validate the wal-index hash table.
Fix the bugs that these code blocks fine. Rename walClearHash() to
walCleanupHash() and simplify its interface.