1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-05 09:19:17 +03:00

Avoid calling PageGetSpecialPointer() on an all-zeros page.

That was otherwise harmless, but tripped the new assertion in
PageGetSpecialPointer().

Reported by Amit Langote. Backpatch to 9.5, where the assertion was added.
This commit is contained in:
Heikki Linnakangas 2015-07-27 12:24:27 +03:00
parent dd20a97219
commit 6a0a388c20

View File

@ -881,7 +881,7 @@ btvacuumpage(BTVacState *vstate, BlockNumber blkno, BlockNumber orig_blkno)
BlockNumber recurse_to; BlockNumber recurse_to;
Buffer buf; Buffer buf;
Page page; Page page;
BTPageOpaque opaque; BTPageOpaque opaque = NULL;
restart: restart:
delete_now = false; delete_now = false;
@ -900,9 +900,11 @@ restart:
info->strategy); info->strategy);
LockBuffer(buf, BT_READ); LockBuffer(buf, BT_READ);
page = BufferGetPage(buf); page = BufferGetPage(buf);
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
if (!PageIsNew(page)) if (!PageIsNew(page))
{
_bt_checkpage(rel, buf); _bt_checkpage(rel, buf);
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
}
/* /*
* If we are recursing, the only case we want to do anything with is a * If we are recursing, the only case we want to do anything with is a