pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
7+ messages / 1 participants
[nested] [flat]

* pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
@ 2021-01-19 18:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-01-19 18:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove faulty support for MergeAppend plan with WHERE CURRENT OF.

Somebody extended search_plan_tree() to treat MergeAppend exactly
like Append, which is 100% wrong, because unlike Append we can't
assume that only one input node is actively returning tuples.
Hence a cursor using a MergeAppend across a UNION ALL or inheritance
tree could falsely match a WHERE CURRENT OF query at a row that
isn't actually the cursor's current output row, but coincidentally
has the same TID (in a different table) as the current output row.

Delete the faulty code; this means that such a case will now return
an error like 'cursor "foo" is not a simply updatable scan of table
"bar"', instead of silently misbehaving.  Users should not find that
surprising though, as the same cursor query could have failed that way
already depending on the chosen plan.  (It would fail like that if the
sort were done with an explicit Sort node instead of MergeAppend.)

Expand the clearly-inadequate commentary to be more explicit about
what this code is doing, in hopes of forestalling future mistakes.

It's been like this for awhile, so back-patch to all supported
branches.

Discussion: https://postgr.es/m/482865.1611075182@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a0efda88a679edaee9855628cb05b2ab00d80a15

Modified Files
--------------
src/backend/executor/execCurrent.c | 53 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 26 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
@ 2021-01-19 18:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-01-19 18:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove faulty support for MergeAppend plan with WHERE CURRENT OF.

Somebody extended search_plan_tree() to treat MergeAppend exactly
like Append, which is 100% wrong, because unlike Append we can't
assume that only one input node is actively returning tuples.
Hence a cursor using a MergeAppend across a UNION ALL or inheritance
tree could falsely match a WHERE CURRENT OF query at a row that
isn't actually the cursor's current output row, but coincidentally
has the same TID (in a different table) as the current output row.

Delete the faulty code; this means that such a case will now return
an error like 'cursor "foo" is not a simply updatable scan of table
"bar"', instead of silently misbehaving.  Users should not find that
surprising though, as the same cursor query could have failed that way
already depending on the chosen plan.  (It would fail like that if the
sort were done with an explicit Sort node instead of MergeAppend.)

Expand the clearly-inadequate commentary to be more explicit about
what this code is doing, in hopes of forestalling future mistakes.

It's been like this for awhile, so back-patch to all supported
branches.

Discussion: https://postgr.es/m/482865.1611075182@sss.pgh.pa.us

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6253159965d563dd0e416e064b760e381a60b8e8

Modified Files
--------------
src/backend/executor/execCurrent.c | 53 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 26 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
@ 2021-01-19 18:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-01-19 18:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove faulty support for MergeAppend plan with WHERE CURRENT OF.

Somebody extended search_plan_tree() to treat MergeAppend exactly
like Append, which is 100% wrong, because unlike Append we can't
assume that only one input node is actively returning tuples.
Hence a cursor using a MergeAppend across a UNION ALL or inheritance
tree could falsely match a WHERE CURRENT OF query at a row that
isn't actually the cursor's current output row, but coincidentally
has the same TID (in a different table) as the current output row.

Delete the faulty code; this means that such a case will now return
an error like 'cursor "foo" is not a simply updatable scan of table
"bar"', instead of silently misbehaving.  Users should not find that
surprising though, as the same cursor query could have failed that way
already depending on the chosen plan.  (It would fail like that if the
sort were done with an explicit Sort node instead of MergeAppend.)

Expand the clearly-inadequate commentary to be more explicit about
what this code is doing, in hopes of forestalling future mistakes.

It's been like this for awhile, so back-patch to all supported
branches.

Discussion: https://postgr.es/m/482865.1611075182@sss.pgh.pa.us

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0ab177bec1c546d2b98b5934a817b23bcc335ca9

Modified Files
--------------
src/backend/executor/execCurrent.c | 53 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 26 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
@ 2021-01-19 18:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-01-19 18:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove faulty support for MergeAppend plan with WHERE CURRENT OF.

Somebody extended search_plan_tree() to treat MergeAppend exactly
like Append, which is 100% wrong, because unlike Append we can't
assume that only one input node is actively returning tuples.
Hence a cursor using a MergeAppend across a UNION ALL or inheritance
tree could falsely match a WHERE CURRENT OF query at a row that
isn't actually the cursor's current output row, but coincidentally
has the same TID (in a different table) as the current output row.

Delete the faulty code; this means that such a case will now return
an error like 'cursor "foo" is not a simply updatable scan of table
"bar"', instead of silently misbehaving.  Users should not find that
surprising though, as the same cursor query could have failed that way
already depending on the chosen plan.  (It would fail like that if the
sort were done with an explicit Sort node instead of MergeAppend.)

Expand the clearly-inadequate commentary to be more explicit about
what this code is doing, in hopes of forestalling future mistakes.

It's been like this for awhile, so back-patch to all supported
branches.

Discussion: https://postgr.es/m/482865.1611075182@sss.pgh.pa.us

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fe8edbb8267adf24ba3b392ac6229b96c4287f93

Modified Files
--------------
src/backend/executor/execCurrent.c | 53 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 26 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
@ 2021-01-19 18:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-01-19 18:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove faulty support for MergeAppend plan with WHERE CURRENT OF.

Somebody extended search_plan_tree() to treat MergeAppend exactly
like Append, which is 100% wrong, because unlike Append we can't
assume that only one input node is actively returning tuples.
Hence a cursor using a MergeAppend across a UNION ALL or inheritance
tree could falsely match a WHERE CURRENT OF query at a row that
isn't actually the cursor's current output row, but coincidentally
has the same TID (in a different table) as the current output row.

Delete the faulty code; this means that such a case will now return
an error like 'cursor "foo" is not a simply updatable scan of table
"bar"', instead of silently misbehaving.  Users should not find that
surprising though, as the same cursor query could have failed that way
already depending on the chosen plan.  (It would fail like that if the
sort were done with an explicit Sort node instead of MergeAppend.)

Expand the clearly-inadequate commentary to be more explicit about
what this code is doing, in hopes of forestalling future mistakes.

It's been like this for awhile, so back-patch to all supported
branches.

Discussion: https://postgr.es/m/482865.1611075182@sss.pgh.pa.us

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/188cd4f440ed6bb2b3120ade9a2277c91d79215c

Modified Files
--------------
src/backend/executor/execCurrent.c | 53 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 26 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
@ 2021-01-19 18:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-01-19 18:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove faulty support for MergeAppend plan with WHERE CURRENT OF.

Somebody extended search_plan_tree() to treat MergeAppend exactly
like Append, which is 100% wrong, because unlike Append we can't
assume that only one input node is actively returning tuples.
Hence a cursor using a MergeAppend across a UNION ALL or inheritance
tree could falsely match a WHERE CURRENT OF query at a row that
isn't actually the cursor's current output row, but coincidentally
has the same TID (in a different table) as the current output row.

Delete the faulty code; this means that such a case will now return
an error like 'cursor "foo" is not a simply updatable scan of table
"bar"', instead of silently misbehaving.  Users should not find that
surprising though, as the same cursor query could have failed that way
already depending on the chosen plan.  (It would fail like that if the
sort were done with an explicit Sort node instead of MergeAppend.)

Expand the clearly-inadequate commentary to be more explicit about
what this code is doing, in hopes of forestalling future mistakes.

It's been like this for awhile, so back-patch to all supported
branches.

Discussion: https://postgr.es/m/482865.1611075182@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fac54bd5e216c18d921b7ba18b30e8f8139034b6

Modified Files
--------------
src/backend/executor/execCurrent.c | 53 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 26 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
@ 2021-01-19 18:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-01-19 18:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove faulty support for MergeAppend plan with WHERE CURRENT OF.

Somebody extended search_plan_tree() to treat MergeAppend exactly
like Append, which is 100% wrong, because unlike Append we can't
assume that only one input node is actively returning tuples.
Hence a cursor using a MergeAppend across a UNION ALL or inheritance
tree could falsely match a WHERE CURRENT OF query at a row that
isn't actually the cursor's current output row, but coincidentally
has the same TID (in a different table) as the current output row.

Delete the faulty code; this means that such a case will now return
an error like 'cursor "foo" is not a simply updatable scan of table
"bar"', instead of silently misbehaving.  Users should not find that
surprising though, as the same cursor query could have failed that way
already depending on the chosen plan.  (It would fail like that if the
sort were done with an explicit Sort node instead of MergeAppend.)

Expand the clearly-inadequate commentary to be more explicit about
what this code is doing, in hopes of forestalling future mistakes.

It's been like this for awhile, so back-patch to all supported
branches.

Discussion: https://postgr.es/m/482865.1611075182@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/794562d0770ae0ba4096c57c116e80a2be043fbf

Modified Files
--------------
src/backend/executor/execCurrent.c | 53 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 26 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2021-01-19 18:26 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 18:26 pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF Tom Lane <tgl@sss.pgh.pa.us>
2021-01-19 18:26 pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF Tom Lane <tgl@sss.pgh.pa.us>
2021-01-19 18:26 pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF Tom Lane <tgl@sss.pgh.pa.us>
2021-01-19 18:26 pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF Tom Lane <tgl@sss.pgh.pa.us>
2021-01-19 18:26 pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF Tom Lane <tgl@sss.pgh.pa.us>
2021-01-19 18:26 pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF Tom Lane <tgl@sss.pgh.pa.us>
2021-01-19 18:26 pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF 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