/ History for src/backup.c
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History for src/backup.c

2020-05-07
01:56
[b1c90cd4] part of check-in [99749d4f] Fix the handling of reserve-bytes so that the maximum value of 255 can be used. (check-in: [99749d4f] user: drh branch: trunk, size: 27168)
2020-03-09
21:00
[7a64088d] part of check-in [b661ccc8] Report on pages, as well as keys, read and written by BEGIN CONCURRENT transactions. (check-in: [b661ccc8] user: dan branch: begin-concurrent-report, size: 28357)
2020-02-07
01:12
[5e617c08] part of check-in [5a877221] Simplify the code by removing the unsupported and undocumented SQLITE_HAS_CODEC compile-time option (check-in: [5a877221] user: drh branch: trunk, size: 27169)
2019-07-16
19:44
[f70077d4] part of check-in [9e664585] Add new assert() statements in an attempt to help static analyzers avoid false-positives. (check-in: [9e664585] user: drh branch: trunk, size: 28337)
2019-05-04
03:56
[b1d37f6f] part of check-in [5862b83e] Fix harmless compiler warning seen with MSVC. (check-in: [5862b83e] user: mistachkin branch: trunk, size: 28293)
2018-06-06
16:28
[78d3cecf] part of check-in [a10662aa] Change sqlite3BtreeBeginTrans() to return the BTREE_SCHEMA_COOKIE, for a small speed improvement when starting new transactions. (check-in: [a10662aa] user: drh branch: trunk, size: 28288)
2016-10-03
01:21
[faf17e60] part of check-in [ea8affa9] Allocate Parse objects off of the stack where appropriate for a substantial performance increase and a size reduction. (check-in: [ea8affa9] user: drh branch: trunk, size: 28290)
2016-09-02
21:17
[92c2e3b5] part of check-in [d9d8a048] Correctly detect an OOM occurring in the setDestPgsz() subroutine of backup. (check-in: [d9d8a048] user: drh branch: trunk, size: 28508)
17:27
[8e1fb73d] part of check-in [3a9f4750] The previous commit could miss an SQLITE_NOMEM error. This commit catches it. (check-in: [3a9f4750] user: dan branch: mistake, size: 28465)
17:18
[7d986927] part of check-in [7908fc60] Within a backup operation, ensure that a read-transaction is opened on the source database before its page size is read. This ensures the page-size used to write to the backup database is the same as its actual page-size, which is important for ZipVFS databases. (check-in: [7908fc60] user: dan branch: trunk, size: 28443)
2016-08-05
16:16
[17cd25a3] part of check-in [ae72513a] Undo commit [f250166bb]. It is required to handle IO and other errors that occur within a VACUUM of a Zipvfs database. (check-in: [ae72513a] user: dan branch: trunk, size: 28029)
2016-05-20
18:09
[6df65fdd] part of check-in [f250166b] Remove the sqlite3PagerClearCache() routine, which does not accomplish anything useful. (check-in: [f250166b] user: drh branch: trunk, size: 27964)
2016-04-05
00:44
[dae481a8] part of check-in [0c97b802] Avoid unnecessary memset() operations in sqlite3PagerGet(). (check-in: [0c97b802] user: drh branch: pager-get-noinit, size: 28086)
2016-02-13
23:43
[f60f0aa5] part of check-in [6a9c4a3e] Enhance ability to debug out-of-memory errors. (check-in: [6a9c4a3e] user: mistachkin branch: noMemBkpt, size: 28029)
2015-11-04
20:22
[2869a76c] part of check-in [708253be] Rename the sqlite3PagerAcquire() function to sqlite3PagerGet(). The former macro called sqlite3PagerGet() has been removed. (check-in: [708253be] user: drh branch: trunk, size: 28014)
2015-09-23
19:17
[c3a9c420] part of check-in [5b61b72f] Take care that the number of reserved bits per page is consistent between the source and destination databases when doing the back-copy on a VACUUM. (check-in: [5b61b72f] user: drh branch: trunk, size: 28043)
2015-07-01
19:59
[4d9134dc] part of check-in [2a897b9e] Avoid create a stack from in sqlite3BackupUpdate() in the common case where the first argument is NULL. (check-in: [2a897b9e] user: drh branch: trunk, size: 27933)
2015-02-21
00:19
[ff743689] part of check-in [28c2b726] Keep track of the optimal number of reserved bytes (by looking at reserve byte requests in calls to sqlite3BtreeSetPageSize()) and then change the reserve byte count to the optimal when doing a VACUUM or when using the backup API. (check-in: [28c2b726] user: drh branch: trunk, size: 27825)
2014-11-13
14:18
[7ddee9c7] part of check-in [169b5505] Have calls to sqlite3_backup_init() fail if there is already a read or read-write transaction open on the destination database. (check-in: [169b5505] user: dan branch: trunk, size: 27818)
2014-11-11
22:55
[8cdfeb0c] part of check-in [d4b2d5d0] Enhance ROLLBACK so that pending queries are allowed to continue as long as the schema does not change. This is a cherry-pick of check-in [b5df5ac052]. (check-in: [d4b2d5d0] user: drh branch: branch-3.8.7, size: 26760)
01:33
[86b311af] part of check-in [fa6e6a9a] Experimental changes that permit read operations to continue after a ROLLBACK, as long as the schema is unchanged. (check-in: [fa6e6a9a] user: drh branch: read-after-rollback, size: 27196)
2014-10-24
00:35
[7f841396] part of check-in [c297a84b] Add the SQLITE_ENABLE_API_ARMOR compile-time option. This is a work in progress and is not yet completely functional. (check-in: [c297a84b] user: drh branch: api-armor, size: 27193)
2014-08-22
18:00
[a31809c6] part of check-in [cf561d1f] Split the sqlite3Error() routine into sqlite3Error() and sqlite3ErrorWithMsg(), for a slight size reduction and performance increase. (check-in: [cf561d1f] user: drh branch: trunk, size: 26757)
2013-12-13
16:23
[a729e63c] part of check-in [9d347f54] Simplication and optimization of error message handling. (check-in: [9d347f54] user: drh branch: trunk, size: 26735)
2013-12-09
20:42
[6cb4c4ee] part of check-in [32fb1784] Modify the way some internal file-controls are invoked. In order to support multi-file transactions in the zipvfs extension. (check-in: [32fb1784] user: dan branch: zipvfs-multifile-commit, size: 26731)
2013-11-15
01:10
[1809a7ca] part of check-in [8dc5c76c] Rework the logic that factors constant expressions out of inner loops, making it both simpler and faster. (check-in: [8dc5c76c] user: drh branch: expr-codegen-enhancement, size: 26728)
2013-08-21
23:42
[2f198798] part of check-in [617e23ec] Simplify the btreeGetPage() routine so that it uses a single flag parameter in place of two boolean parameters. (check-in: [617e23ec] user: drh branch: trunk, size: 26694)
2013-06-13
15:16
[43b34882] part of check-in [3a72af2a] Make the MIN() and MAX() macros available in sqliteInt.h. Add TUNING comments to the NGQP and adjust costs slightly. (check-in: [3a72af2a] user: drh branch: nextgen-query-plan-exp, size: 26698)
2013-04-03
03:53
[b2667673] part of check-in [83bc37af] Make use of xFetch, if it is available when doing a VACUUM or a backup. (check-in: [83bc37af] user: drh branch: experimental-mmap, size: 26809)
2013-03-22
19:17
[6256400a] part of check-in [c8d67aef] Fix a case where the mapped part of a database file may be written during a backup operation. (check-in: [c8d67aef] user: dan branch: experimental-mmap, size: 26760)
2013-02-25
07:12
[b2cac9f7] part of check-in [ac8ca3ec] Catch a dropped error code in backup.c. (check-in: [ac8ca3ec] user: dan branch: incr-vacuum-opt, size: 26748)
2013-02-23
16:40
[0b8d2108] part of check-in [b73847f1] If a rollback mode transaction reduces the size of the database file, avoid actually truncating the file until after the transaction has been committed (but before the db has been unlocked). This means pages that are removed from the database by truncating the file need not be journalled. (check-in: [b73847f1] user: dan branch: incr-vacuum-opt, size: 26703)
2012-12-21
16:15
[32e35a3a] part of check-in [ff6857b6] Ensure the database size field in the db header of a backup database is set correctly. Fix for [0cfd98ee201]. (check-in: [ff6857b6] user: dan branch: trunk, size: 26216)
2012-10-13
19:58
[cab40f2c] part of check-in [af5c9ee4] Ensure that when the source of a backup is a database that is zero bytes in size, the final destination database consists of at least one page. Truncating it to zero bytes is equivalent to zeroing the schema cookie and change counter, which can cause problems for existing clients. (check-in: [af5c9ee4] user: dan branch: zero-byte-backup-fix, size: 25882)
2012-09-28
20:23
[afc067b9] part of check-in [89b8c377] Avoid calling sqlite3BtreeEnter() in a corner case where the corresponding database handle mutex (sqlite3.mutex) may not be held. This prevents a potential deadlock or crash that can occur if the backup API, shared-cache mode and SQLITE_HAVE_CODEC are all in use. (check-in: [89b8c377] user: dan branch: trunk, size: 25659)
2012-07-30
14:53
[5b31b24d] part of check-in [305b6667] Replace a few sqlite3_malloc()+memset() sequences with calls to sqlite3MallocZero(). (check-in: [305b6667] user: dan branch: trunk, size: 25406)
2012-06-21
15:51
[5524df36] part of check-in [fb8893ab] Add the sqlite3_close_v2() interface (from the deferred-close branch) that allows close operations to happen out-of-order in bindings to garbage-collected langauges. (check-in: [fb8893ab] user: drh branch: trunk, size: 25445)
2012-06-02
14:32
[641eab30] part of check-in [e276a02b] The sqlite3_close() interface returns SQLITE_OK even if there are outstanding sqlite3_stmt and sqlite3_backup objects. The connection becomes a zombie. Resource deallocation is deferred until the last sqlite3_stmt or sqlite3_backup object closes. This is intended to help SQLite play nicer with garbage collectors. (check-in: [e276a02b] user: drh branch: deferred-close, size: 25422)
2012-05-15
18:28
[d7fb4c6d] part of check-in [aa0c3493] The former sqlite3ResetInternalSchema() routine was really two different routines, selected by parameter, each with a confused mission. So split this routine up into three separate smaller routines, calling each separately as needed. Hopefully this will make further refactoring and schema reset collateral damage containment easier. (check-in: [aa0c3493] user: drh branch: shared-schema, size: 25457)
2012-02-13
16:43
[6be23a34] part of check-in [9b66c79e] Change the ROLLBACK command so that pending statements to not block it. The pending statements instead return SQLITE_ABORT upon next access. Note: This causes separate shared-cache connections in read_uncommitted mode to abort as well. (check-in: [9b66c79e] user: drh branch: nonblocking-rollback, size: 25453)
2012-01-10
16:40
[e9538bad] part of check-in [7f852ac6] Check the return code from sqlite3OsFileControl() in sqlite3BtreeCopyFile() and report any errors that it generates. (check-in: [7f852ac6] user: drh branch: trunk, size: 25442)
00:24
[52a4450a] part of check-in [38bc4236] Remove the BenignMalloc() from around the call to FCNTL_OVERWRITE. Add new ones around sqlite3OsDelete(). Fix an assert that causes problems for the nx-devkit. (check-in: [38bc4236] user: drh branch: trunk, size: 25343)
2012-01-05
23:32
[62e969b0] part of check-in [11949331] Combine various boolean variables in the BtShared structure into a single boolean vector. Also make performance improvement simplifications to sqlite3BtreeMovetoUnpacked(). (check-in: [11949331] user: drh branch: trunk, size: 25405)
2011-12-31
10:18
[80d71310] part of check-in [3e0833db] Add calls to the BenignMalloc() functions around the SQLITE_FCNTL_OVERWRITE call in backup.c. (check-in: [3e0833db] user: dan branch: trunk, size: 25391)
2011-10-21
17:18
[09685386] part of check-in [be62ef05] Merge the latest trunk changes into the apple-osx branch. (check-in: [be62ef05] user: drh branch: apple-osx, size: 25731)
14:27
[4368158d] part of check-in [07159e84] 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. (check-in: [07159e84] user: dan branch: trunk, size: 25329)
2011-10-15
00:16
[6c140baf] part of check-in [39408702] Added the tool/warnings-clang.sh script. Changes so that there are no warnings with either gcc or clang even including FTS4 and RTREE and both with and without SQLITE_THREADSAFE=0. (check-in: [39408702] user: drh branch: trunk, size: 25264)
2011-10-11
14:19
[669f2888] part of check-in [7e2c4898] Merge the latest trunk changes into the apple-osx branch. (check-in: [7e2c4898] user: drh branch: apple-osx, size: 25651)
2011-10-10
23:53
[5774963f] part of check-in [6cb43f6c] Forward port the Apple-specific changes from [db5b7b778c] in the apple-osx-377 branch. Fix this up so that it will compile and run on Linux. (check-in: [6cb43f6c] user: drh branch: apple-osx, size: 25273)
22:11
[1cf56cc8] part of check-in [db5b7b77] Merging in cherry picked diffs for persist wal, alloc padding, wal-safe vacuum and sqlite3_file_control based lockstate checking (check-in: [db5b7b77] user: adam branch: apple-osx-377, size: 24974)
2011-10-07
16:57
[4fd4440c] part of check-in [1da87fcd] Add the SQLITE_FCNTL_OVERWRITE file-control. Used by SQLite to indicate to the OS layer that the current transaction will overwrite the entire file. (check-in: [1da87fcd] user: dan branch: trunk, size: 25249)
2011-08-25
20:18
[28a4fe55] part of check-in [2c443d47] Reorder some of the branches in backup.c in order to make the code easier to test. (check-in: [2c443d47] user: drh branch: trunk, size: 24871)
19:28
[2d879fd8] part of check-in [472c74b3] Replace an assert() that a condition may not occur in backup.c with code to handle that condition, which can occur. (check-in: [472c74b3] user: dan branch: trunk, size: 24844)
2011-08-23
11:47
[4dfc3904] part of check-in [35e6ac18] When copying a rollback mode database over a WAL database using the backup API, leave the destination database in WAL mode (instead of switching it to rollback mode). Fix for [af95b8c609]. (check-in: [35e6ac18] user: dan branch: trunk, size: 24926)
2011-04-09
17:53
[986c1523] part of check-in [1c2f0f84] Remove an always-true conditional. Replace it with an assert(). (check-in: [1c2f0f84] user: drh branch: trunk, size: 24542)
02:09
[8d738af1] part of check-in [0ca8a233] Do not do a backup if the number of reserved bytes in the source and destination do not match. Try to make the match, but if unable fail. (check-in: [0ca8a233] user: drh branch: trunk, size: 24548)
2011-04-02
16:28
[b7529a66] part of check-in [6a8ad6e3] Begin a series of changes designed to reduce the scope and frequency of invalidating schemas. Design goals are that the internal schema should never be deleted out from under a prepared statement that is running and that all prepared statements should be expired if the schema is invalidated. At the same time, minimize the number of schema invalidations. This change merely revises the sqlite3ResetInternalSchema() function to use -1 as the wildcard for "all" rather than 0, so that we can reset the main schema independently of all the others. (check-in: [6a8ad6e3] user: drh branch: schema-parse-refactor, size: 23802)
2011-03-29
15:40
[537f89c7] part of check-in [dbe569a0] Fix a problem whereby following an IO error in CommitPhaseTwo() of a multi-file transaction the b-tree layer could be left in TRANS_WRITE state, causing problems later on. (check-in: [dbe569a0] user: dan branch: trunk, size: 23801)
2011-01-25
18:19
[6728d6d4] part of check-in [1965b853] Add a missing call to sqlite3PagerSync() removed by [ce552d975] to the backup code. (check-in: [1965b853] user: dan branch: trunk, size: 23795)
2011-01-16
22:37
[8c39a1eb] part of check-in [612e2599] On a backup from a smaller to a larger page size, do not begin committing the transaction until the source pages after the pending byte have been copied. (check-in: [612e2599] user: drh branch: trunk, size: 23230)
2011-01-11
17:38
[ce552d97] part of check-in [a5e4e0ca] Change the page size of the destination database in a backup, if it is changeable, prior to starting the backup. (check-in: [a5e4e0ca] user: drh branch: trunk, size: 23272)
2010-08-31
15:27
[d5b0137b] part of check-in [53b0c03f] Add evidence mark comments to source code. Add additional information to the documentation of sqlite3_release_memory(). Fix a minor inefficiency in mem1.c that was discovered while writing requirements tests. (check-in: [53b0c03f] user: drh branch: trunk, size: 22957)
2010-08-20
15:32
[8ff0b701] part of check-in [5523ecd3] Do not allow a backup to change the page size if a codec is in use. (check-in: [5523ecd3] user: drh branch: trunk, size: 22601)
2010-06-30
04:29
[51d83300] part of check-in [5e19bc36] Add coverage test cases. Have sqlite3_backup_step() transform SQLITE_IOERR_NOMEM to SQLITE_NOMEM before returning. (check-in: [5e19bc36] user: dan branch: trunk, size: 22364)
2010-06-11
17:01
[3dc89da1] part of check-in [95cc3f6f] Refactor and simplify the logic used to change journalmode. (check-in: [95cc3f6f] user: drh branch: trunk, size: 22299)
2010-05-05
18:46
[de980909] part of check-in [ec715778] Do not compare page sizes on source and destination of backup until transactions are started and the page sizes are locked. This is a fix to check-in [7bd44794c4]. (check-in: [ec715778] user: drh branch: trunk, size: 22362)
16:23
[5c2dbddb] part of check-in [7bd44794] Prohibit backup if the destination is using WAL and has a different page size from the source. (check-in: [7bd44794] user: drh branch: trunk, size: 22267)
2010-03-30
22:58
[e86634da] part of check-in [79e22b95] Continuing refinements to the filesize-in-header enhancement. (check-in: [79e22b95] user: drh branch: trunk, size: 21830)
2010-02-22
19:32
[b293534b] part of check-in [a8076aed] Log all error messages if logging is enabled. (check-in: [a8076aed] user: drh branch: trunk, size: 21839)
2009-11-10
01:30
[744e9835] part of check-in [f6c045f6] Remove the obsolete "$Id:$" RCS identifier strings from the source code. (check-in: [f6c045f6] user: drh branch: trunk, size: 21826)
2009-07-06
19:03
[6f1c2d98] part of check-in [471b92f2] Fix the backup logic so that it detects a failure to sqlite3BtreeUpdateMeta() and reports that failure back up to the top level. (CVS 6851) (check-in: [471b92f2] user: drh branch: trunk, size: 21883)
2009-07-02
07:47
[97a3859d] part of check-in [e3c055f1] Cause opening a transaction on a sharable b-tree module automatically obtain a read-lock on page 1. This means there is no way for sqlite3BtreeGetMeta() to fail. (CVS 6836) (check-in: [e3c055f1] user: danielk1977 branch: trunk, size: 21879)
2009-06-03
11:25
[ff50af53] part of check-in [6dbf4eca] Define a set of constants to use as the "index" argument to sqlite3BtreeGetMeta and UpdateMeta. This makes some parts of the code easier to follow. (CVS 6709) (check-in: [6dbf4eca] user: danielk1977 branch: trunk, size: 21884)
2009-06-02
21:31
[d189bc15] part of check-in [04bad9eb] Further reductions in the amount of stack space required. (CVS 6707) (check-in: [04bad9eb] user: drh branch: trunk, size: 21857)
2009-05-18
17:11
[8f985697] part of check-in [0d3abee2] Port the sqlite3_backup fix of check-in (6632), ticket #3858 onto the 3.6.14.1 branch. (CVS 6654) (check-in: [0d3abee2] user: drh branch: branch_3_6_14, size: 21591)
2009-05-14
19:26
[437efc2c] part of check-in [06bc8917] Change the sqlite3_backup_finish() interface so that calling it with a NULL pointer is a harmless no-op. One other change to backup.c to facilitate full coverage testing. (CVS 6638) (check-in: [06bc8917] user: drh branch: trunk, size: 21626)
2009-05-13
07:52
[91aaf9f0] part of check-in [90309008] When locking a database file, check if any backup objects need to be restarted even if the page cache is empty. Ticket #3858. (CVS 6632) (check-in: [90309008] user: danielk1977 branch: trunk, size: 21595)
2009-03-16
13:19
[0082d0e5] part of check-in [b649a6cc] Add the sqlite3_unlock_notify() API. (CVS 6348) (check-in: [b649a6cc] user: danielk1977 branch: trunk, size: 21496)
2009-02-16
17:55
[2d3f3114] part of check-in [68f15442] Changes to remove some compiler warnings from MSVC. (CVS 6294) (check-in: [68f15442] user: shane branch: trunk, size: 21494)
16:23
[dbce7056] part of check-in [82222fbf] Fix a compiler warning in backup.c. (CVS 6293) (check-in: [82222fbf] user: drh branch: trunk, size: 21487)
2009-02-12
17:01
[0fb3c8d9] part of check-in [2fc450e8] Fix some edge cases with backing up databases that are exactly PENDING_BYTE bytes in size, or just slightly larger. (CVS 6288) (check-in: [2fc450e8] user: danielk1977 branch: trunk, size: 21490)
2009-02-09
18:55
[7aff2b79] part of check-in [b34bde80] Fix a problem in backup.c causing OsTruncate() to be called with an argument larger than the current file-size. (CVS 6271) (check-in: [b34bde80] user: danielk1977 branch: trunk, size: 21238)
2009-02-06
05:59
[9563f473] part of check-in [9b8c8b18] Changes to the backup API: (1) if a negative number is passed as the second argument to backup_step(), this is interpreted as "copy all remaining pages" and (2) if backup_finish() is called after backup_step() fails with a BUSY or LOCKED error, then this error is also returned by backup_finish() (same handling as for other errors encountered by backup_step()). (CVS 6266) (check-in: [9b8c8b18] user: danielk1977 branch: trunk, size: 20682)
2009-02-04
17:40
[12cd9a55] part of check-in [f92405af] Simplify wording of backup API error message. Decapitalize some other error messages. (CVS 6256) (check-in: [f92405af] user: drh branch: trunk, size: 20311)
16:56
[2419ac3a] part of check-in [572378d3] The sqlite3_backup_init() interface must lock the destination in case it needs to change the error message. (CVS 6255) (check-in: [572378d3] user: drh branch: trunk, size: 20319)
01:49
[1cfa5ed1] part of check-in [6301f08a] Remove compiler warnings under MSVC. (CVS 6249) (check-in: [6301f08a] user: shane branch: trunk, size: 20243)
2009-02-03
22:51
[ddae8526] part of check-in [7f827ba9] Correction to check-ins (6246) and (6247): The backup object might not hold a valid destination connection pointer. Also, do not reset the page cache when establishing a read-lock while there is a persistent or truncated journal, only if there is a journal that really needs to rollback. Otherwise backups always reset whenever the source database file is read. (CVS 6248) (check-in: [7f827ba9] user: drh branch: trunk, size: 20221)
22:17
[0491573a] part of check-in [76f23a43] A backup must clear the internal schema of the destination database so that the schema will be reloaded for the next sqlite3_prepare() (CVS 6247) (check-in: [76f23a43] user: drh branch: trunk, size: 20083)
21:13
[cc6c8a1c] part of check-in [5f6c06b9] Must hold mutex on the destination during backups. Add documentation to warn programmers that attempting to use the destination connection during a backup can lead to deadlock. (CVS 6246) (check-in: [5f6c06b9] user: drh branch: trunk, size: 20034)
16:51
[a7605687] part of check-in [663479b4] Commit first version of the 'backup' feature. (CVS 6241) (check-in: [663479b4] user: danielk1977 branch: trunk, size: 19676) Added