diff options
author | Andres Freund | 2015-06-27 16:49:00 +0000 |
---|---|---|
committer | Andres Freund | 2015-06-27 17:00:45 +0000 |
commit | d47a1136e441cebe7ae7fe72d70eb8ce278d5cd6 (patch) | |
tree | 6f314fe0989a0de9f1445113dea5b3b13e34de6e /contrib/test_decoding/test_decoding.c | |
parent | 604e99396de02f6f23950ee373c13335d2ccdf05 (diff) |
Fix test_decoding's handling of nonexistant columns in old tuple versions.
test_decoding used fastgetattr() to extract column values. That's wrong
when decoding updates and deletes if a table's replica identity is set
to FULL and new columns have been added since the old version of the
tuple was created. Due to the lack of a crosscheck with the datum's
natts values an invalid value will be output, leading to errors or
worse.
Bug: #13470
Reported-By: Krzysztof Kotlarski
Discussion: [email protected]
Backpatch to 9.4, where the feature, including the bug, was added.
Diffstat (limited to 'contrib/test_decoding/test_decoding.c')
-rw-r--r-- | contrib/test_decoding/test_decoding.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c index 32d57430185..80fc5f41ca4 100644 --- a/contrib/test_decoding/test_decoding.c +++ b/contrib/test_decoding/test_decoding.c @@ -345,7 +345,7 @@ tuple_to_stringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool skip_ typid = attr->atttypid; /* get Datum from tuple */ - origval = fastgetattr(tuple, natt + 1, tupdesc, &isnull); + origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull); if (isnull && skip_nulls) continue; |