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.
This commit is contained in:
Heikki Linnakangas 2014-01-24 19:08:52 +02:00
parent a8f374849f
commit d150ff5781
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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