diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-04-03 18:01:22 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-04-03 18:04:50 -0300 |
commit | cd5005bc12d0f9a15fe7dddd3e1ac92496608114 (patch) | |
tree | 8a2fa17da9fbde2d6a0b4dd988a15b5d77517c2e /src/backend/utils/adt/ri_triggers.c | |
parent | dddfc4cb2edcfa5497f5d50190a7fb046c51da16 (diff) | |
download | postgresql-cd5005bc12d0f9a15fe7dddd3e1ac92496608114.tar.gz postgresql-cd5005bc12d0f9a15fe7dddd3e1ac92496608114.zip |
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
Diffstat (limited to 'src/backend/utils/adt/ri_triggers.c')
-rw-r--r-- | src/backend/utils/adt/ri_triggers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c index 3bb708f8638..d0fe65cea9b 100644 --- a/src/backend/utils/adt/ri_triggers.c +++ b/src/backend/utils/adt/ri_triggers.c @@ -514,7 +514,7 @@ ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel, bool result; /* Only called for non-null rows */ - Assert(ri_NullCheck(RelationGetDescr(fk_rel), old_row, riinfo, true) == RI_KEYS_NONE_NULL); + Assert(ri_NullCheck(RelationGetDescr(pk_rel), old_row, riinfo, true) == RI_KEYS_NONE_NULL); if (SPI_connect() != SPI_OK_CONNECT) elog(ERROR, "SPI_connect failed"); |