Commit 1460b199 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Assert that pre/post-fix updated tuples are on the same page during replay.

If they were not 'oldtup.t_data' would be dereferenced while set to NULL
in case of a full page image for block 0.

Do so primarily to silence coverity; but also to make sure this prerequisite
isn't changed without adapting the replay routine as that would appear to
work in many cases.

Andres Freund
parent a692ee58
...@@ -8115,11 +8115,13 @@ newsame:; ...@@ -8115,11 +8115,13 @@ newsame:;
if (xlrec->flags & XLOG_HEAP_PREFIX_FROM_OLD) if (xlrec->flags & XLOG_HEAP_PREFIX_FROM_OLD)
{ {
Assert(samepage);
memcpy(&prefixlen, recdata, sizeof(uint16)); memcpy(&prefixlen, recdata, sizeof(uint16));
recdata += sizeof(uint16); recdata += sizeof(uint16);
} }
if (xlrec->flags & XLOG_HEAP_SUFFIX_FROM_OLD) if (xlrec->flags & XLOG_HEAP_SUFFIX_FROM_OLD)
{ {
Assert(samepage);
memcpy(&suffixlen, recdata, sizeof(uint16)); memcpy(&suffixlen, recdata, sizeof(uint16));
recdata += sizeof(uint16); recdata += sizeof(uint16);
} }
......
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