Commit Graph

9650 Commits

Author SHA1 Message Date
drh 4120994fdf Assert that the isCommit parameter to sqlite3WalFrames() is zero if and
only if the nTruncate parameter is zero.

FossilOrigin-Name: 979daf92e09305665d943e197b93b81139197c5b
2011-12-20 13:13:09 +00:00
dan 19969d96ce Add test for WAL mode to unixexcl.test.
FossilOrigin-Name: 4d518bd4801c31bb1e4fb0329ad057e549035237
2011-12-19 15:46:51 +00:00
dan 7f9026dd94 Fix a couple of test cases to account for the master-journal name related change in [cf3bccc2].
FossilOrigin-Name: 21b76af6edd48f665cdd3af5f99d477f030c7668
2011-12-19 11:16:39 +00:00
drh fe6163d7cf Merge in changes that cause the first sector of the WAL file to be synced
when the WAL restarts.  This is a fix for the power-loss corruption
problem described in ticket [ff5be73dee086]

FossilOrigin-Name: 44ca4d123385d759c11919865525c998c2e35bdb
2011-12-17 13:45:28 +00:00
dan 533100d3a3 Add tests to walcrash3.test.
FossilOrigin-Name: d76880428013ae2c5be00d87bb3e1695af6f706f
2011-12-17 08:10:34 +00:00
drh d2980310d0 Make sure the Salt-1 value in the WAL file is sequentially numbered at
each checkpoint, as it says it should be in the documentation.

FossilOrigin-Name: 7b63b11b93396079131686abb36c4221354fa50e
2011-12-17 01:31:44 +00:00
drh 4eb02a4556 Enhance the WAL header sync so that it honors the various synchronous
pragmas, settings, and device characteristics.

FossilOrigin-Name: 9799241f7de952c4d1ea8bf6508b577d2b57a370
2011-12-16 21:26:26 +00:00
drh 88f975a7a4 Proposed changes that ensure that the WAL header is written prior to the
first commit mark.

FossilOrigin-Name: 91d0437c0702904d27f0ef7b1b52d0797efe1826
2011-12-16 19:34:36 +00:00
dan e98842f02d Add code for a test that was failing before the persistent-wal related changes of [9ccc4a1be].
FossilOrigin-Name: 49d21ce50fcf535e470d284ccbb9eb4d4bcfa3a6
2011-12-16 17:01:04 +00:00
drh eed4250598 Merge the fix for [a1fa75cbdd02] from the experimental branch. Also
fix the persistent-wal mode feature of truncating the WAL on close so that
it always truncates the WAL to zero bytes.

FossilOrigin-Name: 09ccc4a1be7ba81890f10aac6623dd90dab4f990
2011-12-16 15:38:52 +00:00
drh 84968c051d Improved logging of master-journal name conflicts.
FossilOrigin-Name: b1005ef46cc2b46dd8e448ae1a9a9508bd5666ab
2011-12-16 15:11:39 +00:00
drh b654ee20fe Merge the nx-devkit changes into trunk.
FossilOrigin-Name: cf3bccc2e944cd2dd3efb8554682994a06115f16
2011-12-16 13:42:03 +00:00
dan f60b7f36c1 Experimental fix for [a1fa75cbdd].
FossilOrigin-Name: 6492af76ea6585a1b377d69751af930c0ccfe688
2011-12-16 13:24:27 +00:00
drh 8c24a369a5 Tweaks to the way multiplexSubOpen() works, for backwards compatibility.
FossilOrigin-Name: bb40338887c912be70cb6fe3b760d87c14bb88a5
2011-12-16 05:50:39 +00:00
drh 0699966798 Fix a potential infinite loop (inserted by the previous check-in)
on the multiplexWrite() method of the multiplexor.

FossilOrigin-Name: 022bf427c2edfe494ec7c222f436953ff56574a6
2011-12-16 05:09:46 +00:00
drh e7d9f13d99 The xTruncate method for the multiplexor now changes surplus overflow
files to zero-length by default.  Or if the "truncate" query parameter 
is used, it actually deletes the surplus overflow files.  This allows
VACUUM to shrink the database again.

FossilOrigin-Name: 5aefef04d6cc3b734c3f05e036b3869a52248f4d
2011-12-16 04:57:32 +00:00
drh 38deeb9763 Call sqlite3_log() with an appropriate message if unable to find a unique
master-journal filename.

FossilOrigin-Name: e9177f7d4ec19f0841d0613990d2fb5725700ba1
2011-12-16 01:30:15 +00:00
drh 5c531a4aab A better solution to being unable to find a unique master-journal filename:
just delete an existing master-journal and reuse it.

FossilOrigin-Name: 2685c2b949061f18bf6a4940eac8c8148873abb6
2011-12-16 01:21:31 +00:00
drh f580860f51 Make sure the antipenultimate character of master-journal filenames is a "9"
in order to avoid collisions with other files in 8+3 filename mode.  Also,
limit the number of attempts at finding a unique master-journal filename.

FossilOrigin-Name: 34a0483605d36e6cf03065ed0df33fb1f7c8a272
2011-12-16 00:33:04 +00:00
drh 14ec1ffecf Add stdio support to the quota VFS.
FossilOrigin-Name: 322bd15f97143d39b3a88d5f6cf7afb454e0666e
2011-12-15 17:44:33 +00:00
drh c39f3e0085 Use _commit() rather than FlushFileBuffers() as a substitute for fsync()
on windows.  Also cast for C++ and add support for SQLITE_FCNTL_VFSNAME.

FossilOrigin-Name: e85cfe9a17a2943ee0cf7915451ff6cc05908030
2011-12-15 17:42:35 +00:00
dan e712b5823e When deleting a file with the multiplexor VFS, also delete any overflow files that exist.
FossilOrigin-Name: 3af1feaa35d3fb2e7be550cd32a727001b874938
2011-12-15 17:00:10 +00:00
drh 78c0eafb35 Make sure the chunksize in test_multiplex does not cause the pending byte
to fall near the end of a chunk.  Adjust the chunksize upward as necessary
to prevent this.

FossilOrigin-Name: e05f8a2998f4f4cbdb65702baa65893c538b3d38
2011-12-15 13:29:12 +00:00
dan 31b21295b0 Fix some problems with dropped error codes in multiplexOpen().
FossilOrigin-Name: 2d50f78188e3297e8cefdf73cff51fa0a3b36e65
2011-12-15 11:45:19 +00:00
drh 2be25bffca In the multiplexor, do not try to delete overflow files that do not exist.
And assume all but the last overflow file is the size of the chunk size.

FossilOrigin-Name: a822a80d3cfe42b2fca6f8c9ff11762993114a27
2011-12-15 02:22:16 +00:00
drh a60ef3d570 Merge the nx-devkit changes into trunk. This includes the new
SQLITE_FCNTL_VFSNAME file-control.

FossilOrigin-Name: da118e02c0576ce16f7a26663f59413316223d55
2011-12-14 18:33:13 +00:00
drh 0f2ab8db33 Merge the VFSNAME file-control addition into the nx-devkit branch.
FossilOrigin-Name: 08c1dc517c1340737a55ad9012b7b06f72899c6f
2011-12-14 18:28:18 +00:00
drh de60fc2d87 Add a file-control that will discover the name of the bottom-level VFS and
all the shims in between.

FossilOrigin-Name: cdbfb553af02d10767a905489d9dfc57fc6be54e
2011-12-14 17:53:36 +00:00
drh 43a6d4bd44 Improvements to comments. No code changes.
FossilOrigin-Name: 08bbbd8e38697908ab8ae0f6b512d01c32f7e4da
2011-12-14 01:38:12 +00:00
mistachkin 6ca514b075 Treat a zero return value from the Win32 APIs MultiByteToWideChar and WideCharToMultiByte as an error condition.
FossilOrigin-Name: c65e5a36f1a1c91cb3415158ebe0f5759cbcdf96
2011-12-14 00:37:45 +00:00
drh 49ed5c8562 Harden the utf8-to-mbcs converter in the quota module against failures.
FossilOrigin-Name: 1cda511deb625868395a23c95346e14d0c300670
2011-12-14 00:04:52 +00:00
drh 27cec37d8e Enhancements to test_quota.c: Remove the external dependency on
sqlite3_win32_utf8_to_msbc().  Add an extra parameter to quota_fflush()
that will also do an fsync (or the equivalent).

FossilOrigin-Name: 92f4188f90e3cdd71f1457a6e0eb22615e4a54f4
2011-12-13 23:26:10 +00:00
dan 27e69643cf Add a hard limit to the number of chunks a multiplexed database may consist of if ENABLE_8_3_NAMES is defined.
FossilOrigin-Name: 43a1264088c57bf598787b7a9f5d7a2536603d67
2011-12-13 19:03:34 +00:00
drh c7f946297a Change the SQLITE_EXTRA_INIT routine to take a single argument which is a
pointer to a string.  Call SQLITE_EXTRA_INIT with a NULL argument.
Fixes to multiplexor to treat the VFS properly in corner cases.  Fix the
initialization of multiplex3.test.

FossilOrigin-Name: 8e65b9132530e46c62bd1352bfc2e9c29f57af5f
2011-12-13 18:22:38 +00:00
dan add995cc25 Add extra tests for the multiplexor VFS. No changes to code.
FossilOrigin-Name: c7de6f683d0fec62bc138b4a53b5cccc80c736c3
2011-12-13 16:40:33 +00:00
drh 1cdf011da3 Merge the nx-devkit changes into trunk.
FossilOrigin-Name: 03a70c3dae8d912fccd9d72c575dc372b198d238
2011-12-13 15:37:12 +00:00
drh 658dd586ed Update the multiplex.test script to conform to that found in the "experimental"
branch off of trunk.

FossilOrigin-Name: 2eb79efbff9cdab843b172e9fa9fb400c542fab1
2011-12-13 15:25:06 +00:00
drh 5b1626aa47 Move the multiplexor changes in the experimental branch
(check-ins [255d21499b] and [199f52bced]) into the nx-devkit branch.

FossilOrigin-Name: eb95d2f72c625bcfd0f8e9db1db2cb8799854b57
2011-12-13 15:02:54 +00:00
drh e5077c1211 When an sqlite3_auto_extension() function fails, report back its actual
error code, not the generic SQLITE_ERROR.

FossilOrigin-Name: ce55f250f56fa3a1ca864f81e9e86f911b981490
2011-12-13 04:08:36 +00:00
drh 43795e3b0b When the multiplexor FileSize procedure fails to open the file, assume that
the file is zero bytes in size.

FossilOrigin-Name: dc8118cd89da71f2035c6ee07c0edb772bba2186
2011-12-13 02:41:13 +00:00
drh 9797706c04 Add a compile-time shutdown procedure to be called by sqlite3_shutdown()
to undo the effects of the compile-time initialization procedure.

FossilOrigin-Name: c2ed86f5945662a4ddcdc7b303df3f64fb3bf17d
2011-12-13 01:34:21 +00:00
drh 73795becfe Backport a minimal set of changes needed to get 8+3 filenames and the
multiplexor shim playing well together.

FossilOrigin-Name: c4e2ce486217c96373836bfe641f46abf891799a
2011-12-12 20:01:12 +00:00
dan 28a67fd3f8 Fix os_unix.c so that, unless 8.3 filenames are actually in use, journal and wal file permissions are assigned correctly even if SQLITE_ENABLE_8_3_NAMES is defined.
FossilOrigin-Name: 169e12295cca701443746b1209bd6a7714fd8988
2011-12-12 19:48:43 +00:00
drh 663cebfeae Make sure the quota logic is usable as C++.
FossilOrigin-Name: f4534bd3023a599691018f35389a76045e49d831
2011-12-12 19:47:25 +00:00
dan 694592b247 Change the multiplexor VFS so that xTruncate is a no-op on database files.
FossilOrigin-Name: ee1e012256ae8010b6b6c4895a74b6883f20e73c
2011-12-12 18:55:44 +00:00
dan dc8ac1dd76 Fix for the xFileSize method of test_multiplex.c when used on a file opened with the DELETEONCLOSE flag set.
FossilOrigin-Name: 713071c493e9937a20c436b07299df428249e378
2011-12-12 18:21:44 +00:00
drh 743e003c0e Add magic comments to shell.c to make it easier for scripts to
insert additional version information displays for custom builds.

FossilOrigin-Name: 9b2691aa911289d74bfe3edf45937a33fb7eaa8d
2011-12-12 16:51:50 +00:00
drh 58cd3c6162 In the multiplexor shim, when using 8+3 filenames, begin numbering journal
overflow files with 101 instead of 001 to avoid name collisions with the
main database file.

FossilOrigin-Name: 05bf8a0b17a13a581ac973dc84ceaf66532d7f92
2011-12-11 22:44:09 +00:00
drh 630d296c57 Update comments describing the flattening optimization in select.c.
FossilOrigin-Name: dab4c137a852222f11179fa2ade52d17a4206dd2
2011-12-11 21:51:04 +00:00
drh e752cda894 Fix STAT3 so that it works with the new uninitialized register logic of
the VDBE.  Ticket [7bbfb7d4422ff]

FossilOrigin-Name: d11a57985c394772043c63d4c2b534944be0a664
2011-12-11 02:30:35 +00:00