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

578 Commits

Author SHA1 Message Date
dan
00a7db72ce Merge in fix for wal2 recovery.
FossilOrigin-Name: 41d4f14bc657f361976c51e1e0d38d2dd2440127fd230f80a1eb8f2a03bc9325
2022-06-27 21:43:33 +00:00
dan
86b7bb29da Fix a problem causing false corruption reports following recovery of a *-wal file that contains one or more transactions and a *-wal2 file that contains a valid header but no valid transactions.
FossilOrigin-Name: f6eafb65a43c650b065abe4a59e329c977cab1856c72dc9162046576d7bbfc8a
2022-06-27 21:42:45 +00:00
dan
6471011339 Add multi-threaded test for the features on this branch. Fix a misuse of xShmLock().
FossilOrigin-Name: 1ec05168c9fe9c09586da795e9db841647c30825f32a2f2c811186fac57760e1
2022-03-07 18:42:02 +00:00
drh
6ee0c5e255 Merge the latest trunk changes into begin-concurrent-pnu-wal2
FossilOrigin-Name: 3d949775e3029c6bf7cb06946ce52e2dfab451a3f7e685d654807cb5ac750b02
2022-01-25 16:05:35 +00:00
drh
8f1396ae8b Merge the latest trunk changes into the wal2 branch.
FossilOrigin-Name: 84f737abd1c05d66627b601dbd9be42c83d9c8e7a6c7fb4945dd85e7765569d9
2022-01-25 15:57:50 +00:00
drh
f208abdd99 A better and more robust fix for the problem of reading a read-only WAL
mode database with existing -wal and -shm files, replacing [f426874e005e3c23].

FossilOrigin-Name: 71bfd0b57ab197405606b8096b8521d784ff174c4eecf1d9804d38342c03cc80
2022-01-20 14:40:34 +00:00
drh
d6b44ec32a Fix the ability to read read-only WAL-mode database when -shm is present,
([00ec95fcd02bb415|check-in 00ec95fcd02bb415]) so that it works
for the case of 64K page size.

FossilOrigin-Name: f426874e005e3c23e8a00083b7c201408e072bca413e52bfc436da6483afb0cd
2022-01-20 02:04:53 +00:00
dan
910bbc4892 Merge checkpoint-on-close fix from wal2 branch.
FossilOrigin-Name: a92eca6c9ca45208df5764e50dec2b257244176f5893b4bee7f9475c4e8d8c8b
2021-12-15 13:42:40 +00:00
dan
348093c719 Fix a problem causing one wal file to be deleted without being checkpointed on close in cases where the last connection to close the db does so with an out of date wal-index header in memory.
FossilOrigin-Name: b0a70a2356c44d65c54c6d9bdf05972071462e72c28d6c6e593147ffa3d27ef2
2021-12-15 12:51:02 +00:00
drh
dbe42de14f Merge version 3.37.0 into the begin-concurrent-pnu-wal2 branch.
FossilOrigin-Name: 2171996a02ad2ec571570749ccee421bc0859a690c8393c5edda6cf164d2c8db
2021-11-27 15:11:55 +00:00
drh
b90edad19d Merge version 3.37.0 into the wal2 branch.
FossilOrigin-Name: 3425af625bac6c89950a50c2a22c4b7f66b0080811fe16ec8879158420641d5c
2021-11-27 15:00:54 +00:00
drh
e574a9233c Fixes to internal comments. No changes to code or documentation.
FossilOrigin-Name: 1489b196ce82cddf7360aff6c89219ca25e666187f0f5ff6419ba3b504cdef8d
2021-11-26 15:08:55 +00:00
drh
3f15be6b72 Merge all recent trunk enhancements into the begin-concurrent-pnu-wal2 branch.
FossilOrigin-Name: 07bc13395de3e45fec2cd571f1c9d0776e198768a4a0dd00479347ca8058a003
2021-11-09 15:18:21 +00:00
dan
f54bc90ca3 Merge change [6979efbf07d93e7a] from trunk to this branch.
FossilOrigin-Name: 2bb2448d6042b8c1597aab53b2c1c1aa0cdf9b36f15ef5c44730558f213297da
2021-11-06 16:36:30 +00:00
drh
eaad533e54 Ensure that all possible outcomes for walIndexPage() are accounted for by
callers.

FossilOrigin-Name: 12715c6b234a04627ca27e94bfa8bd456998360a9f0117480e0038f4747818d6
2021-10-27 23:55:30 +00:00
drh
71c3ea7523 Avoid the 1-based indexing on the WalHashLoc.aPgno[] array. Make it 0-indexed
instead.

FossilOrigin-Name: 28f5f709b4b28ba7f6f56bdd4a9e8c04d0d2df90d13d6df1a589fa4a65163f4d
2021-10-27 20:23:59 +00:00
drh
5f25627a1c Improve the comment on walIndexPage() to more accurately describe the
post-conditions.

FossilOrigin-Name: b619e936455f4001b543a9a58dea2ac9ebd598327d6be01130ca6e7e9764ffe6
2021-10-27 19:57:59 +00:00
dan
9023444fea If an EXCEPTION_IN_PAGE_ERROR exception is caught, make the underlying OS error code available via sqlite3_system_errno().
FossilOrigin-Name: fdb20e9ee48465b94aa6ac3c5e263ecaa7c3b10f4a193e79f965b7c35944b08b
2021-09-10 21:28:56 +00:00
dan
ee7c667a36 Change the structuree exception handler in wal.c to catch EXCEPTION_IN_PAGE_ERROR instead of EXCEPTION_ACCESS_VIOLATION.
FossilOrigin-Name: 0c6ab539cfbc908550fa993a587e85d644b6335853ff9781caae860c461c045d
2021-08-26 21:12:07 +00:00
drh
67ae593ffe Use VVA_ONLY() instead of TESTONLY() in SEH macros so that the build
works for coverage testing.

FossilOrigin-Name: 9e9d5b566da72adf780685ea27da7d76a7274e904a533438255af92875c94503
2021-08-20 18:18:12 +00:00
dan
5b6c3c8f7d Add missing SEH_INJECT_FAULT macros.
FossilOrigin-Name: 27e9bdb3a90a5826f45d32e0378e9afa90a16ac762a75236f38218f41bc45ded
2021-08-20 17:23:19 +00:00
dan
c6effdbfba Add some assert() statements and fix small issues with code on this branch.
FossilOrigin-Name: bd9b373b177a71f5eaeb7ce8dd1dc755b34951ee1376c24652418bb329bfcb45
2021-08-20 16:19:19 +00:00
dan
b15c63cbb9 Fix a problem on this branch causing checkpoints that do not proceed because they can't get the CHECKPOINT lock to return incorrect output values.
FossilOrigin-Name: 5a98820c3d20766813bb4b0da23247ac90f380c07827ff13b61d5b606d8311aa
2021-08-20 11:50:12 +00:00
drh
aecd7f9d75 Enable this branch to run both with and without the -DSQLITE_USE_SEH option.
FossilOrigin-Name: 840e0a14ebc4a85d4ede0223287d4c1e4465e9f20c3c43bfc74775dddec1fa8f
2021-08-19 23:10:57 +00:00
dan
8aa22ffe98 If SQLITE_USE_SEH is defined, handle structured-exceptions thrown by MSVC builds if the *-shm file mapping is accessed after it becomes invalid for some reason.
FossilOrigin-Name: 5c5fa47076c5da25ca92248df3a4c11b90a0225a07f05d7220fa95d9bbb36f43
2021-08-19 21:01:15 +00:00
drh
8c8b9357e4 Merge recent trunk changes into the begin-concurrent-pnu-wal2 branch.
FossilOrigin-Name: 5b6f6514bd3dcfb45c0ac9a2c4f806fa2f2e8bd7ee62f766bdc218246b4d9e22
2021-08-03 16:44:57 +00:00
drh
0f1e95e616 Merge recent trunk enhancements into the wal2 branch.
FossilOrigin-Name: f615d7baa889030b230e0d4f018dc9f8a6fe95cd3a671d7e2b941ae3240fa6ca
2021-08-02 20:29:08 +00:00
drh
f873392dde Enhance the wal.c source file with an ASCII-art schematic of the -shm file
header.

FossilOrigin-Name: a6c160e08a61d105f8aab959440ac5ec4f1aaca8f0d393e08e7c2c67815b5bb2
2021-07-29 18:34:35 +00:00
drh
944d85dfe2 Fix an error in one of the assert() statements added by [23b08fe9db24a953].
FossilOrigin-Name: ad24334bc06dc9ae52825a1873a1eab6c258d77fcc00dec55884ddddecd9932e
2021-07-29 17:01:44 +00:00
drh
fd4c7862ee Improve comments and add new assert() statements in WAL to help document
how everything works.

FossilOrigin-Name: 23b08fe9db24a953cc231b093cf74d140c9965d22964d0401ff8ab3d4ecba443
2021-07-29 16:48:21 +00:00
dan
ef319309ea Merge latest changes from wal2 into this branch.
FossilOrigin-Name: 4efefb5938c1ec83ee367ae5cc4bba906729b4e8699fa81adc6ca3618c73eb03
2021-05-21 17:31:04 +00:00
drh
80189c5bfe Merge the latest trunk enhancements into the wal2 branch.
FossilOrigin-Name: 95cc7783457b39bbe0866295648a86e7ee5e1660048ab133f1ccf300498ef1bf
2021-05-21 16:42:05 +00:00
drh
0449f6561f Fix a harmless "unused variable" warning when compiling with
-DSQLITE_COVERAGE_TEST.

FossilOrigin-Name: 0bef3fb11fb95d7ede82b59aea26e99e2e23b3bce48009181e691ea17ae78a61
2021-04-30 12:30:35 +00:00
dan
74154a7904 Merge latest changes from wal2 branch.
FossilOrigin-Name: b451bb724ea73367a27c51fcf6e48d02d774c7c5b5b8ec0bd3726a6e4689e591
2020-11-26 18:41:08 +00:00
dan
1a2a4f12dc Merge latest trunk changes into this branch.
FossilOrigin-Name: cb1f6f18e74aeff522c332cb6c8f4c202bba8fba4ff7869198e4501ffa4a0387
2020-11-26 18:08:59 +00:00
dan
50c9522c24 Declare a variable "const" in order to avoid compiler warnings.
FossilOrigin-Name: 4f5481bf291c39e228dd9c67f504dfe70879617b7266245d6236cd1d2d99274c
2020-11-20 11:17:48 +00:00
dan
9bf3da81a0 Fix things so that sqlite3_database_file_object() works with wal2 filenames.
FossilOrigin-Name: c2426ae8a80d61e1ede2d065c10145ba31d4ac615803f48b7903f5f7daaa6f89
2020-11-19 16:08:08 +00:00
dan
91faeec8d0 Modify a test for corruption within the wal checkpoint code to account for the pending-byte page. And for the fact that test configurations might move the pending-byte page.
FossilOrigin-Name: 7dfb74c37e678dde347d9d85846672f82ad282e300e32676330b764be2e4d580
2020-08-11 18:00:10 +00:00
drh
1d80c33599 Merge all the latest changes into the begin-concurrent-pnu-wal2 branch.
FossilOrigin-Name: ebefcb8607c91d19ee68935b01fc9c237af41df8b866a9372f7940d89ba44c9c
2020-08-11 13:22:22 +00:00
dan
174f4fa241 Merge latest trunk changes into this branch.
FossilOrigin-Name: 91262e665755a1430f3b667867b9c4fa0cc3aa0388c21e8ba436485beefa9f4a
2020-08-11 11:34:00 +00:00
drh
799443b14f Do the oversize-WAL corruption test before the size hint is issued.
FossilOrigin-Name: fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214
2020-08-07 19:52:01 +00:00
dan
88819d5870 Return an SQLITE_CORRUPT error if the final expected size of the database when checkpointing is not reasonable - where reasonable is defined (basically) as the sum of the sizes of the database and wal files.
FossilOrigin-Name: e2799563c8a97f617c6d932719b312e3d5bff051a9a397492df8d88e8bb4260a
2020-08-07 16:28:02 +00:00
dan
57f7daf312 Merge latest wal2 changes into this branch.
FossilOrigin-Name: ebd39665e5787fa2c35941ab6c6019f95f0c01229076e3859a3349b516183985
2020-07-31 17:08:40 +00:00
dan
aae84d814c Merge latest trunk changes into this branch.
FossilOrigin-Name: 0c0d0a77bc8fa68ee584ca6d7a0408dcd00734a9b6b69d127ee8477c230a749c
2020-07-31 16:01:33 +00:00
drh
e592c18c1c Provide an alternative "guaranteed-safe" method for overwriting the WAL index
on recovery, in case some platform is found for which memcpy() cannot do this
safely.

FossilOrigin-Name: 168cccbabbd4807bdb04953f395cd1a245c46e9d4816a09c9d024ecd5432759d
2020-07-30 22:33:36 +00:00
drh
8deae5ade3 Fix signed/unsigned compiler warnings.
FossilOrigin-Name: 1d69eee8b085d514f442840346f001b4785f8ec64f5ba66943e9577b26e2e29c
2020-07-29 12:23:20 +00:00
drh
e7f3edcd49 Add an sqlite3FaultSim() to make an OOM case more accessible and remove
the ALWAYS() on the conditional that is false when the OOM actually occurs.

FossilOrigin-Name: 2a251af84ff1f5ca281aa69c5410d6ae7aa5a85ef47149909a297525e1651e9d
2020-07-28 17:17:36 +00:00
drh
f31230af12 On recovery, always overwrite the old with the new, even if they are the same.
Add ALWAYS() macros on branches currently thought to be unreachable, pending
additional testing.

FossilOrigin-Name: 7052cf1d533f6404d0f45cf0b3e8a11c1ee27eccb64680a7fd308c8da7cbd544
2020-07-27 20:16:37 +00:00
drh
8caebb26c5 Improved error reporting if walLockExclusive() fails.
FossilOrigin-Name: cf962d213abe1b55ebbcfecf1de9d5d61709509d1ce3cbd56d8cf4c9ad65e5a9
2020-07-27 15:01:10 +00:00
dan
d3e38b7c0e Allow a wal mode recovery to proceed even if there are readers.
FossilOrigin-Name: 74374aebf9abf3d6b6a3920967a079ceaa4c6276dc6c177682742c2be405b7b7
2020-07-25 20:16:27 +00:00