pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Correctly update hasSubLinks while mutating a rule action. 6+ messages / 1 participants [nested] [flat]
* pgsql: Correctly update hasSubLinks while mutating a rule action. @ 2023-06-13 19:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-06-13 19:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly update hasSubLinks while mutating a rule action. rewriteRuleAction neglected to check for SubLink nodes in the securityQuals of range table entries. This could lead to failing to convert such a SubLink to a SubPlan, resulting in assertion crashes or weird errors later in planning. In passing, fix some poor coding in rewriteTargetView: we should not pass the source parsetree's hasSubLinks field to ReplaceVarsFromTargetList's outer_hasSubLinks. ReplaceVarsFromTargetList knows enough to ignore that when a Query node is passed, but it's still confusing and bad precedent: if we did try to update that flag we'd be updating a stale copy of the parsetree. Per bug #17972 from Alexander Lakhin. This has been broken since we added RangeTblEntry.securityQuals (although the presented test case only fails back to 215b43cdc), so back-patch all the way. Discussion: https://postgr.es/m/17972-f422c094237847d0@postgresql.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cc6974df16e0dfb106c4caefd9d42d332a04247d Modified Files -------------- src/backend/rewrite/rewriteHandler.c | 4 +++- src/test/regress/expected/updatable_views.out | 32 +++++++++++++++++++++++++++ src/test/regress/sql/updatable_views.sql | 17 ++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Correctly update hasSubLinks while mutating a rule action. @ 2023-06-13 19:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-06-13 19:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly update hasSubLinks while mutating a rule action. rewriteRuleAction neglected to check for SubLink nodes in the securityQuals of range table entries. This could lead to failing to convert such a SubLink to a SubPlan, resulting in assertion crashes or weird errors later in planning. In passing, fix some poor coding in rewriteTargetView: we should not pass the source parsetree's hasSubLinks field to ReplaceVarsFromTargetList's outer_hasSubLinks. ReplaceVarsFromTargetList knows enough to ignore that when a Query node is passed, but it's still confusing and bad precedent: if we did try to update that flag we'd be updating a stale copy of the parsetree. Per bug #17972 from Alexander Lakhin. This has been broken since we added RangeTblEntry.securityQuals (although the presented test case only fails back to 215b43cdc), so back-patch all the way. Discussion: https://postgr.es/m/17972-f422c094237847d0@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/792213f2e9f6d321d5a463f4a0fc263c2b770ac3 Modified Files -------------- src/backend/rewrite/rewriteHandler.c | 4 +++- src/test/regress/expected/updatable_views.out | 32 +++++++++++++++++++++++++++ src/test/regress/sql/updatable_views.sql | 17 ++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Correctly update hasSubLinks while mutating a rule action. @ 2023-06-13 19:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-06-13 19:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly update hasSubLinks while mutating a rule action. rewriteRuleAction neglected to check for SubLink nodes in the securityQuals of range table entries. This could lead to failing to convert such a SubLink to a SubPlan, resulting in assertion crashes or weird errors later in planning. In passing, fix some poor coding in rewriteTargetView: we should not pass the source parsetree's hasSubLinks field to ReplaceVarsFromTargetList's outer_hasSubLinks. ReplaceVarsFromTargetList knows enough to ignore that when a Query node is passed, but it's still confusing and bad precedent: if we did try to update that flag we'd be updating a stale copy of the parsetree. Per bug #17972 from Alexander Lakhin. This has been broken since we added RangeTblEntry.securityQuals (although the presented test case only fails back to 215b43cdc), so back-patch all the way. Discussion: https://postgr.es/m/17972-f422c094237847d0@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d1423c52e3f00a7d00c4e3517fab0ed9b9330e3a Modified Files -------------- src/backend/rewrite/rewriteHandler.c | 4 +++- src/test/regress/expected/updatable_views.out | 32 +++++++++++++++++++++++++++ src/test/regress/sql/updatable_views.sql | 17 ++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Correctly update hasSubLinks while mutating a rule action. @ 2023-06-13 19:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-06-13 19:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly update hasSubLinks while mutating a rule action. rewriteRuleAction neglected to check for SubLink nodes in the securityQuals of range table entries. This could lead to failing to convert such a SubLink to a SubPlan, resulting in assertion crashes or weird errors later in planning. In passing, fix some poor coding in rewriteTargetView: we should not pass the source parsetree's hasSubLinks field to ReplaceVarsFromTargetList's outer_hasSubLinks. ReplaceVarsFromTargetList knows enough to ignore that when a Query node is passed, but it's still confusing and bad precedent: if we did try to update that flag we'd be updating a stale copy of the parsetree. Per bug #17972 from Alexander Lakhin. This has been broken since we added RangeTblEntry.securityQuals (although the presented test case only fails back to 215b43cdc), so back-patch all the way. Discussion: https://postgr.es/m/17972-f422c094237847d0@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a36d0014f11fd0687f6adf7451f63550290a1de2 Modified Files -------------- src/backend/rewrite/rewriteHandler.c | 4 +++- src/test/regress/expected/updatable_views.out | 32 +++++++++++++++++++++++++++ src/test/regress/sql/updatable_views.sql | 17 ++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Correctly update hasSubLinks while mutating a rule action. @ 2023-06-13 19:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-06-13 19:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly update hasSubLinks while mutating a rule action. rewriteRuleAction neglected to check for SubLink nodes in the securityQuals of range table entries. This could lead to failing to convert such a SubLink to a SubPlan, resulting in assertion crashes or weird errors later in planning. In passing, fix some poor coding in rewriteTargetView: we should not pass the source parsetree's hasSubLinks field to ReplaceVarsFromTargetList's outer_hasSubLinks. ReplaceVarsFromTargetList knows enough to ignore that when a Query node is passed, but it's still confusing and bad precedent: if we did try to update that flag we'd be updating a stale copy of the parsetree. Per bug #17972 from Alexander Lakhin. This has been broken since we added RangeTblEntry.securityQuals (although the presented test case only fails back to 215b43cdc), so back-patch all the way. Discussion: https://postgr.es/m/17972-f422c094237847d0@postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/13192a324ad817390eccbb66bc5626780ae9d657 Modified Files -------------- src/backend/rewrite/rewriteHandler.c | 4 +++- src/test/regress/expected/updatable_views.out | 32 +++++++++++++++++++++++++++ src/test/regress/sql/updatable_views.sql | 17 ++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Correctly update hasSubLinks while mutating a rule action. @ 2023-06-13 19:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-06-13 19:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly update hasSubLinks while mutating a rule action. rewriteRuleAction neglected to check for SubLink nodes in the securityQuals of range table entries. This could lead to failing to convert such a SubLink to a SubPlan, resulting in assertion crashes or weird errors later in planning. In passing, fix some poor coding in rewriteTargetView: we should not pass the source parsetree's hasSubLinks field to ReplaceVarsFromTargetList's outer_hasSubLinks. ReplaceVarsFromTargetList knows enough to ignore that when a Query node is passed, but it's still confusing and bad precedent: if we did try to update that flag we'd be updating a stale copy of the parsetree. Per bug #17972 from Alexander Lakhin. This has been broken since we added RangeTblEntry.securityQuals (although the presented test case only fails back to 215b43cdc), so back-patch all the way. Discussion: https://postgr.es/m/17972-f422c094237847d0@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b4110bdbfe9d3cede772e1f37f9a7467e63e158b Modified Files -------------- src/backend/rewrite/rewriteHandler.c | 4 +++- src/test/regress/expected/updatable_views.out | 32 +++++++++++++++++++++++++++ src/test/regress/sql/updatable_views.sql | 17 ++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2023-06-13 19:59 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-06-13 19:59 pgsql: Correctly update hasSubLinks while mutating a rule action. Tom Lane <tgl@sss.pgh.pa.us> 2023-06-13 19:59 pgsql: Correctly update hasSubLinks while mutating a rule action. Tom Lane <tgl@sss.pgh.pa.us> 2023-06-13 19:59 pgsql: Correctly update hasSubLinks while mutating a rule action. Tom Lane <tgl@sss.pgh.pa.us> 2023-06-13 19:59 pgsql: Correctly update hasSubLinks while mutating a rule action. Tom Lane <tgl@sss.pgh.pa.us> 2023-06-13 19:59 pgsql: Correctly update hasSubLinks while mutating a rule action. Tom Lane <tgl@sss.pgh.pa.us> 2023-06-13 19:59 pgsql: Correctly update hasSubLinks while mutating a rule action. 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