Pass correct TupDesc to ri_NullCheck() in Assert

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: cd5005bc12d0f9a15fe7dddd3e1ac92496608114
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2018-04-03T21:04:50Z
Releases: 11.0
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

Files

Discussion