Commit d150ff57 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Reset unused fields in GIN data leaf page footer.

The maxoff field is not used in the new, compressed page format. Let's
reset it when converting an old-format page to the new format. The code
won't care either way, but this makes it possible to use the field for
something else in the future.
parent a8f37484
......@@ -817,7 +817,10 @@ dataPlaceToPageLeafRecompress(Buffer buf, disassembledLeaf *leaf,
}
Assert(newsize <= GinDataLeafMaxContentSize);
GinDataLeafPageSetPostingListSize(page, newsize);
GinPageSetCompressed(page); /* in case it was in pre-9.4 format before */
/* Reset these in case the page was in pre-9.4 format before */
GinPageSetCompressed(page);
GinPageGetOpaque(page)->maxoff = InvalidOffsetNumber;
/* Put WAL data */
recompress_xlog.length = (uint16) newsize;
......
......@@ -153,6 +153,7 @@ ginRedoRecompress(Page page, ginxlogRecompressDataLeaf *data)
memcpy(segment, data->newdata, data->length - data->unmodifiedsize);
GinDataLeafPageSetPostingListSize(page, data->length);
GinPageSetCompressed(page);
GinPageGetOpaque(page)->maxoff = InvalidOffsetNumber;
}
static void
......
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