cruppstahl/hamsterdb — pull request #13 by GerHobbelt (2012-08-21 23:54:58+00:00)
Title: passing TXN+HINTS type flags int to db_fetch_page: wrong

while doing a bit of merge work on hamster (we'll get to that later, sigh), I ran a couple of review-based flow analysis checks, as my old assert were disappearing and I know db_fetch_page() was nasty enough to bite my ass at very odd moments, thanks to the mixed return behaviour (depending on flags, page can be _legally_ NULL).

Here we see an occasion where its flags SHOULD be 0 and MUST NOT be a via-via copy of the cursor::erase flags, as _that_ one includes both HAM_HINT_* flag bits and TXN/ERASE specific flag bits (rather: bit), and it just so happens that the hint flag bits sit in the same bit region as the db_fetch_page() flag bits, and more specifically DB_ONLY_FROM_CACHE.