Fix test_decoding's handling of nonexistant columns in old tuple versions.
authorAndres Freund <andres@anarazel.de>
Sat, 27 Jun 2015 16:49:00 +0000 (18:49 +0200)
committerAndres Freund <andres@anarazel.de>
Sat, 27 Jun 2015 17:00:45 +0000 (19:00 +0200)
commitd47a1136e441cebe7ae7fe72d70eb8ce278d5cd6
tree6f314fe0989a0de9f1445113dea5b3b13e34de6e
parent604e99396de02f6f23950ee373c13335d2ccdf05
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/expected/ddl.out
contrib/test_decoding/sql/ddl.sql
contrib/test_decoding/test_decoding.c