Re: pgsql: Remove unreachable code in expression evaluation.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Remove unreachable code in expression evaluation.
Date: 2017-03-26 04:14:30
Message-ID: 24361.1490501670@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Andres Freund <andres(at)anarazel(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-03-26 04:25:27 Re: pgsql: Remove unreachable code in expression evaluation.
Previous Message Andres Freund 2017-03-26 03:56:34 pgsql: Blindly attempt to fix sepgsql tests #2.