From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prevent bogus pullup of constant-valued functions returning comp
Date: Tue, 24 Sep 2019 16:11:39 +0000
Message-ID: <E1iCnPf-0004wo-Lm@gemulon.postgresql.org> (raw)
Prevent bogus pullup of constant-valued functions returning composite.
Fix an oversight in commit 7266d0997: as it stood, the code failed
when a function-in-FROM returns composite and can be simplified
to a composite constant.
For the moment, just test for composite result and abandon pullup
if we see one. To make it actually work, we'd have to decompose
the composite constant into per-column constants; which is surely
do-able, but I'm not convinced it's worth the code space.
Per report from Raúl Marín Rodríguez.
Discussion: https://postgr.es/m/CAM6_UM4isP+buRA5sWodO_MUEgutms-KDfnkwGmryc5DGj9XuQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a9ae99d0190960ce2d3dd3e5f10e7f4adc3cf203
Modified Files
--------------
src/backend/optimizer/prep/prepjointree.c | 18 +++++++++++++++
src/test/regress/expected/join.out | 37 +++++++++++++++++++++++++++++++
src/test/regress/sql/join.sql | 19 ++++++++++++++++
3 files changed, 74 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Prevent bogus pullup of constant-valued functions returning comp
In-Reply-To: <E1iCnPf-0004wo-Lm@gemulon.postgresql.org>
References: <E1iCnPf-0004wo-Lm@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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