pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix incorrect printing of queries with duplicated join names. 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix incorrect printing of queries with duplicated join names. @ 2019-06-12 23:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-06-12 23:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix incorrect printing of queries with duplicated join names. Given a query in which multiple JOIN nodes used the same alias (which'd necessarily be in different sub-SELECTs), ruleutils.c would assign the JOIN nodes distinct aliases for clarity ... but then it forgot to print the modified aliases when dumping the JOIN nodes themselves. This results in a dump/reload hazard for views, because the emitted query is flat-out incorrect: Vars will be printed with table names that have no referent. This has been wrong for a long time, so back-patch to all supported branches. Philip Dubé Discussion: https://postgr.es/m/CY4PR2101MB080246F2955FF58A6ED1FEAC98140@CY4PR2101MB0802.namprd21.prod.outlook.c... Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3d99a81397abb8bb7b95aee794d6644e174e174f Modified Files -------------- src/backend/utils/adt/ruleutils.c | 10 +++++++- src/test/regress/expected/create_view.out | 38 ++++++++++++++++++++++++++++++- src/test/regress/sql/create_view.sql | 9 ++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect printing of queries with duplicated join names. @ 2019-06-12 23:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-06-12 23:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix incorrect printing of queries with duplicated join names. Given a query in which multiple JOIN nodes used the same alias (which'd necessarily be in different sub-SELECTs), ruleutils.c would assign the JOIN nodes distinct aliases for clarity ... but then it forgot to print the modified aliases when dumping the JOIN nodes themselves. This results in a dump/reload hazard for views, because the emitted query is flat-out incorrect: Vars will be printed with table names that have no referent. This has been wrong for a long time, so back-patch to all supported branches. Philip Dubé Discussion: https://postgr.es/m/CY4PR2101MB080246F2955FF58A6ED1FEAC98140@CY4PR2101MB0802.namprd21.prod.outlook.c... Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f95d8f81062a7afa00fa034022724734a1ff5e60 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 10 ++++++++- src/test/regress/expected/create_view.out | 37 ++++++++++++++++++++++++++++++- src/test/regress/sql/create_view.sql | 9 ++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect printing of queries with duplicated join names. @ 2019-06-12 23:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-06-12 23:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix incorrect printing of queries with duplicated join names. Given a query in which multiple JOIN nodes used the same alias (which'd necessarily be in different sub-SELECTs), ruleutils.c would assign the JOIN nodes distinct aliases for clarity ... but then it forgot to print the modified aliases when dumping the JOIN nodes themselves. This results in a dump/reload hazard for views, because the emitted query is flat-out incorrect: Vars will be printed with table names that have no referent. This has been wrong for a long time, so back-patch to all supported branches. Philip Dubé Discussion: https://postgr.es/m/CY4PR2101MB080246F2955FF58A6ED1FEAC98140@CY4PR2101MB0802.namprd21.prod.outlook.c... Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/30d3df0a7b823d14c8bf43d949a122492b5d039c Modified Files -------------- src/backend/utils/adt/ruleutils.c | 10 ++++++++- src/test/regress/expected/create_view.out | 37 ++++++++++++++++++++++++++++++- src/test/regress/sql/create_view.sql | 9 ++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect printing of queries with duplicated join names. @ 2019-06-12 23:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-06-12 23:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix incorrect printing of queries with duplicated join names. Given a query in which multiple JOIN nodes used the same alias (which'd necessarily be in different sub-SELECTs), ruleutils.c would assign the JOIN nodes distinct aliases for clarity ... but then it forgot to print the modified aliases when dumping the JOIN nodes themselves. This results in a dump/reload hazard for views, because the emitted query is flat-out incorrect: Vars will be printed with table names that have no referent. This has been wrong for a long time, so back-patch to all supported branches. Philip Dubé Discussion: https://postgr.es/m/CY4PR2101MB080246F2955FF58A6ED1FEAC98140@CY4PR2101MB0802.namprd21.prod.outlook.c... Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ad3e61b2809e5fc0133ca5bc6dde7450f85a00c1 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 10 ++++++++- src/test/regress/expected/create_view.out | 35 +++++++++++++++++++++++++++++++ src/test/regress/sql/create_view.sql | 9 ++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect printing of queries with duplicated join names. @ 2019-06-12 23:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-06-12 23:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix incorrect printing of queries with duplicated join names. Given a query in which multiple JOIN nodes used the same alias (which'd necessarily be in different sub-SELECTs), ruleutils.c would assign the JOIN nodes distinct aliases for clarity ... but then it forgot to print the modified aliases when dumping the JOIN nodes themselves. This results in a dump/reload hazard for views, because the emitted query is flat-out incorrect: Vars will be printed with table names that have no referent. This has been wrong for a long time, so back-patch to all supported branches. Philip Dubé Discussion: https://postgr.es/m/CY4PR2101MB080246F2955FF58A6ED1FEAC98140@CY4PR2101MB0802.namprd21.prod.outlook.c... Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bf612fd3a4d8ff4953f400deccc3c8d1e411e935 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 10 ++++++++- src/test/regress/expected/create_view.out | 35 +++++++++++++++++++++++++++++++ src/test/regress/sql/create_view.sql | 9 ++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect printing of queries with duplicated join names. @ 2019-06-12 23:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-06-12 23:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix incorrect printing of queries with duplicated join names. Given a query in which multiple JOIN nodes used the same alias (which'd necessarily be in different sub-SELECTs), ruleutils.c would assign the JOIN nodes distinct aliases for clarity ... but then it forgot to print the modified aliases when dumping the JOIN nodes themselves. This results in a dump/reload hazard for views, because the emitted query is flat-out incorrect: Vars will be printed with table names that have no referent. This has been wrong for a long time, so back-patch to all supported branches. Philip Dubé Discussion: https://postgr.es/m/CY4PR2101MB080246F2955FF58A6ED1FEAC98140@CY4PR2101MB0802.namprd21.prod.outlook.c... Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8ace51a6b114208f079407d8e9d7020160c5cc2a Modified Files -------------- src/backend/utils/adt/ruleutils.c | 10 ++++++++- src/test/regress/expected/create_view.out | 35 +++++++++++++++++++++++++++++++ src/test/regress/sql/create_view.sql | 9 ++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-06-12 23:43 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-06-12 23:43 pgsql: Fix incorrect printing of queries with duplicated join names. Tom Lane <tgl@sss.pgh.pa.us> 2019-06-12 23:43 pgsql: Fix incorrect printing of queries with duplicated join names. Tom Lane <tgl@sss.pgh.pa.us> 2019-06-12 23:43 pgsql: Fix incorrect printing of queries with duplicated join names. Tom Lane <tgl@sss.pgh.pa.us> 2019-06-12 23:43 pgsql: Fix incorrect printing of queries with duplicated join names. Tom Lane <tgl@sss.pgh.pa.us> 2019-06-12 23:43 pgsql: Fix incorrect printing of queries with duplicated join names. Tom Lane <tgl@sss.pgh.pa.us> 2019-06-12 23:43 pgsql: Fix incorrect printing of queries with duplicated join names. 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