pgsql: Pass correct TupDesc to ri_NullCheck() in Assert - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: Pass correct TupDesc to ri_NullCheck() in Assert
Date
Msg-id E1f3T77-0006tF-RV@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Prevent accidental linking of system-supplied copies oflibpq.so
Next
From: Andres Freund
Date:
Subject: pgsql: Fix GCC 7 snprintf() compiler warning.