diff options
author | Andres Freund <andres@anarazel.de> | 2015-06-27 18:49:00 +0200 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2015-06-27 19:01:00 +0200 |
commit | ed6c8d73619a69c8751c8662242fdce22d31bc42 (patch) | |
tree | 39353be38045ccef6be4df8b37b323b283fef76c /contrib/test_decoding/test_decoding.c | |
parent | 524e1e40316afc3cf8ba70910fefe1f99b18144f (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: 20150626100333.3874.90852@wrigleys.postgresql.org
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 1167cc7c49b..1028eaa4c32 100644 --- a/contrib/test_decoding/test_decoding.c +++ b/contrib/test_decoding/test_decoding.c @@ -318,7 +318,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; |