From: Tom Lane Date: Sat, 18 Sep 1999 23:30:05 +0000 (+0000) Subject: Back-patch fix for NULL condition in CASE. X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=9a7d8a20b66ef0808ba08f55dd10137cc877dc1a;p=users%2Fbernd%2Fpostgres.git Back-patch fix for NULL condition in CASE. --- diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c index 5f6787b7cb..2b8b47cc80 100644 --- a/src/backend/executor/execQual.c +++ b/src/backend/executor/execQual.c @@ -1128,9 +1128,10 @@ ExecEvalCase(CaseExpr *caseExpr, ExprContext *econtext, bool *isNull) /* * if we have a true test, then we return the result, since the - * case statement is satisfied. + * case statement is satisfied. A NULL result from the test is + * not considered true. */ - if (DatumGetInt32(const_value) != 0) + if (DatumGetInt32(const_value) != 0 && ! *isNull) { const_value = ExecEvalExpr((Node *) wclause->result, econtext,