pgsql: Fix test_decoding's handling of nonexistant columns in old tuple

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix test_decoding's handling of nonexistant columns in old tuple
Date: 2015-06-27 17:23:15
Message-ID: E1Z8tox-0006Tg-1y@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)3874(dot)90852(at)wrigleys(dot)postgresql(dot)org

Backpatch to 9.4, where the feature, including the bug, was added.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d47a1136e441cebe7ae7fe72d70eb8ce278d5cd6

Modified Files
--------------
contrib/test_decoding/expected/ddl.out | 14 ++++++++++++--
contrib/test_decoding/sql/ddl.sql | 4 ++++
contrib/test_decoding/test_decoding.c | 2 +-
3 files changed, 17 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2015-06-27 17:23:16 pgsql: Fix test_decoding's handling of nonexistant columns in old tuple
Previous Message Kevin Grittner 2015-06-27 14:57:06 pgsql: Add opaque declaration of HTAB to tqual.h.