Commit 65c384c5 authored by Heikki Linnakangas's avatar Heikki Linnakangas

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.
parent e3a9a194
...@@ -881,7 +881,7 @@ btvacuumpage(BTVacState *vstate, BlockNumber blkno, BlockNumber orig_blkno) ...@@ -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: ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment