1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-04-21 19:26:38 +03:00

1192 Commits

Author SHA1 Message Date
dan
bc7c039ce2 Clear the Pager.dbModified flag when unlocking the database. Assert that it is clear when locking the database.
FossilOrigin-Name: d17ec16b7c5051c904c09580a856593b2fb85edc
2009-12-02 14:44:32 +00:00
drh
1ac399e8eb Rearrange the order of two branches in order to restore 100% branch coverage
after recent changes to in-memory database processing.

FossilOrigin-Name: 6ce6ff4402241d5c76acd0c60c85097dfcd7fd7c
2009-11-23 15:59:27 +00:00
drh
bfcb4adaf8 Fix a bug in transaction rollback during backup when the CODEC is enabled
that can result in a corrupt backup file.  This is only a problem when
SQLITE_HAS_CODEC is defined.

FossilOrigin-Name: f3398fc4db765e2c63d425d570c4469a84b3328c
2009-11-21 01:33:50 +00:00
drh
8c30f72deb When moving pages as part of autovacuum on an in-memory database, make sure
that the source location is journalled so that a ROLLBACK can occur.
Part of the fix for ticket [564d412f15a00]

FossilOrigin-Name: 2f42f91fe65b0b21671936013df08037091f0cc6
2009-11-20 18:48:35 +00:00
drh
98829a65cd Avoid unnecessary page cache allocations when move a page while autovacuuming
an in-memory database, since the allocation might fail making it impossible to
rollback the transaction.

FossilOrigin-Name: 9a429349ccc2fa9acd28365a86578f602e87dafb
2009-11-20 13:18:14 +00:00
drh
ae2a348dbd If the sector size is unspecified (initially 0) then set it to 512, not to 32.
FossilOrigin-Name: 8861b5c16031ad570ffbe17b3ec8163b136a7f63
2009-11-11 23:58:06 +00:00
drh
3c99d68b5c Allow media sector sizes as small as 32. The former minimum size was 512.
FossilOrigin-Name: 5a32bfc17ed022c85d2615c34b41a3dcae2594bd
2009-11-11 13:17:08 +00:00
drh
c81c11f62c Remove the obsolete "$Id:$" RCS identifier strings from the source code.
FossilOrigin-Name: f6c045f649036958078cb15cd9d5453680c82b0c
2009-11-10 01:30:52 +00:00
drh
1461d7ace0 Omit some code that is not used when SQLITE_SECURE_DELETE is defined.
FossilOrigin-Name: 5a9e746357aa8edeef6b89f01e19cd57555bef32
2009-11-10 01:12:50 +00:00
drh
3313b14f46 Fix the backup API so that a backup from an empty database to a non-empty
database works.  Ticket [0bf974bdf9].  The only changes are in assert()
statements.

FossilOrigin-Name: ddb71cd9ed395804a13dc136bb7688a7627c798f
2009-11-06 04:13:18 +00:00
drh
481aa74e21 Recover an ophaned branch that resulted from some ill-advised "shunning".
This check-in should be identical to [bd443f39a9] except that it should
be on the trunk.

FossilOrigin-Name: 38eaf1ab6e05161e6dc7cd69e942aeca16548c45
2009-11-05 18:46:02 +00:00
drh
e7ae4e2c98 Comment changes in support of better documentation. No changes to code.
FossilOrigin-Name: 79ab4714e408d01103b277c234b10db50a50352a
2009-11-02 15:51:52 +00:00
drh
5ec5319165 More thorough initialization of a buffer when writing the rollback journal
header, in order to prevent a harmless valgrind warning.
CVSTrac ticket #4039

FossilOrigin-Name: 5e2f5496834bffb79236f803cdfedb18fbd533b7
2009-08-31 16:09:58 +00:00
drh
1a5c00f8ce Reduce the maximum supported sector size to 64KiB. (CVS 6970)
FossilOrigin-Name: 8e1e0ba292150f8968e5295e8ba9cd7360b6a64b
2009-08-10 17:48:57 +00:00
danielk1977
ded6d0f1a9 If there is a hot-journal in the file-system, a connection with journal_mode=memory set may have to open it to effect rollback. Account for this in pager_end_transaction(). This prevents an assert from failing in the in-memory journal permutation test. (CVS 6947)
FossilOrigin-Name: 224bc69a04f4fe6d1004125847761b7842c2bfe0
2009-07-27 14:15:44 +00:00
drh
a53c704fec The noReadlock property on a pager object implies the readOnly property.
Use this fact to simplify the logic in sqlite3PagerSharedLock(). (CVS 6944)

FossilOrigin-Name: 886e665f6cf780464b280c286b03c9fb5c1a6b2a
2009-07-25 22:13:34 +00:00
drh
f31506b7b7 Remove obsolete assert and testcase macros related to ticket #2565 (CVS 6943)
FossilOrigin-Name: f0024b3189245d608a0cb57fa7e472c6daa1406f
2009-07-25 19:31:31 +00:00
danielk1977
c7ca875ec9 Change an unreachable condition in PagerSharedLock to a NEVER(...). Add an assert to pager_error() to show that it is never called to put an in-memory pager to the error-state. (CVS 6941)
FossilOrigin-Name: 1d931f77519baf3586708c77cbd161c0e75bcbaf
2009-07-25 17:39:13 +00:00
drh
b75d570ef8 More simplifications to pager.c. (CVS 6939)
FossilOrigin-Name: 533d6cc67a3b6467db5b83c5ca535d229d36ad27
2009-07-25 17:08:35 +00:00
drh
5e1fa03dca Simplifications and comment improvements to pager.c in support of coverage
testing. (CVS 6938)

FossilOrigin-Name: 5b70b5c19cd587a8afbf2909ac7a4c04aea20f44
2009-07-25 15:24:13 +00:00
drh
0b0abe45ca Add a NEVER() on an always-false conditional in pager.c.
Make sure the text of the master journal file is zero-terminated before
trying to process it - to prevent a buffer overrun in strlen(). (CVS 6937)

FossilOrigin-Name: cc9430e334fe98e1c35d408f81a2d8953377cda6
2009-07-25 14:18:57 +00:00
danielk1977
9f0b6be85c Add a complex assert() that checks a pager invariant. (CVS 6934)
FossilOrigin-Name: 2e08ad7bf629485a79ccebcf4c413e9dcc0d3ccf
2009-07-25 11:40:07 +00:00
drh
8a938f9808 Add assert() statements to more tightly constrain the state of pager.c.
Remove the three pager*.test scripts since they violate the constraints
asserted above by modifying the state of the system in ways that it cannot
be modified in a live system. (CVS 6933)

FossilOrigin-Name: 3b6d370ed68eaf9636b26c7240a8b3a43d2edd70
2009-07-25 04:12:02 +00:00
drh
d4e5cd05a4 Remove two more overzealous assert() statements. (CVS 6932)
FossilOrigin-Name: 788aa9dde9e76f67f22c07a904faf03e97e032c6
2009-07-25 00:13:58 +00:00
drh
16ff1700a9 Remove an overzealous assert() from pager.c. (CVS 6931)
FossilOrigin-Name: 4a924b475aa0f7f2f69caed0adc2e60d29c47f21
2009-07-25 00:10:45 +00:00
drh
d05c223c2e Fix an issue with the previous check-in, (6929). (CVS 6930)
FossilOrigin-Name: e5165c80abfdba0ad74e1042e4c94fe00d4b3308
2009-07-24 21:23:15 +00:00
drh
4775ecd06a Further simplifications to pager.c in support of structural coverage testing. (CVS 6929)
FossilOrigin-Name: 866216c0b6ba23b66483046fb402ddbe4f9a7b14
2009-07-24 19:01:19 +00:00
drh
ad7516c45f Simplifications to pager.c in support of structural coverage testing. (CVS 6927)
FossilOrigin-Name: 7222ad2667b95d6021d9ae47f548b76b224f46aa
2009-07-24 16:32:00 +00:00
drh
b480dc2393 Simplifications and comment improvements in pager.c. (CVS 6926)
FossilOrigin-Name: 2d2f42ca0a24ed8b33f9ad560c76a6c1301c757b
2009-07-24 12:35:57 +00:00
danielk1977
e878a2f41b Avoid leaving a suspect page in the page-cache if an error occurs during sqlite3PagerAcquire(). (CVS 6922)
FossilOrigin-Name: 2594f01c73301f9432be9d007a079a19a3d383f9
2009-07-22 16:41:15 +00:00
drh
fe6212d549 Add a NEVER() macro around a pager.c conditional that must always be false
in the current implementation. (CVS 6920)

FossilOrigin-Name: 1e510d7fc5cc47fe2714dbb1ed3ea7e90acbff7b
2009-07-22 13:19:20 +00:00
drh
6e2ef43197 Remove an ALWAYS() from a condition that can in fact be false under very
obscure circumstances. (CVS 6918)

FossilOrigin-Name: 38083228956ac05df45f44447ab39c64852239d2
2009-07-22 02:02:39 +00:00
danielk1977
89bc4bc645 Change getAndInitPage() (btree.c) to use only PagerAcquire(), not PagerLookup() and PagerAcquire(). (CVS 6916)
FossilOrigin-Name: 0b41dfc066b60ccabbf1a9ab4db41ebcb73a2799
2009-07-21 19:25:24 +00:00
drh
6aac11dc66 Code tweaks in support of full-coverage testing. (CVS 6907)
FossilOrigin-Name: 22c6dbfdce965e32f3df9aec28e46e714620c362
2009-07-18 20:01:37 +00:00
drh
3c18eb6048 Remove the SQLITE_CommitBusy flag. This was an attempt to block recursion
on the sqlite3_commit_hook() interface.  But such recursion is explicitly
disallowed, so the flag is pointless. (CVS 6889)

FossilOrigin-Name: 1c2bfc43a4fd5b779a3b5b5b8ca5b41cb7250b5a
2009-07-13 15:52:38 +00:00
danielk1977
a299d61249 In sqlite3PagerWrite(), do not set the PGHDR_NEED_SYNC flag on a page if an IO error occured while attempting to journal it. (CVS 6887)
FossilOrigin-Name: b9be365d85fddedbfa93eebf3ee62a140cbaa426
2009-07-13 11:22:10 +00:00
drh
6a8b8d3cc8 When an OOM fault occurs while moving a page for autovacuum in an in-memory
database, be sure to undo the page move prior to returning the error, to
avoid corrupting the in-memory database file. (CVS 6883)

FossilOrigin-Name: d0964b93669123e228e7ce1890167447c56753b5
2009-07-12 02:31:36 +00:00
danielk1977
75a4012765 If an error occurs in PagerBegin(), call pager_end_transaction() to reset the internal state of the pager object. (CVS 6855)
FossilOrigin-Name: ea7ed16628da29cf4a127a25cbac8ae553e2ac1f
2009-07-07 13:56:24 +00:00
drh
d5bc725f0b Fix the pager so that it remembers the name of the journal for an in-memory
database as an empty string.  This is important when committing a multi-database
transaction that includes one or more attached memory databases. (CVS 6852)

FossilOrigin-Name: 31a5e8192e164f01c5d7c2744b67cfb517251fad
2009-07-06 21:54:40 +00:00
drh
7b746030bc Fix the new pager.c changes so that they compile with IOTRACE defined.
Fix an out-of-order variable definition in vdbeaux.c. (CVS 6820)

FossilOrigin-Name: ac1450285025e33fad81e2fb14a06eb85e8ed87a
2009-06-26 12:15:22 +00:00
danielk1977
6f4c73eedb Avoid writing the 8-byte journal-header magic until the journal-header is synced. In persistent journal-mode, this prevents any old content that follows an unsynced journal-header from being interpreted as part of the rollback journal. (CVS 6817)
FossilOrigin-Name: a5ecffcf025da2fcb241e83c7bebc1095a3b51d6
2009-06-26 07:12:06 +00:00
danielk1977
3582c8f7ae If an OOM error occurs just after obtaining a shared lock on the database file, release the lock before returning. (CVS 6795)
FossilOrigin-Name: 971a9650f66f079630489c34e40003eee97d1683
2009-06-22 05:43:24 +00:00
danielk1977
3a1bf71f95 When recovering from the error-state in pagerSharedLock(), do not search for a hot-journal in the file-system if the pager is configured to use an anonymous temp file as the journal. (CVS 6793)
FossilOrigin-Name: 4b46805cbc9fe71f1febe9ea5f0f5634b65128e3
2009-06-20 18:52:49 +00:00
danielk1977
641a0bd205 If after obtaining an exclusive lock to rollback a hot-journal file it is found that the journal file has been deleted, do not return an SQLITE_BUSY error. Just downgrade the lock and continue with the current operation. This eliminates a spurious SQLITE_BUSY error caused by a race condition. (CVS 6792)
FossilOrigin-Name: 9a0666003764774b0bf861687002f8db9fd314b1
2009-06-20 11:54:39 +00:00
danielk1977
d6bee2174c If a call is made to sqlite3PagerAcquire when there are no outstanding references to any pages and the pager is in the error-state, try to exit the error-state at this point. Previously this was only attempted if the pager was configured to use exclusive mode. (CVS 6788)
FossilOrigin-Name: 62db08bc0de936e4a418ae583a3bdbbf33d7787e
2009-06-19 17:50:01 +00:00
drh
0472b5ad3f Fix a possible segfault when backing up an encrypted database. (CVS 6785)
FossilOrigin-Name: 7d8f178c8145b90da31f6557f7cd99d154eb676e
2009-06-19 02:25:48 +00:00
drh
37b89a0186 Make sure the sqlite3VdbeGetOp() subroutine works even when SQLite is
compiled with SQLITE_OMIT_TRACE. (CVS 6784)

FossilOrigin-Name: 1c8ec2a6e4efbb3fdc58f999b7b725fa5dc4d0e9
2009-06-19 00:33:31 +00:00
drh
0719ee29b6 Changes to the backup functionality so that it works better with codecs. (CVS 6783)
FossilOrigin-Name: 87d6796d986e4d5238252e704d936ab4407a0265
2009-06-18 20:52:47 +00:00
drh
fa9601a9a6 Move codec management from database connections into the pager so that it
will work together with shared cache. (CVS 6782)

FossilOrigin-Name: ed08b53cd64c4ff2c94ef4e48441c5236041c9ca
2009-06-18 17:22:39 +00:00
drh
aed2460877 Honor the SQLITE_OPEN_READONLY flag even on a :memory: or temporary database,
even though such a database is pointless.  Ticket #3908. (CVS 6748)

FossilOrigin-Name: 73ba841ac1ed39fb09b3917bafe0ce349e88eb04
2009-06-11 17:32:45 +00:00