public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: Fix plpgsql's handling of simple expressions in scrollable curso
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix plpgsql's handling of simple expressions in scrollable curso
@ 2025-03-21 15:31 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-21 15:31 UTC (permalink / raw)
  To: [email protected]

Fix plpgsql's handling of simple expressions in scrollable cursors.

exec_save_simple_expr did not account for the possibility that
standard_planner would stick a Materialize node atop the plan
of even a simple Result, if CURSOR_OPT_SCROLL is set.  This led
to an "unexpected plan node type" error.

This is a very old bug, but it'd only be reached by declaring a
cursor for a "SELECT simple-expression" query and explicitly
marking it scrollable, which is an odd thing to do.  So the lack
of prior reports isn't too surprising.

Bug: #18859
Reported-by: Olleg Samoylov <[email protected]>
Author: Andrei Lepikhov <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_simple.out | 11 +++++++++++
src/pl/plpgsql/src/pl_exec.c                   | 12 +++++++-----
src/pl/plpgsql/src/sql/plpgsql_simple.sql      | 12 ++++++++++++
3 files changed, 30 insertions(+), 5 deletions(-)



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

* pgsql: Fix plpgsql's handling of simple expressions in scrollable curso
@ 2025-03-21 15:31 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-21 15:31 UTC (permalink / raw)
  To: [email protected]

Fix plpgsql's handling of simple expressions in scrollable cursors.

exec_save_simple_expr did not account for the possibility that
standard_planner would stick a Materialize node atop the plan
of even a simple Result, if CURSOR_OPT_SCROLL is set.  This led
to an "unexpected plan node type" error.

This is a very old bug, but it'd only be reached by declaring a
cursor for a "SELECT simple-expression" query and explicitly
marking it scrollable, which is an odd thing to do.  So the lack
of prior reports isn't too surprising.

Bug: #18859
Reported-by: Olleg Samoylov <[email protected]>
Author: Andrei Lepikhov <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5e56efa7c0e03f9d5305a925b2a44b687a2f1821

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_simple.out | 11 +++++++++++
src/pl/plpgsql/src/pl_exec.c                   | 12 +++++++-----
src/pl/plpgsql/src/sql/plpgsql_simple.sql      | 12 ++++++++++++
3 files changed, 30 insertions(+), 5 deletions(-)



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

* pgsql: Fix plpgsql's handling of simple expressions in scrollable curso
@ 2025-03-21 15:31 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-21 15:31 UTC (permalink / raw)
  To: [email protected]

Fix plpgsql's handling of simple expressions in scrollable cursors.

exec_save_simple_expr did not account for the possibility that
standard_planner would stick a Materialize node atop the plan
of even a simple Result, if CURSOR_OPT_SCROLL is set.  This led
to an "unexpected plan node type" error.

This is a very old bug, but it'd only be reached by declaring a
cursor for a "SELECT simple-expression" query and explicitly
marking it scrollable, which is an odd thing to do.  So the lack
of prior reports isn't too surprising.

Bug: #18859
Reported-by: Olleg Samoylov <[email protected]>
Author: Andrei Lepikhov <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1353b1161a790e64507428e33cc0c5975f26474b

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_simple.out | 11 +++++++++++
src/pl/plpgsql/src/pl_exec.c                   | 12 +++++++-----
src/pl/plpgsql/src/sql/plpgsql_simple.sql      | 12 ++++++++++++
3 files changed, 30 insertions(+), 5 deletions(-)



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

* pgsql: Fix plpgsql's handling of simple expressions in scrollable curso
@ 2025-03-21 15:31 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-21 15:31 UTC (permalink / raw)
  To: [email protected]

Fix plpgsql's handling of simple expressions in scrollable cursors.

exec_save_simple_expr did not account for the possibility that
standard_planner would stick a Materialize node atop the plan
of even a simple Result, if CURSOR_OPT_SCROLL is set.  This led
to an "unexpected plan node type" error.

This is a very old bug, but it'd only be reached by declaring a
cursor for a "SELECT simple-expression" query and explicitly
marking it scrollable, which is an odd thing to do.  So the lack
of prior reports isn't too surprising.

Bug: #18859
Reported-by: Olleg Samoylov <[email protected]>
Author: Andrei Lepikhov <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7fe312f6092f47724a29e30fb2992bd2bc287687

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_simple.out | 11 +++++++++++
src/pl/plpgsql/src/pl_exec.c                   | 12 +++++++-----
src/pl/plpgsql/src/sql/plpgsql_simple.sql      | 12 ++++++++++++
3 files changed, 30 insertions(+), 5 deletions(-)



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

* pgsql: Fix plpgsql's handling of simple expressions in scrollable curso
@ 2025-03-21 15:31 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-21 15:31 UTC (permalink / raw)
  To: [email protected]

Fix plpgsql's handling of simple expressions in scrollable cursors.

exec_save_simple_expr did not account for the possibility that
standard_planner would stick a Materialize node atop the plan
of even a simple Result, if CURSOR_OPT_SCROLL is set.  This led
to an "unexpected plan node type" error.

This is a very old bug, but it'd only be reached by declaring a
cursor for a "SELECT simple-expression" query and explicitly
marking it scrollable, which is an odd thing to do.  So the lack
of prior reports isn't too surprising.

Bug: #18859
Reported-by: Olleg Samoylov <[email protected]>
Author: Andrei Lepikhov <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13

Branch
------
REL_14_STABLE

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

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_simple.out | 11 +++++++++++
src/pl/plpgsql/src/pl_exec.c                   | 12 +++++++-----
src/pl/plpgsql/src/sql/plpgsql_simple.sql      | 12 ++++++++++++
3 files changed, 30 insertions(+), 5 deletions(-)



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

* pgsql: Fix plpgsql's handling of simple expressions in scrollable curso
@ 2025-03-21 15:31 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-21 15:31 UTC (permalink / raw)
  To: [email protected]

Fix plpgsql's handling of simple expressions in scrollable cursors.

exec_save_simple_expr did not account for the possibility that
standard_planner would stick a Materialize node atop the plan
of even a simple Result, if CURSOR_OPT_SCROLL is set.  This led
to an "unexpected plan node type" error.

This is a very old bug, but it'd only be reached by declaring a
cursor for a "SELECT simple-expression" query and explicitly
marking it scrollable, which is an odd thing to do.  So the lack
of prior reports isn't too surprising.

Bug: #18859
Reported-by: Olleg Samoylov <[email protected]>
Author: Andrei Lepikhov <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13

Branch
------
REL_16_STABLE

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

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_simple.out | 11 +++++++++++
src/pl/plpgsql/src/pl_exec.c                   | 12 +++++++-----
src/pl/plpgsql/src/sql/plpgsql_simple.sql      | 12 ++++++++++++
3 files changed, 30 insertions(+), 5 deletions(-)



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


end of thread, other threads:[~2025-03-21 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-03-21 15:31 pgsql: Fix plpgsql's handling of simple expressions in scrollable curso Tom Lane <[email protected]>
2025-03-21 15:31 pgsql: Fix plpgsql's handling of simple expressions in scrollable curso Tom Lane <[email protected]>
2025-03-21 15:31 pgsql: Fix plpgsql's handling of simple expressions in scrollable curso Tom Lane <[email protected]>
2025-03-21 15:31 pgsql: Fix plpgsql's handling of simple expressions in scrollable curso Tom Lane <[email protected]>
2025-03-21 15:31 pgsql: Fix plpgsql's handling of simple expressions in scrollable curso Tom Lane <[email protected]>
2025-03-21 15:31 pgsql: Fix plpgsql's handling of simple expressions in scrollable curso Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox