Re: tuplesort_gettuple_common() and *should_free argument

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: hlinnaka <hlinnaka(at)iki(dot)fi>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: tuplesort_gettuple_common() and *should_free argument
Date: 2016-12-12 17:31:31
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On Fri, Dec 9, 2016 at 5:59 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> Attached patch 0001-* removes all should_free arguments. To reiterate,
> this is purely a refactoring patch.

I think this patch might have a bug. In the existing code,
tuplesort_gettupleslot sets should_free = true if it isn't already
just before calling ExecStoreMinimalTuple((MinimalTuple) stup.tuple,
slot, should_free), so it seems that ExecStoreMinimalTuple() will
always get "true" as the fourth argument. However the patch changes
that line of code like this:

+ ExecStoreMinimalTuple((MinimalTuple) stup.tuple, slot, false);

So the patch seems to have the effect of changing the fourth argument
to this call to ExecStoreMinimalTuple() from always-true to
always-false. I might be missing something, but my guess is that's
not right.

Robert Haas
The Enterprise PostgreSQL Company

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2016-12-12 17:45:27 Re: exposing wait events for non-backends (was: Tracking wait event for latches)
Previous Message Andrew Borodin 2016-12-12 17:17:24 Re: pg_background contrib module proposal