Re: Misleading comment in tuplesort_set_bound

From: Alvaro Herrera from 2ndQuadrant <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: James Coleman <jtc331(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Misleading comment in tuplesort_set_bound
Date: 2019-09-05 20:56:57
Message-ID: 20190905205657.GA27458@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Aug-26, Tom Lane wrote:

> James Coleman <jtc331(at)gmail(dot)com> writes:

> I think the comment is fine as-is. Perhaps the code would be clearer
> though, if we merged those two asserts into one?
>
> /* Assert we're called before loading any tuples */
> Assert(state->status == TSS_INITIAL &&
> state->memtupcount == 0);

Makes sense to me. James, do you want to submit a new patch?

> I'm not totally sure about the usefulness/relevance of the two
> assertions following these, but they could likely do with their
> own comment(s), because this one surely isn't covering them.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Coleman 2019-09-05 21:10:19 Re: Misleading comment in tuplesort_set_bound
Previous Message Tom Lane 2019-09-05 20:56:40 Re: [Patch] Invalid permission check in pg_stats for functional indexes