Fix error when reading first page from WAL commit in SQLite3#15
Fix error when reading first page from WAL commit in SQLite3#15Schamper merged 2 commits intofox-it:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15 +/- ##
=======================================
Coverage 82.05% 82.05%
=======================================
Files 31 31
Lines 2346 2352 +6
=======================================
+ Hits 1925 1930 +5
- Misses 421 422 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Pushed a slightly changed suggestion, let me know if that works. Question: does the header actually change? I.e. is it worth to read the database header from the WAL instead of always from |
|
I don't think that is necessary. It is possible for the header to change, for example when a |
|
Cool, if you can confirm my change is fine, this LGTM. |
|
Yes, it still works as expected. |
This PR fixes an issue where a
InvalidPageTypewould be thrown when attempting to read data from page 1 of a WAL commit, e.g.Error while executing 'notifications.wpndatabase': Unknown page type: 83.This issue was discussed while working on #9, see: #9 (comment).
Back then I was not able to create a database with data on page 1, and page 1 being in WAL. I have found that the Windows notifications database on both my VM's does this, which allowed me to work on a fix. It is fixed by just moving the head past the header. This fix works on the notifications database.
I have not yet been able to achieve this in Python's SQLite3 library, so there is no new test data.
Required for: fox-it/dissect.target#1454