From d47a1136e441cebe7ae7fe72d70eb8ce278d5cd6 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Sat, 27 Jun 2015 18:49:00 +0200 Subject: 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: 20150626100333.3874.90852@wrigleys.postgresql.org Backpatch to 9.4, where the feature, including the bug, was added. --- contrib/test_decoding/test_decoding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/test_decoding/test_decoding.c') 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; -- cgit v1.2.3