Re: subplan resets wrong hashtable

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org
Date: 2020-02-29T19:05:51Z
Lists: pgsql-hackers
I wrote:
> Right.  So the incorrect ResetTupleHashTable call is unreachable
> (and a look at the code coverage report confirms that).  The whole
> thing obviously is a bit hasty and unreviewed, but it doesn't have
> a live bug AFAICS ... or at least, if there's a bug, it's a memory
> leakage issue across repeat executions, not a crash hazard.

For the archives' sake: this *is* a memory leak, and we dealt with
it at 58c47ccfff20b8c125903482725c1dbfd30beade.

			regards, tom lane



Commits

  1. Correctly re-use hash tables in buildSubPlanHash().

  2. Reset, not recreate, execGrouping.c style hashtables.