Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Assert that pre/post-fix updated tuples are on the same page during replay.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 5 May 2014 13:14:41 +0000 (16:14 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 5 May 2014 13:15:25 +0000 (16:15 +0300)
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

src/backend/access/heap/heapam.c

index a04763207f031c517a45362c743d7ad329fe5890..336fbb06dac9cc481d4bf035eda21dd391953fd1 100644 (file)
@@ -8115,11 +8115,13 @@ newsame:;
 
    if (xlrec->flags & XLOG_HEAP_PREFIX_FROM_OLD)
    {
+       Assert(samepage);
        memcpy(&prefixlen, recdata, sizeof(uint16));
        recdata += sizeof(uint16);
    }
    if (xlrec->flags & XLOG_HEAP_SUFFIX_FROM_OLD)
    {
+       Assert(samepage);
        memcpy(&suffixlen, recdata, sizeof(uint16));
        recdata += sizeof(uint16);
    }