aboutsummaryrefslogtreecommitdiff
path: root/src/wal.c
AgeCommit message (Collapse)AuthorLines
2026-10-23Fix a race condition with a writer that could cause a connection with a ↵dan-1/+5
read-only *-shm file to return a spurious SQLITE_READONLY_RECOVERY error. FossilOrigin-Name: e2e7c8eb02daea0876fb25abccd96c769f55fba3e995f0e7cf29aa992d7c61a6
2026-10-23Fix a race condition with a writer that could cause a connection with a ↵dan-15/+25
read-only *-shm file to return a spurious SQLITE_READONLY_CANTINIT error. FossilOrigin-Name: 30a301835b588f9d57fc04af3140612bef781bdc9b19aa83515d77a24ab06ee0
2026-10-23Ensure that all content that is copied into the -shm file during recoverydrh-0/+1
has been initialized, even in the case of no valid WAL frames. FossilOrigin-Name: f2255af8231d74ce3d949d3d597a25eda6baa3c9ddfd23fa0e8020c213404e6c
2026-09-03Improve the documentation of the WalIterator object and the new pagemapdrh-18/+42
algorithm. Remove one unnecessary conditional. FossilOrigin-Name: f690f5b1487083fde158a9dcd1f61c67821ed163726e07f1f42585e979b0462d
2026-09-03When checkpointing, use a mapping from pgno to frame instead of the sorted ↵dan-31/+83
list of frame/pgno pairs in cases where this will use less memory. FossilOrigin-Name: ec3d33931be807ba77296397775f2d88228d4200ed23e54962d2592ddff37979
2026-09-02When -DSQLITE_DEBUG or -DSQLITE_ENABLE_WALSTAT is used, provide thedrh-0/+58
sqlite_walstat() SQL function that provides state information about the WAL subsystem. Used for debugging only. Function subject to change or removal. FossilOrigin-Name: 789d84e69171ef05d36486c38fbb0db10f8d827d9941472a2809f3113503e6c4
2026-09-01Within a checkpoint, avoid allocating memory for *-shm pages that will not ↵dan-12/+18
be processed as they have already been completely checkpointed. FossilOrigin-Name: 53a9312cc923073066d697a0038e647d83a17ad0730dd91033e8fe7435fcc8df
2026-08-16When reading a frame from a WAL file where the WAL pagesize and the databasedrh-1/+5
pagesize disagree, be sure to fully initialize the page that is read. FossilOrigin-Name: f9b4ee369557c36c606666bd7e6d8dc4685d87531993d3ce4e7a718aa814a5ac
2026-06-12When using a read-only WAL/SHM, handle a corrupt page size in the WALdrh-1/+7
file correctly. [bugs:/info/2026-06-11T22:20:03Z|Bug 2026-06-11T22:20:03Z]. FossilOrigin-Name: 09ab0a1bac4eb7de651f78cfd3027b452308da7e04c4ccd7f46c402c82fd6ca5
2026-04-04Appease static analyzers by masking the index to thedrh-3/+6
WalHashLoc.aPgno array to make it easy to prove that there is never OOB read or write. FossilOrigin-Name: 9d56df17b4ab4940f7bc24488a9df118f6172fcfbf3e5cb95bdcbd2db2a07911
2026-03-03Minor tweaks to the previous, for testability.drh-2/+2
FossilOrigin-Name: decb69015457b4f70cf574aeef87d40f9de60b94965f4a915e8d0cd7559ef2ae
2026-03-03Avoid an obscure race condition between a checkpointer and a writer wrapping ↵dan-56/+71
around to the start of the wal file. FossilOrigin-Name: 053bd3930f827156fd67ea4546a36227cffbb6f8bada3b5d1a7cf5f1867ac624
2025-10-30Add (void) to two places for the sake of SQLITE_OMIT_WAL builds. Why these ↵stephan-2/+2
do not complain on tests in this tree, but do on a downstream tree (same machine, same compiler), is a mystery. FossilOrigin-Name: dd6edfc09434b0d170d5ab462053497043016a4ec6b91a46db565ccf646aee20
2025-10-27Fix a minor over-allocation of heap memory in wal.c.dan-1/+1
FossilOrigin-Name: 1803cb9bb6a13fb66956f729066b6eae64c3a1c0715102fb1a9994e395c12ba9
2025-09-04Add "PRAGMA wal_checkpoint = noop" and SQLITE_CHECKPOINT_NOOP. To request a ↵dan-25/+30
checkpoint that checkpoints zero frames. FossilOrigin-Name: 48be3d020cf0c732557b3d956198a1abcab79424be03f447e2bb89f4d68dc8ff
2025-06-17Avoid writing frames with no checksums into the wal file if a savepoint is ↵dan-0/+4
rolled back after dirty pages have already been spilled into the wal file. Possible fix for [forum:/forumpost/b490f726db | forum post b490f726db]. FossilOrigin-Name: 3a3269fe8e925a522d5df9f011220a842fb15a9f56e785884e32d2e15abda5bb
2025-06-03Fix harmless compiler warning introduced by the setlk-snapshot-fix merge.drh-1/+1
FossilOrigin-Name: c1f20f89d9eb3e1dd1018c0e0efe5d3043a592f078e235ad04b960334c7186c2
2025-05-30If blocking locks are enabled, avoid using the busy handler when blocked by ↵dan-1/+2
another process running recovery. FossilOrigin-Name: a35236757ab57c4c9b34e47c5dbc10d8f1220f8152955f5303cf9c3902ee169b
2025-03-24Clarify and reduce redundancy in an assert() in walChecksumBytes().drh-4/+2
FossilOrigin-Name: 3c53abf5e6df446d569040042363265737aa10fc8aaa20b31c587100c557c5e7
2025-03-14Make use of the flexible-array feature of C99, when available, to try todrh-3/+6
pacify -fsanitize=strict-bounds. This check-in fixes the core. There is more yet to do in FTS3, RTREE, and in FTS5. FossilOrigin-Name: 6fd6b32d06bd6a705e5140cd613af823b8183a6f6a9ceeeedfcf5e8b50821d68
2025-02-25Reinstate the assert() removed by [0f6223b8]. Avoid holding a wal-mode write ↵dan-0/+3
lock after the transaction has been rolled back if an IO error occurs while restarting the wal file. FossilOrigin-Name: 277e150d6ab75de2407f6761aa2359df80a4e1dbce30788df06621dee05b2ef1
2025-02-25Remove an assert() added by [e88212b1] that is sometimes false.dan-3/+0
FossilOrigin-Name: 0f6223b8f6c044db687f78e19f6373d0dda9155445c511a297efa05bac3b16e5
2025-02-24Merge latest changes from trunk into this branch.dan-1/+1
FossilOrigin-Name: 55324d1c862c42b95251a398c40930d9fa94debb1aec7d3d0ae734d6b17b4a59
2025-02-17Code changes that make it easier to prove that no 32-bit integer overflowsdrh-1/+1
happen during memory allocation. No problems fixed; this change is just to make future maintenance easier. FossilOrigin-Name: 215650a5a1d55bdbca9c92524804a1a54456a17f42a17e53747b21a6507506f5
2025-01-30Fix a problem causing the write-lock to be held when it should not be in ↵dan-2/+14
some circumstances following a SEH exception. FossilOrigin-Name: 7eb5accb7cf937fc967dcd86da0af813fb18a2697348bd231fbefd3c09b930ab
2025-01-27Add the sqlite3_setlk_timeout() API. For setting the timeout used by ↵dan-1/+1
SQLITE_ENABLE_SETLK_TIMEOUT blocking locks without also setting the regular retry-based busy-timeout. FossilOrigin-Name: 4a7eb492797abb47b18b7dfc557aeae43a0dea5b861efc203398d5059b10d131
2025-01-24Fix a race condition causing SQLite to use a busy-handler for an operation ↵dan-2/+5
that should not. FossilOrigin-Name: 6ab9ed8eef77781898375038ab05fc6e5f46b745e4906691393b8b1d90570eb6
2024-12-16Code formatting changes to make trunk more like wal2.drh-126/+128
FossilOrigin-Name: 8f725472b0fe62359a4cd3237b43d7b834e042d8ce425abde06e3ed6c62dbafa
2024-12-16Remove unnecessary end-of-line whitespace.drh-4/+4
FossilOrigin-Name: ae580443d210811c12209866112fc8b0b83281e24945504b748a17d93ad84062
2024-10-19An assortment of comment typo fixes discovered by aspell. Add several new ↵stephan-1/+1
words to tool/custom.txt. No code changes. FossilOrigin-Name: 59b76a99e4a28f4cc8c4f9f39ff6e039c4d29cb7b44183f1902b5792638656d2
2024-09-26When possible, avoid taking wal file read-lock 0 in sqlite3_snapshot_get().dan-2/+16
FossilOrigin-Name: 34b6ac3d76dbc6819778ec2a0f81cbcdcc0cd1a6303381d97f1c479e4ecdd132
2024-09-09Move the vfstrace extension out of src/ over into ext/misc/ where it belongs.drh-1/+1
Make it part of the standard build for the CLI. Bring some of the vfstrace output up-to-date. FossilOrigin-Name: 055b97de8d2397987d72dbab1cde78ece2d1c066e95042b4ed6b7b36b2cf9006
2024-01-09Put an SQLITE_ENABLE_SETLK_TIMEOUT branch inside the appropriate ifdef withdrh-0/+4
an assert on the else since the condition is always false if SETLK_TIMEOUT is not available. FossilOrigin-Name: d81e7a036ac5d70b6a6ee6ab7d81e041c1f5fc04b70bcee47e203d521caf7e93
2024-01-06Ensure that SQLITE_PROTOCOL is not returned too early when a ↵dan-11/+55
SQLITE_ENABLE_SETLK_TIMEOUT build fails to open a transaction on a wal mode database in cases where blocking locks are not being used. FossilOrigin-Name: b934a33671d8a0190082ad7e5e68c78fe0c558d102404eafc1de26e4e7d65b92
2024-01-02Adjust the sqlite3PagerDirectReadOk() routine (part of thedrh-0/+1
SQLITE_DIRECT_OVERFLOW_READ optimization) to use less code and to be more easily testable. FossilOrigin-Name: eed670ea2a9424f7df4eeb01c152fc38f7190a5e39aa891651b28dc91fcdc019
2023-11-28In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of ↵dan-19/+44
sleep() calls when opening a read-transaction. FossilOrigin-Name: 4c055b7a6e4533e1e571773456226ca7038ce372df3eedbbbcd9a81e8652a6cf
2023-11-28Handle an SQLITE_BUSY_TIMEOUT error if one occurs while attempting a shared ↵dan-1/+2
lock on a read-lock slot. FossilOrigin-Name: 5fbf3906d272df3eb981f67455eb35f649ad2774cba9fc3f077b28d9bef3f0cb
2023-11-27Have SQLITE_ENABLE_SETLK_TIMEOUT builds block when locking a read-lock slot.dan-1/+7
FossilOrigin-Name: f797baf47cf7859cfd8ce248f4f3087af4551a7040af990333426e5a7c269504
2023-11-27In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of ↵dan-18/+35
sleep() when opening a read-transaction. FossilOrigin-Name: a51ef39998e25e86bd0600e71d15011b12e05f4319608018293bdaecb09e8c97
2023-11-15Changes so that if SQLITE_ENABLE_SETLK_TIMEOUT is defined as 2 instead of 1, ↵dan-3/+2
all blocking locks are taken for a single millisecond and the default busy-handler invoked as normal. FossilOrigin-Name: 79e24ec3dd40373bbb93792829b18d9ef40daf19d4606174e36c8e19e61a7529
2023-11-08Avoid blocking as part of passive checkpoint operations, even if ↵dan-1/+6
SQLITE_ENABLE_SETLK_TIMEOUT is defined. FossilOrigin-Name: e5ecc404cae1ce8b639d0263fa07571c066f11bfc62f5ba331ad7ae138e78572
2023-08-17Fix a possible UAF in SEH if an exception occurs at an inopportune momentdrh-1/+24
during WAL processing. FossilOrigin-Name: 91b91037e348fa10cf6a9d8a0ffbfdebb4a40e0e336b65b112ed1c828e75cda7
2023-08-14Fix a problem in sqlite3_snapshot_recover() introduced by the ↵dan-1/+2
[8a6b0c24937e855b] merge. FossilOrigin-Name: c2577eb0a4a627c65d675f1446514843486092be9cb271b682793a0107e496cd
2023-07-26Add a comment describing the contents of the ExceptionInformation[] array ↵dan-0/+5
for win32 EXCEPTION_IN_PAGE_ERROR exceptions. No changes to code. FossilOrigin-Name: 8e20354242d5f34a90b6c00d9034535ef6f6086ee4971230c7fd69985e2777d2
2023-07-24Update the latest trunk enhancements into the wal-shm-exceptions branch.drh-2/+0
FossilOrigin-Name: 3187ee3f69fc28a259ba0e951ac10a65c07ef2c3866acbefaf9544333a930cc6
2023-07-11Reduce divergence between branches: trunk and wal-shm-exceptions.drh-14/+4
FossilOrigin-Name: d38ed6b1fc6b572997d520c36f256c11404fb1bd5f28acab07466bfc96554a8f
2023-07-11Get fault injection for testing working correctly. Other code clean-up.drh-6/+17
FossilOrigin-Name: ff492277ed00c1f637a5b4ccd6d8193ea22f6781f90073861588a2b7d5c045b7
2023-07-10Fix a warning. Unclear yet if the code is correct this way or not.drh-1/+1
FossilOrigin-Name: 2df4fd76ef48bb63389df8d783059af6b8f2cbb2c11d07953b408e71f50b625b
2023-07-10Merge the latest trunk enhancements into the wal-shm-exceptions branch.drh-1/+1
FossilOrigin-Name: f655d08d019bab0c578886e91ca24fd956d1b3dea9b9c9104812b3cf62e5e556
2023-07-06Merge all recent trunk enhancements into the wal-shm-exceptions branch.drh-189/+220
FossilOrigin-Name: e59cea2d851be68559e7d01a01cb05684c44d151d022ea9790ce99671016ab00