pgsql: Adjust constant-folding of CASE expressions so that the simple

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Adjust constant-folding of CASE expressions so that the simple
Date: 2005-02-02 21:49:52
Message-ID: 20050202214952.929B38B9D70@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Adjust constant-folding of CASE expressions so that the simple comparison
form of CASE (eg, CASE 0 WHEN 1 THEN ...) can be constant-folded as it
was in 7.4. Also, avoid constant-folding result expressions that are
certainly unreachable --- the former coding was a bit cavalier about this
and could generate unexpected results for all-constant CASE expressions.
Add regression test cases. Per report from Vlad Marchenko.

Tags:
----
REL8_0_STABLE

Modified Files:
--------------
pgsql/src/backend/optimizer/util:
clauses.c (r1.186.4.1 -> r1.186.4.2)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c.diff?r1=1.186.4.1&r2=1.186.4.2)
pgsql/src/test/regress/expected:
case.out (r1.8 -> r1.8.4.1)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/case.out.diff?r1=1.8&r2=1.8.4.1)
pgsql/src/test/regress/sql:
case.sql (r1.5 -> r1.5.4.1)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/case.sql.diff?r1=1.5&r2=1.5.4.1)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2005-02-02 22:40:05 pgsql: Improve performance of fmgr.c calling routines for cases with
Previous Message Tom Lane 2005-02-02 21:49:10 pgsql: Adjust constant-folding of CASE expressions so that the simple