]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Back-patch fix for NULL condition in CASE.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 18 Sep 1999 23:30:05 +0000 (23:30 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 18 Sep 1999 23:30:05 +0000 (23:30 +0000)
src/backend/executor/execQual.c

index 58acc885ba2d8f91f3a44645c8176f54a9dbcd2b..5e2cc88c52bed9c7ef854db9a3a16b28fcb134b4 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.53 1999/06/12 19:22:40 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.53.2.1 1999/09/18 23:30:05 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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,