]> granicus.if.org Git - postgresql/commit
Pass correct TupDesc to ri_NullCheck() in Assert
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 3 Apr 2018 21:01:22 +0000 (18:01 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 3 Apr 2018 21:04:50 +0000 (18:04 -0300)
commitcd5005bc12d0f9a15fe7dddd3e1ac92496608114
tree8a2fa17da9fbde2d6a0b4dd988a15b5d77517c2e
parentdddfc4cb2edcfa5497f5d50190a7fb046c51da16
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
src/backend/utils/adt/ri_triggers.c
src/test/regress/expected/foreign_key.out
src/test/regress/sql/foreign_key.sql