pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix EvalPlanQual bug when query contains both locked and not-loc 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix EvalPlanQual bug when query contains both locked and not-loc @ 2016-03-22 21:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2016-03-22 21:56 UTC (permalink / raw) To: pgsql-committers Fix EvalPlanQual bug when query contains both locked and not-locked rels. In commit afb9249d06f47d7a, we (probably I) made ExecLockRows assign null test tuples to all relations of the query while setting up to do an EvalPlanQual recheck for a newly-updated locked row. This was sheerest brain fade: we should only set test tuples for relations that are lockable by the LockRows node, and in particular empty test tuples are only sensible for inheritance child relations that weren't the source of the current tuple from their inheritance tree. Setting a null test tuple for an unrelated table causes it to return NULLs when it should not, as exhibited in bug #14034 from Bronislav Houdek. To add insult to injury, doing it the wrong way required two loops where one would suffice; so the corrected code is even a bit shorter and faster. Add a regression test case based on his example, and back-patch to 9.5 where the bug was introduced. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/71404af2a29ce4a3a5907cdc8b893ec2bc0285b4 Modified Files -------------- src/backend/executor/nodeLockRows.c | 40 ++++++++++++-------------- src/test/isolation/expected/eval-plan-qual.out | 19 ++++++++++++ src/test/isolation/specs/eval-plan-qual.spec | 23 +++++++++++++++ 3 files changed, 60 insertions(+), 22 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix EvalPlanQual bug when query contains both locked and not-loc @ 2016-03-22 21:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2016-03-22 21:56 UTC (permalink / raw) To: pgsql-committers Fix EvalPlanQual bug when query contains both locked and not-locked rels. In commit afb9249d06f47d7a, we (probably I) made ExecLockRows assign null test tuples to all relations of the query while setting up to do an EvalPlanQual recheck for a newly-updated locked row. This was sheerest brain fade: we should only set test tuples for relations that are lockable by the LockRows node, and in particular empty test tuples are only sensible for inheritance child relations that weren't the source of the current tuple from their inheritance tree. Setting a null test tuple for an unrelated table causes it to return NULLs when it should not, as exhibited in bug #14034 from Bronislav Houdek. To add insult to injury, doing it the wrong way required two loops where one would suffice; so the corrected code is even a bit shorter and faster. Add a regression test case based on his example, and back-patch to 9.5 where the bug was introduced. Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/d8d5a00b182009f6fdb426a40ac677c4fda56be7 Modified Files -------------- src/backend/executor/nodeLockRows.c | 40 ++++++++++++-------------- src/test/isolation/expected/eval-plan-qual.out | 19 ++++++++++++ src/test/isolation/specs/eval-plan-qual.spec | 23 +++++++++++++++ 3 files changed, 60 insertions(+), 22 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-03-22 21:56 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-03-22 21:56 pgsql: Fix EvalPlanQual bug when query contains both locked and not-loc Tom Lane <tgl@sss.pgh.pa.us> 2016-03-22 21:56 pgsql: Fix EvalPlanQual bug when query contains both locked and not-loc Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox