OSDN Git Service

Repair problems occurring when multiple RI updates have to be done to the same
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 15 Aug 2007 19:15:47 +0000 (19:15 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 15 Aug 2007 19:15:47 +0000 (19:15 +0000)
commit9cb84097623e5efe32b7289ca3c403f70ee152d8
treec56de88ec254e2f020e27a431c0aa3ade704a633
parent5ff95e6b8e19cef5e7fd15368194da1d29ebb0be
Repair problems occurring when multiple RI updates have to be done to the same
row within one query: we were firing check triggers before all the updates
were done, leading to bogus failures.  Fix by making the triggers queued by
an RI update go at the end of the outer query's trigger event list, thereby
effectively making the processing "breadth-first".  This was indeed how it
worked pre-8.0, so the bug does not occur in the 7.x branches.
Per report from Pavel Stehule.
src/backend/commands/trigger.c
src/backend/executor/spi.c
src/backend/utils/adt/ri_triggers.c
src/include/executor/spi.h
src/test/regress/expected/foreign_key.out
src/test/regress/sql/foreign_key.sql