Commit Graph

7808 Commits

Author SHA1 Message Date
drh
23ea97b641 Convert the wal-header and frame-header to 24 bytes. Extra information in
both headers is designed to enhance robustness after crashes, though the
extra information is currently unused.  This is a snapshot of a work in
progress.

FossilOrigin-Name: 669706431f186f92fdc0856a6206419a1e843f46
2010-05-20 16:45:58 +00:00
shaneh
7c767e1113 Merge WIN32 WAL support into trunk. Still some issues with locking to resolve.
FossilOrigin-Name: 43377663fc3569c361867cdea19e8abaf91a163f
2010-05-19 23:41:55 +00:00
drh
f5d6e478d3 Add the SQLITE_FCNTL_SIZE_HINT to the os_win.c VFS.
FossilOrigin-Name: 9894118d20c08951565c2096552d4a3d2413f7b0
2010-05-19 19:39:26 +00:00
drh
9ff27ecdb2 Add the SQLITE_FCNTL_SIZE_HINT operator to sqlite3_file_control() and use it
to give the VFS hints about the ultimate size of a database file when the
file is growing.

FossilOrigin-Name: 2b7e3b4a30d6a7c4a8a4b8e7dd2ed728b565c96d
2010-05-19 19:26:05 +00:00
drh
4c1cb6ab05 Fix a bug in the new checkpoint computation. Also update the checkpoint
algorithm in the test scripts to align with the new implementation.

FossilOrigin-Name: 8b6056f2ee596f31b157a792fac05d11f7cb63bb
2010-05-19 19:09:37 +00:00
drh
584c754d65 Revise the checksumming algorithm in wal.c. More variable refactoring.
FossilOrigin-Name: 542b90eba6440a0bccef329788fd17a2d3fbeee6
2010-05-19 18:08:10 +00:00
drh
6e81096fa2 Refactoring some variable names in wal.c.
FossilOrigin-Name: 1d201ff51f7c5ecdf71a91ed25204b7130894282
2010-05-19 17:49:50 +00:00
drh
027a128a78 Add a large comment to wal.c describing the WAL and wal-index file formats.
FossilOrigin-Name: a71a22b52f4570e934063553a81b39268127dc44
2010-05-19 01:53:53 +00:00
drh
29d4dbefaf Update the wal-index hash format so that hash-table space is reused following
a rollback, thus preventing hash table overflows.  Add assert()s to verify
that hash tables do not overfill.  Further refactoring of the wal-index code.

FossilOrigin-Name: ada9a8c7b69c5dd2d66bbf62b61181651e6d2142
2010-05-18 23:29:52 +00:00
drh
a2a42013d2 Refactoring of the WalIterator implementation.
FossilOrigin-Name: b5b60fdcc5dcf41f2c79912075ac241f7ce220d6
2010-05-18 18:01:08 +00:00
drh
5939f44375 Mark the shared-memory in the WAL implementation as volatile.
FossilOrigin-Name: 0a6787908e989bd5e6af25acbdc59ebc8fa61d6d
2010-05-18 13:27:12 +00:00
drh
e730fec883 Comment clarifications in wal.c.
FossilOrigin-Name: a029be10172e2e6a2ef4e3eb2ea1bd0ca85b16ed
2010-05-18 12:56:50 +00:00
drh
69c4696784 Remove an unreachable test from wal.c.
FossilOrigin-Name: 7162c45673d1068d1fda55a70207a3cd77575502
2010-05-17 20:16:50 +00:00
dan
982d4c0c72 Add a note to the documentation of sqlite3_wal_hook() to say not to return SQLITE_ROW or SQLITE_DONE. Or any other value that is not a valid SQLite error code.
FossilOrigin-Name: 2f0b6cbf7b4fa31242ff4f6163226c22ae4f8c9b
2010-05-15 10:24:46 +00:00
drh
89c3f2ff43 Silently ignore errors trying to set the default journal_mode while doing
an ATTACH.

FossilOrigin-Name: b9af4ad2efadfb2fb9e338dc081a6231f1536700
2010-05-15 01:09:38 +00:00
drh
ff59a114bd Fix a typo that (by bad luck) was not a syntax error but which caused some
important lines of code to be skipped when SQLITE_DEBUG was not used.

FossilOrigin-Name: 9ef99d97d25aae81df971d40ad10c544b8f30053
2010-05-14 20:15:51 +00:00
drh
5c092e8a4f Make sure the value of an INTEGER PRIMARY KEY column supplied to triggers
and especially to FK constraints really contains the ROWID and not the
NULL that is stored in the column itself.  Ticket [dd08e5a988d00dec].

FossilOrigin-Name: 636f86095eb1f4bdcfb0c9ed846c4c6b3589c10b
2010-05-14 19:24:02 +00:00
drh
8323521440 Pull in all the latest changes from the trunk.
Update the win32 SHM methods to work with the new interface design.

FossilOrigin-Name: 4b69f2cd315b6b66d10e5190d235114788853258
2010-05-14 16:34:34 +00:00
drh
d91c68f6cc Simplifications to the SHM implementation in os_unix.c, taking advantage
of the removal of the LinuxThreads mess.

FossilOrigin-Name: d1debe5def82a6bc72f11b8787176ac60259630f
2010-05-14 14:52:25 +00:00
drh
8af6c228f8 Simplify os_unix.c by removing support for LinuxThreads. Linux systems must
either use NPTL or else not share database connections across threads.

FossilOrigin-Name: e294b696ba91512b1ca5547774c51ea07b4cb5bc
2010-05-14 12:43:01 +00:00
drh
308c2a5c0f Change the OSTRACEn() macro to OSTRACE(()). Also rename some internal fields
and variables in os_unix.c to be more meaningful and searchable.

FossilOrigin-Name: 5fe529f239cddbf4b7ea57abb02d95cc0d94f5f5
2010-05-14 11:30:18 +00:00
dan
a9f0fc8edc Fix test_osinst.c so that it does not depend on gettimeofday() unless SQLITE_OS_UNIX is defined and NO_GETTOD is not defined.
FossilOrigin-Name: 2a4014b79b852d8b62b4941495b826f154308d86
2010-05-14 10:43:28 +00:00
dan
14740f1cd5 Add xShmXXX methods to test_osinst.c.
FossilOrigin-Name: b8a9b37a3c8d1005a16185c1fc4c414ca11d736a
2010-05-14 08:39:48 +00:00
drh
72339a3e24 Make debugging elements of the sqlite3_mutex object volatile and make them
only appear when compiling with SQLITE_DEBUG.  Ticket [51914f6acd2cb462].

FossilOrigin-Name: e823c60ca4c3d515b8b12dada4631fe8f44975e9
2010-05-13 20:19:17 +00:00
drh
5cccc940cc Allow sqlite3WalCheckpoint() to be called even if the WAL is in the
SQLITE_SHM_READ state, as sometimes happens after an error.

FossilOrigin-Name: 175b296f9b9680f605537f52a8a53944deaa5391
2010-05-13 15:44:00 +00:00
dan
0bfad1171f Remerge mistaken test_osinst.c changes.
FossilOrigin-Name: e8c10d3cf601cc81a620f6c0ba5f195945a3f725
2010-05-13 09:40:30 +00:00
dan
a49ba7c835 Fix mistake in test_osinst.c.
FossilOrigin-Name: 4c3e137803f86ec5a6c68bfaa29a2847ba48fd65
2010-05-13 09:32:30 +00:00
drh
5500a1f1e6 Make sure xShmGet is never called while already holding the shared-memory
segment.

FossilOrigin-Name: 92ebdbc5f64ac63796ff56c1e1aec3b95c6bdd20
2010-05-13 09:11:31 +00:00
drh
043c20e63e The refactored of VFS SHM primitives are now working so merge the
wal-refactor branch back into the trunk.

FossilOrigin-Name: bce21c18380715e894eac9c173c97315e0d69d93
2010-05-13 08:53:41 +00:00
drh
a925fd256b Change the xShmSize() implementation in os_unix.c so that it will only
increase and never decrease the size of a shared-memory segment.

FossilOrigin-Name: 149d2ae4a6fe2f86822f286d2a7092c51bec7ebb
2010-05-13 08:33:35 +00:00
dan
bd50ddeb42 Fix for a segfault that can follow a malloc failure.
FossilOrigin-Name: 3cab9022457ce50f82c5822d8ba6c04a3a85cb6a
2010-05-13 07:08:53 +00:00
dan
7fd555a634 Modify the VFS in test_vfs.c to match the refactoring of the xShmXXX methods.
FossilOrigin-Name: 25e72f81561575051c63e9bf5d2c8e76f9fcf5c6
2010-05-13 06:19:37 +00:00
dan
fbefb894cc Change the vfs instrumentation code in test_osinst.c to make it easier to deploy. Add a vtab implementation for reading the binary log file format.
FossilOrigin-Name: ee13c8849d234931bb3be36e42383d228b3cbfcb
2010-05-12 19:02:35 +00:00
drh
365e2d255b Fix for the test_devsym.c test module for the VFS-SHM refactoring.
FossilOrigin-Name: 49d62933759d4e160ee3a4dd2aa316a2f5bbb4e6
2010-05-12 18:30:36 +00:00
drh
686138fe88 A couple simple fixes to get wal.test mostly working.
FossilOrigin-Name: c74458127468f30b16715594c8d68e9d3c05d292
2010-05-12 18:10:52 +00:00
drh
d9e5c4f6ed Refactoring the VFS-SHM methods used by WAL. This version compiles and
runs non-WAL test cases but crashes and burns on wal.test.

FossilOrigin-Name: 2b00152c1ac0b3735aa6cfab61259ff04d81c701
2010-05-12 18:01:39 +00:00
shaneh
50f6455f41 Updates to WAL support in os_win.c: pulled in latest changes from src/os_unix.c; updated tracing; misc. improvements.
FossilOrigin-Name: 76504726a1ef7f6a0445ec800776462138b22d72
2010-05-12 17:14:59 +00:00
drh
eaf52d883a Remove the OP_Variable optimization of check-in [48b77b04935d894] since it
can lead to malfunctions as described in ticket [26ff0c82d1e90].

FossilOrigin-Name: 7838163d087780a6fb403a17641b96f71baec088
2010-05-12 13:50:23 +00:00
dan
ed36020daf Remove a branch made redundant by the earlier exclusive-mode changes.
FossilOrigin-Name: c501b2ede6aad123bef0aa7ce8b356a134eb6d26
2010-05-12 06:54:31 +00:00
dan
97c1f6c8f2 Have os_unix.c use the suffix "-wal-index" for wal-index files instead of "-wal-inde".
FossilOrigin-Name: 885e854e7cdc79ecc9d5772d563ddc0f61753ab6
2010-05-11 16:29:54 +00:00
drh
be5481578a When an attempt to change journal_mode fails due to locks, be sure to
leave internal structures in a consistent state.

FossilOrigin-Name: cf3d1e0b8a739302cf2848ac3e6eaaae04e6a44c
2010-05-11 14:00:39 +00:00
dan
5543759b1b Changes so that WAL and exclusive-locking mode work together.
FossilOrigin-Name: 71e7b1cf9f4cd02a2a9bc8a3e58acd7a7e3c7e60
2010-05-11 12:19:26 +00:00
shaneh
04882a9e4a Initial port of WAL VFS support from os_unix.c to os_win.c.
FossilOrigin-Name: 111ad59f21d53d1ec63c084ca5f98f2aaf7cd070
2010-05-11 02:49:39 +00:00
shaneh
a10069dd22 Updates for to WAL TCL test scripts to support running on Windows.
FossilOrigin-Name: 6a5630806c87b0f4e5632c37c357f98effd9608a
2010-05-11 02:46:16 +00:00
drh
09b1330026 Fix an off-by-one error while constructing the name of the mmap file for
the wal-index under os_unix.c.

FossilOrigin-Name: 6e3735f72cb7d2f4d16c8f9bc59ff159c75243e5
2010-05-10 19:51:32 +00:00
dan
7ddccd2aad Merge [96d6eaf4d2] and [40b0a6357b].
FossilOrigin-Name: c67756c404669141fa06a1ce3f1efadefa277bc6
2010-05-10 18:10:17 +00:00
drh
1c5bb4d69c Fix an uninitialized variable in OSX proxy locking.
FossilOrigin-Name: 96d6eaf4d2be453191b36875811d9556ad0763ed
2010-05-10 17:29:28 +00:00
dan
bb23aff3df Modify the format of the wal-index to use a hash table to index log file segments.
FossilOrigin-Name: 40b0a6357b160e04326ab176955a68a1cf3f8b7c
2010-05-10 14:46:09 +00:00
drh
acd0781892 If an ATTACH command files due to OP_JournalMode but still attaches the
database, make sure VACUUM still detaches it when done.

FossilOrigin-Name: 6ecdc7ba2b5e79e8b5862fb49cf6c2b99a40659a
2010-05-10 14:10:57 +00:00
drh
ab9b74443c Enhance the OP_JournalMode opcode with an ignore-errors option and use that
option the ATTACH command.

FossilOrigin-Name: 0bdea4cfbd7832f2a00c01b93c92ba13d20139ef
2010-05-10 11:20:05 +00:00