]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix MERGE command tag for actions blocked by BEFORE ROW triggers.
authorDean Rasheed <dean.a.rasheed@gmail.com>
Mon, 13 Mar 2023 11:11:10 +0000 (11:11 +0000)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Mon, 13 Mar 2023 11:11:10 +0000 (11:11 +0000)
commitda6257eee35db5d281a115838abaf285b46b52f3
tree1979b2df1a221327a17dd7dadc9d773663f96543
parent7d9a75713ab91071a2110e25e7c86cbf2a6fdc4b
Fix MERGE command tag for actions blocked by BEFORE ROW triggers.

This ensures that the row count in the command tag for a MERGE is
correctly computed in the case where UPDATEs or DELETEs are skipped
due to a BEFORE ROW trigger returning NULL (the INSERT case was
already handled correctly by ExecMergeNotMatched() calling
ExecInsert()).

Back-patch to v15, where MERGE was introduced.

Discussion: https://postgr.es/m/CAEZATCU8XEmR0JWKDtyb7iZ%3DqCffxS9uyJt0iOZ4TV4RT%2Bow1w%40mail.gmail.com
src/backend/executor/nodeModifyTable.c
src/test/regress/expected/merge.out
src/test/regress/sql/merge.sql