pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix UNION/INTERSECT/EXCEPT over no columns. 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix UNION/INTERSECT/EXCEPT over no columns. @ 2017-12-22 17:08 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2017-12-22 17:08 UTC (permalink / raw) To: pgsql-committers Fix UNION/INTERSECT/EXCEPT over no columns. Since 9.4, we've allowed the syntax "select union select" and variants of that. However, the planner wasn't expecting a no-column set operation and ended up treating the set operation as if it were UNION ALL. Turns out it's trivial to fix in v10 and later; we just need to be careful about not generating a Sort node with no sort keys. However, since a weird corner case like this is never going to be exercised by developers, we'd better have thorough regression tests if we want to consider it supported. Per report from Victor Yegorov. Discussion: https://postgr.es/m/CAGnEbojGJrRSOgJwNGM7JSJZpVAf8xXcVPbVrGdhbVEHZ-BUMw@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c4c2885cbb1803f772e58f6db4c8951d8cd672cd Modified Files -------------- src/backend/optimizer/plan/createplan.c | 1 - src/backend/optimizer/prep/prepunion.c | 26 +++----- src/test/regress/expected/union.out | 115 ++++++++++++++++++++++++++++++++ src/test/regress/sql/union.sql | 43 ++++++++++++ 4 files changed, 168 insertions(+), 17 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix UNION/INTERSECT/EXCEPT over no columns. @ 2017-12-22 17:08 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2017-12-22 17:08 UTC (permalink / raw) To: pgsql-committers Fix UNION/INTERSECT/EXCEPT over no columns. Since 9.4, we've allowed the syntax "select union select" and variants of that. However, the planner wasn't expecting a no-column set operation and ended up treating the set operation as if it were UNION ALL. Turns out it's trivial to fix in v10 and later; we just need to be careful about not generating a Sort node with no sort keys. However, since a weird corner case like this is never going to be exercised by developers, we'd better have thorough regression tests if we want to consider it supported. Per report from Victor Yegorov. Discussion: https://postgr.es/m/CAGnEbojGJrRSOgJwNGM7JSJZpVAf8xXcVPbVrGdhbVEHZ-BUMw@mail.gmail.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c252ccda74295ad292c407a361c9d55ca0554e00 Modified Files -------------- src/backend/optimizer/plan/createplan.c | 1 - src/backend/optimizer/prep/prepunion.c | 26 +++----- src/test/regress/expected/union.out | 115 ++++++++++++++++++++++++++++++++ src/test/regress/sql/union.sql | 43 ++++++++++++ 4 files changed, 168 insertions(+), 17 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2017-12-22 17:08 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-12-22 17:08 pgsql: Fix UNION/INTERSECT/EXCEPT over no columns. Tom Lane <tgl@sss.pgh.pa.us> 2017-12-22 17:08 pgsql: Fix UNION/INTERSECT/EXCEPT over no columns. 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