minor nodeHash cleanup - Mailing list pgsql-patches

From Neil Conway
Subject minor nodeHash cleanup
Date
Msg-id 424AAF43.2080803@samurai.com
Whole thread Raw
Responses Re: minor nodeHash cleanup  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
ExecHash() currently returns a null TupleTableSlot, and a misleading
comment from 1991 claims there is a good reason for this. AFAICS there
isn't and the return value isn't used, so I've changed it to return NULL.

Barring any objections I'll apply this tomorrow.

-Neil
Index: src/backend/executor/nodeHash.c
===================================================================
RCS file: /Users/neilc/local/cvs/pgsql/src/backend/executor/nodeHash.c,v
retrieving revision 1.91
diff -c -r1.91 nodeHash.c
*** src/backend/executor/nodeHash.c    16 Mar 2005 21:38:07 -0000    1.91
--- src/backend/executor/nodeHash.c    30 Mar 2005 12:57:07 -0000
***************
*** 54,60 ****
       * get state info from node
       */
      outerNode = outerPlanState(node);
-
      hashtable = node->hashtable;

      /*
--- 54,59 ----
***************
*** 78,88 ****
          ExecHashTableInsert(hashtable, ExecFetchSlotTuple(slot), hashvalue);
      }

!     /*
!      * Return the slot so that we have the tuple descriptor when we need
!      * to save/restore them.  -Jeff 11 July 1991  (XXX isn't this dead code?)
!      */
!     return slot;
  }

  /* ----------------------------------------------------------------
--- 77,84 ----
          ExecHashTableInsert(hashtable, ExecFetchSlotTuple(slot), hashvalue);
      }

!     /* We needn't return a tuple slot or anything else */
!     return NULL;
  }

  /* ----------------------------------------------------------------
Index: src/backend/executor/nodeHashjoin.c
===================================================================
RCS file: /Users/neilc/local/cvs/pgsql/src/backend/executor/nodeHashjoin.c,v
retrieving revision 1.69
diff -c -r1.69 nodeHashjoin.c
*** src/backend/executor/nodeHashjoin.c    16 Mar 2005 21:38:07 -0000    1.69
--- src/backend/executor/nodeHashjoin.c    30 Mar 2005 11:17:36 -0000
***************
*** 97,104 ****
       * outer tuple; so we can stop scanning the inner scan if we matched
       * on the previous try.
       */
!     if (node->js.jointype == JOIN_IN &&
!         node->hj_MatchedOuter)
          node->hj_NeedNewOuter = true;

      /*
--- 97,103 ----
       * outer tuple; so we can stop scanning the inner scan if we matched
       * on the previous try.
       */
!     if (node->js.jointype == JOIN_IN && node->hj_MatchedOuter)
          node->hj_NeedNewOuter = true;

      /*

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [BUGS] BUG #1563: wrong week returnded by date_trunc('week',
Next
From: Alvaro Herrera
Date:
Subject: Re: unused variable ShmemBootstrap