From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Remove unreachable code in expression evaluation.
Date: Sat, 25 Mar 2017 21:25:27 -0700
Message-ID: <20170326042527.mdxsoht5a4actlzz@alap3.anarazel.de> (raw)
In-Reply-To: <24361.1490501670@sss.pgh.pa.us>
References: <E1cruiP-0003ak-Q0@gemulon.postgresql.org>
<24361.1490501670@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
On 2017-03-26 00:14:30 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Remove unreachable code in expression evaluation.
> > The previous code still contained expression evaluation time support
> > for CaseExprs without a defresult. But transformCaseExpr() creates a
> > default expression if necessary.
>
> BTW, now that I think about it, I wonder if a better answer wouldn't
> be to leave the execExpr code as it stood, and remove the code in
> transformCaseExpr that pre-creates a default expression. You'd end
> up with identical code at runtime, and eliminate some parse/rewrite/plan
> overhead for dealing with that subexpression.
>
> It's possible there's some code somewhere else that expects defresult
> to always be non-null, but I can't think what, or why that would be
> a good thing to assume.
There's some relationship with the type inferrence code in
transformCaseExpr(). I don't think it'd be hard to change, however -
just move resultexprs = lcons(newc->defresult, resultexprs); into the
else branch of if defresult == NULL.
- Andres
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: andres@anarazel.de, tgl@sss.pgh.pa.us
Subject: Re: pgsql: Remove unreachable code in expression evaluation.
In-Reply-To: <20170326042527.mdxsoht5a4actlzz@alap3.anarazel.de>
References: <E1cruiP-0003ak-Q0@gemulon.postgresql.org> <24361.1490501670@sss.pgh.pa.us> <20170326042527.mdxsoht5a4actlzz@alap3.anarazel.de>
* 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