mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Fix reporting of violations in ExecConstraints, again.
We decided in f1b4c771ea
to pass the
original slot to ExecConstraints(), but that breaks when there are
BEFORE ROW triggers involved. So we need to do reverse-map the tuples
back to the original descriptor instead, as Amit originally proposed.
Amit Langote, reviewed by Ashutosh Bapat. One overlooked comment
fixed by me.
Discussion: http://postgr.es/m/b3a17254-6849-e542-2353-bde4e880b6a4@lab.ntt.co.jp
This commit is contained in:
@ -389,7 +389,7 @@ ExecSimpleRelationInsert(EState *estate, TupleTableSlot *slot)
|
||||
|
||||
/* Check the constraints of the tuple */
|
||||
if (rel->rd_att->constr)
|
||||
ExecConstraints(resultRelInfo, slot, slot, estate);
|
||||
ExecConstraints(resultRelInfo, slot, estate);
|
||||
|
||||
/* Store the slot into tuple that we can inspect. */
|
||||
tuple = ExecMaterializeSlot(slot);
|
||||
@ -448,7 +448,7 @@ ExecSimpleRelationUpdate(EState *estate, EPQState *epqstate,
|
||||
|
||||
/* Check the constraints of the tuple */
|
||||
if (rel->rd_att->constr)
|
||||
ExecConstraints(resultRelInfo, slot, slot, estate);
|
||||
ExecConstraints(resultRelInfo, slot, estate);
|
||||
|
||||
/* Store the slot into tuple that we can write. */
|
||||
tuple = ExecMaterializeSlot(slot);
|
||||
|
Reference in New Issue
Block a user