1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-04-23 06:45:40 +03:00

1192 Commits

Author SHA1 Message Date
drh
3a7df358ab Merge recent trunk changes into the statvfs branch.
FossilOrigin-Name: 995ec8a41a7d091d9d87cb8f18f62102c8fda7d7
2011-12-22 02:10:57 +00:00
dan
7c3210e641 Fix other problems where 32-bit integer overflow may cause a problem. Two that require an improbably large sub-journal and two in test harness code.
FossilOrigin-Name: c723e3e18a008922281d8d6e8e3aba07941eb173
2011-12-21 18:04:41 +00:00
drh
374f4a0447 For improved clarity of presentation,
refactor some of the code associated with ZERO_DAMAGE and sector-size.

FossilOrigin-Name: 1dde96c9ee88af1c4e37c2e65acb7c0fe6a20e2a
2011-12-17 20:02:11 +00:00
drh
8bbaa89d8d Add SQLITE_IOCAP_ZERO_DAMAGE and enable it for both unix and windows. Use
this device characteristic to reduce the required work in journaling.
A side effect is that this changes the default page exists back to 1024
even with the use of statvfs().

FossilOrigin-Name: a0be6ea464695fdf1eaf2b7cf0652778617814f2
2011-12-17 19:49:02 +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
09419b4bae Add the sqlite3_db_release_memory() interface and the shrink_memory pragma.
FossilOrigin-Name: 3f58e7c8895d1252eff56282c08b1a6f1194452c
2011-11-16 19:29:17 +00:00
dan
f673e09ef5 Move function sqlite3PagerClearCache() out of the "ifndef SQLITE_OMIT_WAL" block and into an "ifndef SQLITE_OMIT_VACUUM" block.
FossilOrigin-Name: 5dbfaed8c3e09ea35033dacf6faa3d6a0202cc68
2011-11-06 05:06:13 +00:00
dan
1a83bc5b1a If an error occurs while writing to the database file during a VACUUM, discard the contents of the in-memory cache. This is required as if the database is a zipvfs database, the contents of the cache may be inconsistent with respect to the database as stored on disk.
FossilOrigin-Name: 07159e84b40b01fa40cac5fad1f433888e5984f8
2011-10-21 14:27:32 +00:00
drh
b07028f71c Add assert() statements and eliminate needless variable assignments in order
to get the clang scan-build utility to report zero problems against the
SQLite core.  Clang's static analysis did find one real problem - but it was
in the command-line shell, not in the SQLite core.

FossilOrigin-Name: 60fee9574b0125705787e33c16f116cf188c8323
2011-10-14 21:49:18 +00:00
dan
58ca31c905 Add the SQLITE_DB_STATUS_CACHE_HIT and MISS options. For querying the number of cache hits and misses on a per-connection basis.
FossilOrigin-Name: 5100b6e9dc5107f0f835d0aac26fe6d4938ffc73
2011-09-22 14:41:16 +00:00
dan
73ac46da31 Remove a stray merge-sort related change from pager.c and pager.h.
FossilOrigin-Name: 69823ed163049d6fa1e24a9810c3c99f2a8fdd46
2011-09-19 11:57:34 +00:00
drh
34163c6831 Remove some dead code. Fix a faulty assert(). Improve some variable names.
FossilOrigin-Name: a9a64592cf88580cb254fb0aac65a2f2085976ec
2011-09-02 21:42:33 +00:00
drh
2a5d9908f9 Create a new pager type, PAGER_SORTER, for use in the external merge sort.
Such pagers are always held in memory but do report when they are under
memory pressure by calling pagerStress.

FossilOrigin-Name: c71d73201d950355862dd8d5de142c9673888755
2011-08-26 00:34:45 +00:00
drh
14438d12b1 Mark an unreachable branch in the recent WAL problem as unreachable.
FossilOrigin-Name: 3e8a29ff8953054cb3b88db5997b5bae38ba09dd
2011-05-20 01:49:30 +00:00
drh
e5a1320d73 When committing a WAL transaction, make sure at least one page is
written to the WAL file so that the WAL subsystem will have a page
on which to set the commit flag.
Ticket [2d1a5c67dfc236].

FossilOrigin-Name: 67bf1c9a888b0d84d252d6c4c754c2c51994d208
2011-05-19 01:21:42 +00:00
drh
81cc516352 Add the ability to limit filenames to 8+3 using the
SQLITE_ENABLE_8_3_NAMES compile-time option together with a URI
parameter of "8_3_names=1".

FossilOrigin-Name: 96d609856025919571f781207dfa6a24b1732e8d
2011-05-17 20:36:21 +00:00
drh
85a8375580 Enhance WAL mode so that the WAL file honors the journal size limit set
by PRAGMA journal_size_limit.

FossilOrigin-Name: db7e500f69faf1906a84991ba67d26a195f02ae5
2011-05-16 21:00:27 +00:00
dan
cd74b611f4 Add the start of the "uri-filenames" feature.
FossilOrigin-Name: b8a8132e7148a7c90ca1352f20ab71d97b0bc4b0
2011-04-22 19:37:32 +00:00
dan
ce8e5ffe1c When committing a WAL transaction, do not write any pages to the WAL file with page numbers greater than the size of the database image in pages.
FossilOrigin-Name: 311d0b613d9cfa2dbcbb9ef2450041b1fd48770a
2011-04-05 16:09:08 +00:00
drh
7f0857c437 Fix a typo in a comment. No changes to code.
FossilOrigin-Name: af4756184a255f5d8a5cd276bf9f2fc3b38d9169
2011-02-24 21:10:00 +00:00
drh
87fa53ee8d Merge in the blocking-checkpoint enhancement, including the new
sqlite3_wal_checkpoint_v2() interface and the
PRAGMA wal_checkpoint(full) statement.

FossilOrigin-Name: bac7342c368a7c4f5f2878e08d9581dcbf57dd58
2011-02-02 16:34:08 +00:00
dan
6d311fb0ac Fix a problem causing builds with SQLITE_OMIT_WAL defined to fail.
FossilOrigin-Name: b9b48dd8ddceec009b5a22a3699e1524542c004a
2011-02-01 18:00:43 +00:00
drh
bd1334dfd9 Change pager_truncate() to a different method for extending files while
also ensuring that writes are page-size and page-aligned.

FossilOrigin-Name: 874bc8844f6494cdbf700bd884dee67d40f11fc0
2011-01-28 15:46:14 +00:00
dan
fb3828c25f When extending a database file, do so by writing one or more page-size chunks of data to the file, instead of just a single byte to the end.
FossilOrigin-Name: 58577135a81d3f19667b1de6167d2e3f1b74cd53
2011-01-28 15:07:55 +00:00
drh
534a58a76d Make sure the return code from doing an xSync is correctly initialized
so that a valid return code is produced regardless of the path taken through
the logic.

FossilOrigin-Name: f12b5d76854c2f294ac60afe38a6dac37eb5b174
2011-01-25 16:48:56 +00:00
drh
951596cdef Change the name of SQLITE_FCNTL_SYNC to SQLITE_FCNTL_SYNC_OMITTED and only
send it when PRAGMA synchronous=OFF.  Add better documentation to explain
what that file-control opcode is used for.

FossilOrigin-Name: 64914980855dbbf19512642836ca962a507b3ddb
2011-01-25 16:20:16 +00:00
dan
d1cf7e2972 Fix a broken assert() in pager.c.
FossilOrigin-Name: 13108ce13c281f31aa60b403567710ae3d925797
2011-01-25 11:33:01 +00:00
drh
c5aae5c90b Add back an ALWAYS() to regain full test coverage.
FossilOrigin-Name: b93f6f3e679c7710f42580a8dd9ce43136376c1d
2011-01-17 02:24:12 +00:00
drh
d40d7ec78b Make sure the change-counter and SQLite-version fields of the header are
set correctly even when doing a VACUUM with locking_mode=EXCLUSIVE.
Ticket [5d863f876ee9561b].

FossilOrigin-Name: 04fa1e16905183b948ee6456675799a873d5f97d
2011-01-16 00:56:19 +00:00
drh
54a7347aa1 Fix the change-counter increment for WAL pages so that it works even when
invoked from xStress.  Ticket [5d863f876ee9561b95e2].

FossilOrigin-Name: 228e7c34c64114670fe015747d47fdaa3b7e1270
2011-01-15 18:11:12 +00:00
drh
104a7bba8c Increment the change counter and update the SQLite version number whenever
page 1 is added to the WAL.  Ticket [5d863f876ee9561b9]

FossilOrigin-Name: c1e0d09cd3f5feae123468a35f147021d839641c
2011-01-15 17:12:59 +00:00
dan
354bfe0363 Add the SQLITE_FCNTL_SYNC file-control.
FossilOrigin-Name: b3f2f465c310a2cfef8731a0dae3453593b68de9
2011-01-11 17:39:37 +00:00
dan
9f4beedb6f If a rollback is attempted in journal_mode=off mode, force SQLite to discard the contents of the pager cache before processing any subsequent queries.
FossilOrigin-Name: ece7efce2733b4fdd71db385abebbde464ac8f30
2011-01-11 16:09:55 +00:00
drh
c84e033c92 The previous check-in with changes to the max_page_count pragma was not
quite correct.  This check-in fixes the problem.

FossilOrigin-Name: 30c26c3b13b29ce57683e91ac11641d4eb4d678f
2010-11-23 20:25:08 +00:00
drh
27f9aba18c Merge the checkpoint_fullfsync pragma and the superlock demonstration into
the checkpoint-v2 experimental branch.

FossilOrigin-Name: ebf74015f09fe241c1c6902dc8954f2b59ab41ec
2010-11-19 18:51:31 +00:00
drh
c97d84638e Add the checkpoint_fullfsync pragma which enables F_FULLFSYNC on checkpoint
operations only, not during ordinary commit fsyncs.

FossilOrigin-Name: a069867301de3ca2e1753bd4d2e426d27365be4c
2010-11-19 18:23:35 +00:00
dan
cdc1f049bf Modify the interface to the blocking wal-checkpoint functionality.
FossilOrigin-Name: 72787c010c8944e8fcf9c98aa4482f129142d8e9
2010-11-18 12:11:05 +00:00
dan
a58f26f93f Add experimental command "PRAGMA wal_blocking_checkpoint", which uses the busy-handler to block until all readers have finished in order to ensure the next writer will be able to wrap around to the start of the log file.
FossilOrigin-Name: 7e3fc2c833a5baa08820c499867b6902bdc2ed5a
2010-11-16 18:56:51 +00:00
shaneh
eb5dae1a65 Fix an assert that fired incorrectly when PRAGMA omit_readlock was set.
FossilOrigin-Name: e068758222bcd3f2367e9346f7154780cd395ddd
2010-11-09 20:33:33 +00:00
dan
6a88adcdeb Include the print_pager_state() function only if SQLITE_DEBUG is defined.
FossilOrigin-Name: 3104f17e5dd0be4f176905dde6df3be50ba28702
2010-11-04 04:47:42 +00:00
dan
8c40800439 If a database file with the WAL flag set is opened in exclusive-locking mode, use heap memory to store the wal-index instead of shared-memory.
FossilOrigin-Name: 8dd5c69198619866923c6053b71899c1fb8c4c67
2010-11-01 17:38:24 +00:00
dan
76de8a750a Prevent an assert from failing when opening a zero-length database file with an apparently hot journal with locking_mode=exclusive set.
FossilOrigin-Name: f000ac1e52f56f5fcbc2f8b9cd632656c6dc6002
2010-10-22 13:55:50 +00:00
dan
96b958afae Have the pager change to at least WRITER_CACHEMOD state before marking any pages as dirty (instead of immediately after). Otherwise, if an error occurs, the pager may be left in WRITER_LOCKED state with dirty pages in the cache.
FossilOrigin-Name: 471a4efbb7e5e32b144b2e2128337a6af950b8f5
2010-10-05 17:02:47 +00:00
drh
92683f5462 Make sure the pager cache is cleared if there is any difficulty starting
a new read transaction in WAL mode.  Ticket [313723c356483eff2a4c4bdd2c].

FossilOrigin-Name: e14ef0e8b4a27dbd58338214242eb3928404b176
2010-09-18 19:36:40 +00:00
drh
8c96a6eac0 Remove unreachable branches to facilitate test coverage.
FossilOrigin-Name: 86bcb9aab901713684f978479d29304cc9699e84
2010-08-31 01:09:15 +00:00
drh
75c014c321 Remove the sqlite3BtreeFactor() wrapper routine. All modules now call
sqlite3BtreeOpen() directly.

FossilOrigin-Name: 0900e35348f4b9bf327d6ae2884c4ddbb6345d8d
2010-08-30 15:02:28 +00:00
shaneh
71fe25428e Simplification of changes for SQLITE_OMIT_WAL support in pager.c.
FossilOrigin-Name: afb2484c64bf0cdec8240b9ecd0a794c44a63066
2010-08-26 05:23:37 +00:00
shaneh
9091f775a8 Changes to support building with SQLITE_OMIT_WAL.
FossilOrigin-Name: d1ed743b6ed07ad0ee7d466932c5a83caa9489ee
2010-08-24 18:35:12 +00:00
dan
5f848c3a48 Fixes for the SQLITE_CHECK_PAGES debugging feature.
FossilOrigin-Name: 21a1e5961bba148fda50cc0b7d472ca74f90808a
2010-08-23 18:19:31 +00:00
dan
a35dafcdea Modify the code for reading hot-journal files so that it can handle journals generated by versions 3.5.7 and earlier.
FossilOrigin-Name: b9170f2903c480bca2bdc986e98aaeadfdb9ad2b
2010-08-19 15:11:34 +00:00