Commit Graph

10681 Commits

Author SHA1 Message Date
drh
7e36962e6c Make use of xFetch, if it is available when doing a VACUUM or a backup.
FossilOrigin-Name: 83bc37af07857960c11275891f853a358dcbbf05
2013-04-03 03:53:15 +00:00
drh
7d9f3943ba Add the -mmap option to the command-line shell, for setting the default
mmap_limit.

FossilOrigin-Name: fc30d06c94c8212abb0477fb4cec4520d05bea34
2013-04-03 01:26:54 +00:00
drh
85830a70c2 Fix the unix driver to check defined(_BSD_SOURCE) rather than just the plain
_BSD_SOURCE macro.  This fixes the build for OpenBSD.

FossilOrigin-Name: 1dd42ef4144ee08fb4ee1676d934a56a0e34bac2
2013-04-03 00:42:01 +00:00
dan
48ccef8059 Fix a resource leak in os_unix.c.
FossilOrigin-Name: b29cda03fe4e8d8f5b5acbbea2d69f284a2bdf23
2013-04-02 20:55:01 +00:00
drh
c3d53189fc Adjustments to mmap1.test so that it works better on windows. It still gets
some answers wrong, but it no longer crashes.

FossilOrigin-Name: ee8d3ceeec40d84adb8798f084b6f1215ab56d92
2013-04-02 20:29:33 +00:00
dan
81d1765ad8 Fix a bug in mmap2.test that was leaving an invalid sqlite3_log() callback installed, causing a crash.
FossilOrigin-Name: c0cdaa07355f51bd217881b5b91ec2a609fa56f4
2013-04-02 20:19:22 +00:00
mistachkin
a9d79ae95d Add assert to the Windows VFS pertaining to the size of the SIZE_T type.
FossilOrigin-Name: 4eeea58354e21797ca1f4dc4ea785d0330381f0b
2013-04-02 20:13:04 +00:00
dan
db082408c6 Add test cases to mmap1.test and pagerfault.test.
FossilOrigin-Name: 3050136be962427cc4dcced6077ef29b2a941405
2013-04-02 18:33:55 +00:00
dan
d409792838 Change an assert in pager.c to acknowledge that it is possible for sqlite3PagerRollback() to return SQLITE_CORRUPT.
FossilOrigin-Name: d641d3d20d80fdb86d91de31fcf2eb5ca3c5c715
2013-04-02 18:31:29 +00:00
drh
a2c16c084a Fix the build for Mac.
FossilOrigin-Name: d36ce0bbad58445c983597ee93438fe07b659cdc
2013-04-02 18:25:04 +00:00
dan
f6653871b2 Add new test file btreefault.test.
FossilOrigin-Name: 7fe908afeba16f64edc16824c67b396138581a8f
2013-04-02 15:37:30 +00:00
drh
07fa864d15 Fix a faulty assert() in the os_win.c VFS.
FossilOrigin-Name: fd6ee54969322203c02ce9bd8744e095faf6a69c
2013-04-02 14:37:40 +00:00
dan
4ff7bc45c6 Add test cases for errors in mmap() or mremap() is os_unix.c.
FossilOrigin-Name: 3098a3c1e7305033904a496ef534cb312a876fab
2013-04-02 12:04:09 +00:00
drh
a3a2b3bdc0 Proposed template preprocessor magic for activating mmap only on platforms
where we know it works.

FossilOrigin-Name: d96272f031102514b02bd839aac9e37618872200
2013-04-02 10:29:13 +00:00
drh
6d81449fc6 Reorder two conditions to make coverage testing easier.
FossilOrigin-Name: 793ba4e996426522eeaa86589a9e974fa1fc1522
2013-04-02 01:45:10 +00:00
drh
092d993cb7 Remove an unreachable condition from pager.c.
FossilOrigin-Name: 3628e86bf131cb205f08a4b299d84007cd6b25c3
2013-04-02 00:41:18 +00:00
drh
98d2038fc2 Always send the SQLITE_FCNTL_MMAP_LIMIT pragma to the VFS, even if the limit
is zero and even if the VFS does not support xFetch().

FossilOrigin-Name: 01ffdabbad30f1c157f2b33b1e85ee4d6c4632dd
2013-04-02 00:15:23 +00:00
drh
3861f546e3 Remove a debugging printf() accidently left in the previous check-in.
FossilOrigin-Name: 8198cdd8ac5dcc1c677fffa869ac965186b96abf
2013-04-01 22:42:48 +00:00
drh
a1f42c7c32 Add the SQLITE_CONFIG_MMAP_LIMIT configuration option for overriding the
SQLITE_DEFAULT_MMAP_LIMIT compile-time setting.  Enhance "PRAGMA mmap_limit"
so that without a specific database name, it sets the limit on all database
files and changes the default for any future databases that might be added
using ATTACH.

FossilOrigin-Name: 78141d0a16dd1d56b575fccd149de7fa789cb06c
2013-04-01 22:38:06 +00:00
drh
a539c8a464 Add a comment to xUnfetch on windows to say that the call to winUnmapfile()
might be unnecessary.

FossilOrigin-Name: e3c63c31a21b27806592d066a013a111b280c61f
2013-04-01 18:25:48 +00:00
drh
db56bcbe42 In windows, round down the size of the memory mapped region to the next
smaller multiple of the page size.

FossilOrigin-Name: 0e44ed1badde6d766f18d1373d968e5b286b15bd
2013-04-01 18:15:50 +00:00
dan
57d6b25ec9 Merge accidental fork.
FossilOrigin-Name: 5f4437c0e35c8aa740515aac3e81e0146716d2bb
2013-04-01 17:58:10 +00:00
dan
e6ecd6630d Attempt to emulate mremap() on non-Linux systems by allocating a second mapping immediately following the first in virtual memory.
FossilOrigin-Name: 4d67433db8fb4754ae6b192945e479f3d7bad579
2013-04-01 17:56:59 +00:00
drh
f9d18e472b Bug fix in the winMapfile() subroutine: Be sure to record the map object
handle in the sqlite3_file object.

FossilOrigin-Name: ee4d188e207efa24a26776fa4f025c6ac39cce73
2013-04-01 17:56:28 +00:00
drh
5175b324b8 Add xFetch and xUnfetch methods to the os_win.c VFS.
FossilOrigin-Name: a1653a257d6af6e8b10c819e68b12f6c2f485811
2013-04-01 17:22:51 +00:00
dan
f55a4cf80c Ensure that a checkpoint does not use an out-of-date mapping.
FossilOrigin-Name: a1040f0397d57855500926494c978623286ddc77
2013-04-01 16:56:41 +00:00
dan
0943f0bdc8 Fix a typo in a log message in wal.c.
FossilOrigin-Name: 83fc48d16572443373e5de62adbd4cd53c2f7786
2013-04-01 14:35:01 +00:00
dan
71be5c5c87 Fix a problem in btree.c that could cause a crash following an OOM.
FossilOrigin-Name: b724aa5889f2e09cf0cbef133a672e6486755104
2013-04-01 14:29:33 +00:00
drh
6c5696381e Fix a comment in os_unix.c. No code changes.
FossilOrigin-Name: 72813b8ec924b91583c679668f7c4561dff82a02
2013-03-26 18:48:11 +00:00
drh
c86e51358b Change the name of the Pager.pFree field to Pager.pMmapFreelist.
FossilOrigin-Name: 611bd824c24a60d298f28705de323fa2e813a308
2013-03-26 14:36:11 +00:00
dan
0aed84d19f In btree.c, save the positions of any open cursors before moving any pages around to auto-vacuum the database on commit.
FossilOrigin-Name: 30c0a69363931a72d1c34e5be71646932398d172
2013-03-26 14:16:20 +00:00
drh
41f89cc676 Previous check-in accidently left mmap turned off by default. This checkin
fixes that.  Unfortunately, shared.test is now segfaulting.  All other
veryquick tests appear to work, however.

FossilOrigin-Name: a850c7319c20b5757983443df05cf2aa4250053b
2013-03-26 01:07:50 +00:00
drh
0d0614bdc6 Memory-mapped I/O is now on by default. The "PRAGMA mmap_limit(N)" can be
used to issue a hint to the VFS to limit mmap space to N bytes.  The VFS
is free to ignore that hint if desired.  However, if "PRAGMA mmap_limit(0)"
is used, xFetch is never called.

FossilOrigin-Name: 1b37c4effdd03aa2ea938a71b4f22ed27391689b
2013-03-25 23:09:28 +00:00
drh
d1ab8065c1 Add munmap and mremap to the set of os interfaces that can be overloaded
in os_unix.c.

FossilOrigin-Name: 8776047bd776bbf266eb9c3b56683badb84ae73e
2013-03-25 20:50:25 +00:00
dan
b7e3a326fe Use mremap() on Linux.
FossilOrigin-Name: 431aecc8600c29c203546e48d256510510238887
2013-03-25 20:30:13 +00:00
drh
dee6554811 Merge all recent trunk changes into the experimental-mmap branch.
FossilOrigin-Name: a607d63f0b6a3d3785e9385187d3e6b92e14fc70
2013-03-25 19:57:26 +00:00
dan
893c0ffc29 Add a test that simulates an error in mmap().
FossilOrigin-Name: 6ec7367d8e98425f00eeb8215ca8964313c1d0b7
2013-03-25 19:05:07 +00:00
dan
a64d5a15b7 Simulate OOM errors in the sqlite3OsFetch() function. Run malloc.test as part of the "mmap" permutation.
FossilOrigin-Name: 77443ef2cd0b29b7822eea544ab8c6c4a93cb67b
2013-03-25 18:25:49 +00:00
dan
df737fe6f5 Change the signature of the xUnfetch method to "int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p)".
FossilOrigin-Name: 115b830509e8f0aa9d5965c1e9cd4f2ed9d01938
2013-03-25 17:00:24 +00:00
dan
aef49d7141 Remove unnecessary code to round the size of a memory mapping to 4KB from os_unix.c. Rename SQLITE_IOERR_MREMAP to SQLITE_IOERR_MMAP. Fix other small issues in os_unix.c.
FossilOrigin-Name: dce35c01a5fe66d2970075b1e3f0376026485e4c
2013-03-25 16:28:54 +00:00
dan
11ac84635b Do not return SQLITE_IOERR when the user attempts to open a small file that is not a database with mmap enabled. Instead return SQLITE_NOTADB.
FossilOrigin-Name: bbcaab3e80d0ff776d8567094b137d1483b3377b
2013-03-25 14:31:39 +00:00
dan
a1afc7425a Fix a case in the pager where an xFetch() reference was being leaked following an OOM error.
FossilOrigin-Name: 5885ba6ce768658ec25b60747430d147b315b55c
2013-03-25 13:50:49 +00:00
dan
e115ff8171 Add a second test for [38b1ae018f].
FossilOrigin-Name: 5062db672c00c3365d51cd6b39815078f5b6b525
2013-03-25 12:02:45 +00:00
dan
1cb90c668c In fts3, when filtering lists for hits in a specific column, edit the list in place in the same way as it is for NEAR filtering. Fix for [38b1ae018f].
FossilOrigin-Name: f85f9103cffa5c8ba6a63a68beb90817147ba080
2013-03-25 11:38:44 +00:00
drh
dba0cb2351 Remove the SQLITE_OMIT_MERGE_SORT compile-time option and its related code.
The merge sorter is now a required component.

FossilOrigin-Name: 8b44d6fb159e85267095e846cded2764c3bcb895
2013-03-24 22:56:49 +00:00
dan
f23da96636 Replace the sqlite3_io_methods.xMremap interface with sqlite3_io_methods.xFetch and xUnfetch.
FossilOrigin-Name: 1431be95579160fb70408d43e17fc23c7b69ab4a
2013-03-23 21:00:41 +00:00
dan
e5586a1a79 Improve a comment in wal.c. No code changes.
FossilOrigin-Name: 60b9f5e4dd2af54975ba78437239f0bebd472fd2
2013-03-23 17:29:06 +00:00
dan
9d56c6df9a Fix a case where a checkpoint operation could write to an invalid part of a memory mapped region.
FossilOrigin-Name: 8dbe89d05ce91428c69003f0da79d883fa23e2b5
2013-03-23 14:20:42 +00:00
mistachkin
2753388e8a In the winMremap VFS function, unmap the region prior to attempting to truncate the file.
FossilOrigin-Name: 8870c4cc6cda07154936644f7df25bd81d6ba38a
2013-03-23 12:15:27 +00:00
mistachkin
46fce002d9 Do not unmap the mapped file region in winTruncate as there may be outstanding pointers to it.
FossilOrigin-Name: f57a9c91e993f76ce8b923e06e721414980e8e61
2013-03-23 10:09:46 +00:00