From 257b4d090c96e6ca9b1c8e42c516090d7e7c8503 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Mon, 7 Oct 1996 02:50:19 +0000
Subject: [PATCH] Change new assert so it generates assert message rather than
 SIGSEG.

---
 src/backend/executor/execQual.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index d172b3d9f01..734c62a147d 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.3 1996/10/05 20:31:38 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.4 1996/10/07 02:50:19 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -231,7 +231,12 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
     attnum =  	variable->varattno;
 
     /* (See prolog for explanation of this Assert) */
-    Assert(attnum <= 0 ||
+    Assert(attnum < 0 ||
+     	(tuple_type->attrs[attnum-1] != NULL &&
+         variable->vartype == tuple_type->attrs[attnum-1]->atttypid))
+    
+      /*
+       * If the attribute number is invalid, then we are supposed to
            variable->vartype == tuple_type->attrs[attnum-1]->atttypid)
     
     /*
-- 
GitLab