Fix another bug in the redo of COPY batches.
authorHeikki Linnakangas <[email protected]>
Thu, 10 Nov 2011 10:09:33 +0000 (12:09 +0200)
committerHeikki Linnakangas <[email protected]>
Thu, 10 Nov 2011 10:21:43 +0000 (12:21 +0200)
I got alignment wrong in the redo routine. Spotted by redoing the log
genereated by copy regression test.

src/backend/access/heap/heapam.c

index 9b49302c789b33ce75728ab571284b4a4cf86d1c..630c3ab26c0d484f51befd4224dc1aa4fa304e9d 100644 (file)
@@ -5111,7 +5111,7 @@ heap_xlog_multi_insert(XLogRecPtr lsn, XLogRecord *record)
            elog(PANIC, "heap_multi_insert_redo: invalid max offset number");
 
        xlhdr = (xl_multi_insert_tuple *) SHORTALIGN(recdata);
-       recdata += SizeOfMultiInsertTuple;
+       recdata = ((char *) xlhdr) + SizeOfMultiInsertTuple;
 
        newlen = xlhdr->datalen;
        Assert(newlen <= MaxHeapTupleSize);