pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Set scan direction appropriately for SubPlans (bug #15336) 7+ messages / 1 participants [nested] [flat]
* pgsql: Set scan direction appropriately for SubPlans (bug #15336) @ 2018-08-17 15:31 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Andrew Gierth @ 2018-08-17 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Set scan direction appropriately for SubPlans (bug #15336) When executing a SubPlan in an expression, the EState's direction field was left alone, resulting in an attempt to execute the subplan backwards if it was encountered during a backwards scan of a cursor. Also, though much less likely, it was possible to reach the execution of an InitPlan while in backwards-scan state. Repair by saving/restoring estate->es_direction and forcing forward scan mode in the relevant places. Backpatch all the way, since this has been broken since 8.3 (prior to commit c7ff7663e, SubPlans had their own EStates rather than sharing the parent plan's, so there was no confusion over scan direction). Per bug #15336 reported by Vladimir Baranoff; analysis and patch by me, review by Tom Lane. Discussion: https://postgr.es/m/153449812167.1304.1741624125628126322@wrigleys.postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/520acab171244b55d816c70b9a89280b09937925 Modified Files -------------- src/backend/executor/nodeSubplan.c | 26 ++++++++++++++++++++++++-- src/test/regress/expected/subselect.out | 17 +++++++++++++++++ src/test/regress/sql/subselect.sql | 16 ++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Set scan direction appropriately for SubPlans (bug #15336) @ 2018-08-17 15:31 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Andrew Gierth @ 2018-08-17 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Set scan direction appropriately for SubPlans (bug #15336) When executing a SubPlan in an expression, the EState's direction field was left alone, resulting in an attempt to execute the subplan backwards if it was encountered during a backwards scan of a cursor. Also, though much less likely, it was possible to reach the execution of an InitPlan while in backwards-scan state. Repair by saving/restoring estate->es_direction and forcing forward scan mode in the relevant places. Backpatch all the way, since this has been broken since 8.3 (prior to commit c7ff7663e, SubPlans had their own EStates rather than sharing the parent plan's, so there was no confusion over scan direction). Per bug #15336 reported by Vladimir Baranoff; analysis and patch by me, review by Tom Lane. Discussion: https://postgr.es/m/153449812167.1304.1741624125628126322@wrigleys.postgresql.org Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d2ecc27c374ad04b06fc62f365ff9445854153fd Modified Files -------------- src/backend/executor/nodeSubplan.c | 26 ++++++++++++++++++++++++-- src/test/regress/expected/subselect.out | 17 +++++++++++++++++ src/test/regress/sql/subselect.sql | 16 ++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Set scan direction appropriately for SubPlans (bug #15336) @ 2018-08-17 15:31 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Andrew Gierth @ 2018-08-17 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Set scan direction appropriately for SubPlans (bug #15336) When executing a SubPlan in an expression, the EState's direction field was left alone, resulting in an attempt to execute the subplan backwards if it was encountered during a backwards scan of a cursor. Also, though much less likely, it was possible to reach the execution of an InitPlan while in backwards-scan state. Repair by saving/restoring estate->es_direction and forcing forward scan mode in the relevant places. Backpatch all the way, since this has been broken since 8.3 (prior to commit c7ff7663e, SubPlans had their own EStates rather than sharing the parent plan's, so there was no confusion over scan direction). Per bug #15336 reported by Vladimir Baranoff; analysis and patch by me, review by Tom Lane. Discussion: https://postgr.es/m/153449812167.1304.1741624125628126322@wrigleys.postgresql.org Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6302fe6b28e24e87d78e457e85362dc2fa9ca119 Modified Files -------------- src/backend/executor/nodeSubplan.c | 26 ++++++++++++++++++++++++-- src/test/regress/expected/subselect.out | 17 +++++++++++++++++ src/test/regress/sql/subselect.sql | 16 ++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Set scan direction appropriately for SubPlans (bug #15336) @ 2018-08-17 15:31 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Andrew Gierth @ 2018-08-17 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Set scan direction appropriately for SubPlans (bug #15336) When executing a SubPlan in an expression, the EState's direction field was left alone, resulting in an attempt to execute the subplan backwards if it was encountered during a backwards scan of a cursor. Also, though much less likely, it was possible to reach the execution of an InitPlan while in backwards-scan state. Repair by saving/restoring estate->es_direction and forcing forward scan mode in the relevant places. Backpatch all the way, since this has been broken since 8.3 (prior to commit c7ff7663e, SubPlans had their own EStates rather than sharing the parent plan's, so there was no confusion over scan direction). Per bug #15336 reported by Vladimir Baranoff; analysis and patch by me, review by Tom Lane. Discussion: https://postgr.es/m/153449812167.1304.1741624125628126322@wrigleys.postgresql.org Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3cf3a65cb7da973dd761c6da579cdf7bceb38947 Modified Files -------------- src/backend/executor/nodeSubplan.c | 26 ++++++++++++++++++++++++-- src/test/regress/expected/subselect.out | 17 +++++++++++++++++ src/test/regress/sql/subselect.sql | 16 ++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Set scan direction appropriately for SubPlans (bug #15336) @ 2018-08-17 15:31 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Andrew Gierth @ 2018-08-17 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Set scan direction appropriately for SubPlans (bug #15336) When executing a SubPlan in an expression, the EState's direction field was left alone, resulting in an attempt to execute the subplan backwards if it was encountered during a backwards scan of a cursor. Also, though much less likely, it was possible to reach the execution of an InitPlan while in backwards-scan state. Repair by saving/restoring estate->es_direction and forcing forward scan mode in the relevant places. Backpatch all the way, since this has been broken since 8.3 (prior to commit c7ff7663e, SubPlans had their own EStates rather than sharing the parent plan's, so there was no confusion over scan direction). Per bug #15336 reported by Vladimir Baranoff; analysis and patch by me, review by Tom Lane. Discussion: https://postgr.es/m/153449812167.1304.1741624125628126322@wrigleys.postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/67b161eae32b0e900f74a2fe0b3f01667ca70850 Modified Files -------------- src/backend/executor/nodeSubplan.c | 26 ++++++++++++++++++++++++-- src/test/regress/expected/subselect.out | 17 +++++++++++++++++ src/test/regress/sql/subselect.sql | 16 ++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Set scan direction appropriately for SubPlans (bug #15336) @ 2018-08-17 15:31 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Andrew Gierth @ 2018-08-17 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Set scan direction appropriately for SubPlans (bug #15336) When executing a SubPlan in an expression, the EState's direction field was left alone, resulting in an attempt to execute the subplan backwards if it was encountered during a backwards scan of a cursor. Also, though much less likely, it was possible to reach the execution of an InitPlan while in backwards-scan state. Repair by saving/restoring estate->es_direction and forcing forward scan mode in the relevant places. Backpatch all the way, since this has been broken since 8.3 (prior to commit c7ff7663e, SubPlans had their own EStates rather than sharing the parent plan's, so there was no confusion over scan direction). Per bug #15336 reported by Vladimir Baranoff; analysis and patch by me, review by Tom Lane. Discussion: https://postgr.es/m/153449812167.1304.1741624125628126322@wrigleys.postgresql.org Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d31ebbff5b2bbe9dfe3fb130448581a4da388031 Modified Files -------------- src/backend/executor/nodeSubplan.c | 26 ++++++++++++++++++++++++-- src/test/regress/expected/subselect.out | 17 +++++++++++++++++ src/test/regress/sql/subselect.sql | 16 ++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Set scan direction appropriately for SubPlans (bug #15336) @ 2018-08-17 15:31 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Andrew Gierth @ 2018-08-17 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Set scan direction appropriately for SubPlans (bug #15336) When executing a SubPlan in an expression, the EState's direction field was left alone, resulting in an attempt to execute the subplan backwards if it was encountered during a backwards scan of a cursor. Also, though much less likely, it was possible to reach the execution of an InitPlan while in backwards-scan state. Repair by saving/restoring estate->es_direction and forcing forward scan mode in the relevant places. Backpatch all the way, since this has been broken since 8.3 (prior to commit c7ff7663e, SubPlans had their own EStates rather than sharing the parent plan's, so there was no confusion over scan direction). Per bug #15336 reported by Vladimir Baranoff; analysis and patch by me, review by Tom Lane. Discussion: https://postgr.es/m/153449812167.1304.1741624125628126322@wrigleys.postgresql.org Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/807c1c5550643379ac1b65aca55ce1aedb0c2902 Modified Files -------------- src/backend/executor/nodeSubplan.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-08-17 15:31 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-08-17 15:31 pgsql: Set scan direction appropriately for SubPlans (bug #15336) Andrew Gierth <rhodiumtoad@postgresql.org> 2018-08-17 15:31 pgsql: Set scan direction appropriately for SubPlans (bug #15336) Andrew Gierth <rhodiumtoad@postgresql.org> 2018-08-17 15:31 pgsql: Set scan direction appropriately for SubPlans (bug #15336) Andrew Gierth <rhodiumtoad@postgresql.org> 2018-08-17 15:31 pgsql: Set scan direction appropriately for SubPlans (bug #15336) Andrew Gierth <rhodiumtoad@postgresql.org> 2018-08-17 15:31 pgsql: Set scan direction appropriately for SubPlans (bug #15336) Andrew Gierth <rhodiumtoad@postgresql.org> 2018-08-17 15:31 pgsql: Set scan direction appropriately for SubPlans (bug #15336) Andrew Gierth <rhodiumtoad@postgresql.org> 2018-08-17 15:31 pgsql: Set scan direction appropriately for SubPlans (bug #15336) Andrew Gierth <rhodiumtoad@postgresql.org>
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