Correctly set t_self for heap tuples in expand_tuple

Andrew Dunstan <andrew@dunslane.net>

Commit: 372102b81dd0096764b712deffab00732f3c9d80
Author: Andrew Dunstan <andrew@dunslane.net>
Date: 2018-10-24T14:57:35Z
Releases: 11.1
Correctly set t_self for heap tuples in expand_tuple

Commit 16828d5c0 incorrectly set an invalid pointer for t_self for heap
tuples. This patch correctly copies it from the source tuple, and
includes a regression test that relies on it being set correctly.

Backpatch to release 11.

Fixes bug #15448 reported by Tillmann Schulz

Diagnosis and test case by Amit Langote

Files