1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

578 Commits

Author SHA1 Message Date
drh
b7c2f86b85 All WAL frame overwrites even if there are active savepoints. This is safe
because a ROLLBACK TO will cause all reverted pages to be rewritten to the
WAL file prior to COMMIT.

FossilOrigin-Name: 99b31a6b491c1c51227f478d3713b020d37a17cf
2016-01-09 23:55:47 +00:00
dan
c9a9022b21 If it is known that checksums will be recalculated on transaction commit, skip calculating checksums when appending frames to the wal file. When recalculating checksums, recalculate them starting with the first overwritten frame - not the first frame in the transaction.
FossilOrigin-Name: 16b34f2537bbc7846d8e6dc2b35daae5af241c1b
2016-01-09 18:57:35 +00:00
dan
d6f7c97952 If a single page is written to the wal file more than once, have each subsequent copy overwrite the original frame.
FossilOrigin-Name: 5d113aef2c7d746e8eda88d4e36c04a39b0a11be
2016-01-09 16:39:29 +00:00
drh
21d61853e7 Add the experimental SQLITE_FCNTL_JOURNAL_POINTER file control for obtaining
the sqlite3_file pointer associated with a rollback journal or WAL file.

FossilOrigin-Name: a02ace9a746ff02fc1a5969bf13939b568624f93
2016-01-08 02:27:01 +00:00
drh
8c9ea487d0 Merge recent enhancements from trunk.
FossilOrigin-Name: cb22efaf50d83d9a73fdf8d986e6ea2fc6500cfb
2015-12-16 19:55:57 +00:00
dan
0f308f5d47 Add a new assert() statement to the snapshot-specific part of sqlite3WalBeginReadTrans().
FossilOrigin-Name: d8a12023be32bdc6df18b0a5f38b917799854342
2015-12-11 14:59:49 +00:00
drh
c49e960d41 Fix a variable type mismatch problem in the snapshot logic.
FossilOrigin-Name: 93fb8010e4999b6b832d63a7c5a152f65d4415a3
2015-12-11 03:16:54 +00:00
drh
71b62fa456 Fix a bad assert related to snapshots.
FossilOrigin-Name: 767ee30efa5dd469e3a51d4e44cbe473061819b9
2015-12-11 01:22:22 +00:00
drh
e230a8994e Snapshot documentation updates. Comment changes only - no changes to code.
FossilOrigin-Name: ef51a398a04963508389ffe2f9d8359c1ec48261
2015-12-10 22:48:22 +00:00
dan
a7aeb39836 Return SQLITE_BUSY (not SQLITE_BUSY_SNAPSHOT) if sqlite3_snapshot_open() fails to obtain the shared checkpointer lock.
FossilOrigin-Name: 5343060bcc6c99029f731f8020d2cba3f405f207
2015-12-10 19:11:34 +00:00
dan
3bf83ccd70 Have sqlite3_snapshot_open() avoid a race condition by taking a shared CHECKPOINTER lock while checking pInfo->nBackfillAttempted.
FossilOrigin-Name: 8084eae0bc4f6513b1147fb890a6b2813f1c0a09
2015-12-10 15:45:15 +00:00
mistachkin
c9fb38e7ad Fix spacing typo in comment. No changes to code.
FossilOrigin-Name: 3a18526fc2253658dad84c5e600481c8a62efe40
2015-12-10 03:16:47 +00:00
drh
998147ec38 Add the nBackfillAttempted field in formerly unused space in WalCkptInfo and
use that field to close the race condition on opening a snapshot.

FossilOrigin-Name: cb68e9d0738fc7db7316947b4d2aab91aae819f2
2015-12-10 02:15:03 +00:00
dan
65127cd57d Update sqlite3_snapshot_open() to reduce the chances of reading a corrupt snapshot created by a checkpointer process exiting unexpectedly.
FossilOrigin-Name: 7315f7cbf4179aadda0f1a0baa1526a9b9f9729f
2015-12-09 20:05:27 +00:00
dan
818b11aebb Add tests for snapshot_get(), _open() and _free().
FossilOrigin-Name: 502cc6f353358946080d9bcd335aed526825b88a
2015-12-07 14:33:07 +00:00
dan
fc1acf33b8 Add untested implementations of experimental APIs sqlite3_snapshot_get(), _open() and _free().
FossilOrigin-Name: 0715eb00aa8891400cd50a15509d3d7b13789626
2015-12-05 20:51:54 +00:00
drh
1d9497a0d0 Merge recent enhancements from trunk.
FossilOrigin-Name: 9130661a786e4c158f15103be57467a5cc03875a
2015-12-02 20:53:14 +00:00
drh
ab37277367 Remove more (dead) SQLITE_FCNTL_WAL_BLOCK logic from wal.c - code that was
missed during the [e1d5320ca08933] check-in.

FossilOrigin-Name: 58c15c6af964563ac7ece8606d16730ccf9ee72b
2015-12-02 16:10:16 +00:00
drh
411547ec6c Merge enhancements from trunk.
FossilOrigin-Name: fc4d1de8aeb39a4c0ea9275a0bd2447535f1a955
2015-09-15 19:16:47 +00:00
dan
5c472d0860 Fix an assert() enabled by SQLITE_ENABLE_EXPENSIVE_ASSERT in wal.c.
FossilOrigin-Name: 8d2ed150a7a15626965cf994ef48c3ab61eca6ec
2015-09-09 19:44:33 +00:00
drh
01be463eeb Changes from ENABLE_CONCURRENT (default off) to OMIT_CONCURRENT (default on).
This is not a clear-cut decision and might be changed back.

FossilOrigin-Name: f8ae9bfd05abc35293ad6bc62ab1bdbe357d964e
2015-09-03 15:17:12 +00:00
drh
f56af5ee2d Merge the latest trunk enhancements.
FossilOrigin-Name: 3dea047465fa8e3031046a33016b6ed760336ddc
2015-09-01 18:01:16 +00:00
drh
3f531da564 Fixes so that it builds without warnings both with and without
SQLITE_ENABLE_CONCURRENT.

FossilOrigin-Name: 5ed2a445a164f0f0c2669c6681ea76618e639961
2015-09-01 17:48:54 +00:00
dan
de36c76a23 Fix a problem allowing some conflicting transactions to be committed.
FossilOrigin-Name: a0566382d564ca17fd13475a44fed8f714742d97
2015-08-26 18:02:20 +00:00
dan
bf3cf57e15 Change "BEGIN UNLOCKED" to "BEGIN CONCURRENT".
FossilOrigin-Name: ba1ab858e2997c88dd7eee6e6893a8616d85c665
2015-08-24 19:56:04 +00:00
dan
f5e89dba9d Fix handling of attempts to modify the database schema, application_id or user_version within an UNLOCKED transaction.
FossilOrigin-Name: 5b9f272113d21fd606903509d6f830fe60fac039
2015-08-24 19:08:10 +00:00
dan
0408529b48 Fix compilation without SQLITE_ENABLE_UNLOCKED. Also other code organization issues.
FossilOrigin-Name: 041135575417201bbcf0544cc69dcb7369c7fb34
2015-08-24 16:00:08 +00:00
dan
654a965367 Fix another problem involving unlocked transactions and wal-file restarts.
FossilOrigin-Name: 4460764ea8fc948fe02f0a09476857839b3aa1ae
2015-08-24 06:43:25 +00:00
dan
0c52b373a0 Fix a problem to do with detecting unlocked transaction conflicts if another client restarts the wal while the transaction is running.
FossilOrigin-Name: e3968b256282d8c0a87c26667b1ba02faf7a5a17
2015-08-22 20:32:39 +00:00
dan
b87b25f219 Fix many minor issues in the unlocked transaction code.
FossilOrigin-Name: 53aaeea6c98f82f3b55d4b3ab139ee41b727243c
2015-08-21 20:11:23 +00:00
dan
64b310ed1a Add extra tests and a fix for rollbacks of UNLOCKED transactions.
FossilOrigin-Name: 82cd837e72ed4cf5821be717369694be29a2997e
2015-08-21 14:21:22 +00:00
dan
7b3d71e9cc When committing an unlocked transaction, relocate newly allocated database pages within the file to avoid conflicting with committed transactions. There are lots of things still to fix in this code.
FossilOrigin-Name: 3bbc31d515ba9fc920c5cbc7059d3eb1ba9c7f8e
2015-08-19 20:27:05 +00:00
dan
b8c7cfb834 When searching the wal file for a frame, do not search that part that was already checkpointed when the snapshot being read was at the head of the wal file.
FossilOrigin-Name: 90760e72327eb0593cbfa6d7058b554198cd8044
2015-08-13 20:23:46 +00:00
dan
6df003c7a5 Avoid reading frames that have already been checkpointed from the wal file.
FossilOrigin-Name: 5669ac4a40429abc3f44540fc9d2f3b79b404bdf
2015-08-12 19:42:08 +00:00
dan
773d2d6c09 Only allow UNLOCKED transactions to commit if none of the pages read by the transaction have been modified since it was opened.
FossilOrigin-Name: 0b9718426e44df092850c5d095ce1b84a1e567cf
2015-07-29 12:14:28 +00:00
dan
37d36205f3 Add some test cases and fix some small problems with BEGIN UNLOCKED transactions.
FossilOrigin-Name: 6da0e962ad2aa5e52c1f1b5c3dbf77a2cb16ac2d
2015-07-28 16:46:49 +00:00
dan
3d39434c36 Add an experimental "BEGIN UNLOCKED" command.
FossilOrigin-Name: 8079421604dbd40d03471dad6d12115119b554c2
2015-07-27 19:31:45 +00:00
mistachkin
6b67a8ae03 Fix harmless compiler warning in MSVC 2015.
FossilOrigin-Name: 01c8b9ccfa0f336dfead7c004de3de571753f707
2015-07-21 19:22:35 +00:00
drh
f6bff3f5d6 Avoid a harmless compiler warning.
FossilOrigin-Name: 2288842b8f191ff05a157db7f77af867bfa83c4f
2015-07-17 01:16:10 +00:00
drh
f4fa0b8073 Fix some harmless compiler warnings.
FossilOrigin-Name: 110cd84f5e842c4dcd9b9398cea211e25f36b3aa
2015-07-15 18:35:54 +00:00
drh
f3cdcdccbe Use sqlite3_malloc64() in place of sqlite3_malloc() internally.
FossilOrigin-Name: 48f553b05c05373c0af4b9c3a542979db3a2ee19
2015-04-29 16:50:28 +00:00
dan
1fe0af200d Add a comment to wal.c to explain why a race condition is safe.
FossilOrigin-Name: bc33af866403c23d548dd4705675315810d52d7f
2015-04-13 17:43:43 +00:00
drh
bbf76eec34 Arrange for some of the transient locks in WAL mode to block, as a single
to the OS to fix priority inversions.

FossilOrigin-Name: c6e6d5f4e06c3ac0bfb620c0c728fbc7230c4a02
2015-03-10 20:22:35 +00:00
dan
976b003344 Ensure that "PRAGMA wal_checkpoint = TRUNCATE|FULL|RESTART" block on other connections and truncate the database file as required even if the entire wal file has already been checkpointed.
FossilOrigin-Name: 53429689d4fcf472edbc89cc50b5e69ba3270634
2015-01-29 19:12:12 +00:00
drh
622a53d54a Reinstate an assert() by adding an "|| CORRUPT_DB" term.
FossilOrigin-Name: 95ce20348d9b868a0407adccdb222a0e4c762945
2014-12-29 11:50:39 +00:00
drh
a25165fa68 Add an implementation mark and fix a comment describing the OP_Checkpoint
opcode.

FossilOrigin-Name: 7475b90c558157802b036162376fceacc1b9ab4a
2014-12-04 04:50:59 +00:00
drh
dd90d7ee81 Add evidence marks and assert()s used as evidence for checkpoint requirements.
FossilOrigin-Name: b2da8afc7657266fbe8e683c6e50fe18216cbcf3
2014-12-03 19:25:41 +00:00
dan
0fe8c1b967 When attempting to restart a wal file, make any required calls to sqlite3_randomness() before waiting on or checking for wal file readers. This restores the behaviour exhibited by the trunk.
FossilOrigin-Name: 6ee08769f0ffbb3d620c66b89180ece7782dc820
2014-12-02 19:35:09 +00:00
dan
f26a1549ac Add the SQLITE_CHECKPOINT_TRUNCATE option.
FossilOrigin-Name: 8e20a43419e46b6b9d1f60ec7ea420bbfb3ef358
2014-12-02 19:04:54 +00:00
drh
664f85dd59 Add an ALWAYS on an always-true branch in wal.c.
Fix the ANALYZE command so that it resets the "unordered" and "noskipscan"
flags on indices when reloading the sqlite_stat1 table.

FossilOrigin-Name: 9ed97a85feee6593faefa2b54cc4cf9a60f515f9
2014-11-19 14:05:41 +00:00