diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c
index 15ba3ed94174efc95aab179e4eed002d20e562f5..196d347df43ef75eb1a28d1a34b78e1e4544c07a 100644
--- a/src/backend/executor/nodeGroup.c
+++ b/src/backend/executor/nodeGroup.c
@@ -13,7 +13,7 @@
  *	  columns. (ie. tuples from the same group are consecutive)
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.11 1997/10/27 12:00:43 vadim Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.12 1998/01/26 00:21:02 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -415,8 +415,11 @@ sameGroup(TupleTableSlot *oldslot,
 
 		if (isNull1 == isNull2)
 		{
-			if (isNull1)		/* both are null, they are equal */
-				continue;
+			/* both are null, they are _not_ equal since
+			 * NULL is not equal to NULL (or anything).
+			 *   --  25 Jan 1998  --  darrenk */
+			if (isNull1)
+				return FALSE;
 
 			val1 = fmgr(typoutput, attr1,
 						gettypelem(tupdesc->attrs[att - 1]->atttypid));