Thanks for the bug report. The problem is fixed on trunk. If you request a page_size of 512 and reserve_bytes is 33 or more, then the page_size is actually set to 1024. See check-in [d5ea75a09d4bf612](src:/info/d5ea75a09d4bf612). The test cases are in [TH3](https://www.sqlite.org/th3.html), in case you were wondering.