pgsql: Pass correct TupDesc to ri_NullCheck() in Assert

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Pass correct TupDesc to ri_NullCheck() in Assert
Date: 2018-04-03 21:05:09
Message-ID: E1f3T77-0006tF-RV@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Pass correct TupDesc to ri_NullCheck() in Assert

Previous coding was passing the wrong table's tuple descriptor, which
accidentally fails to fail because no existing test case exercises a
foreign key in which the referenced attributes are further to the right
of the referencing attributes.

Add a test so that further breakage is visible.

This got broken in 16828d5c0273.

Discussion: https://postgr.es/m/20180403204723.fqte755nukgm42uf@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cd5005bc12d0f9a15fe7dddd3e1ac92496608114

Modified Files
--------------
src/backend/utils/adt/ri_triggers.c | 2 +-
src/test/regress/expected/foreign_key.out | 13 +++++++++++++
src/test/regress/sql/foreign_key.sql | 10 ++++++++++
3 files changed, 24 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2018-04-03 21:12:56 pgsql: Fix GCC 7 snprintf() compiler warning.
Previous Message Michael Banck 2018-04-03 20:48:15 Re: pgsql: Validate page level checksums in base backups