Adjust constant-folding of CASE expressions so that the simple comparison

Tom Lane <tgl@sss.pgh.pa.us>

Commit: fffb5819ca9a48610c4a6f7ef45269ef2e506712
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2005-02-02T21:49:09Z
Releases: 8.1.0
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.

Files