Re: Missing free_var() at end of accum_sum_final()?

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "Dean Rasheed" <dean(dot)a(dot)rasheed(at)gmail(dot)com>, "Peter Eisentraut" <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: "Michael Paquier" <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org, "Andres Freund" <andres(at)anarazel(dot)de>
Subject: Re: Missing free_var() at end of accum_sum_final()?
Date: 2023-03-05 08:53:32
Message-ID: 85efda6a-f047-4c55-a7bc-a46b0926c6bb@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 3, 2023, at 16:11, Dean Rasheed wrote:
> Attachments:
> * make-result-using-vars-buf-v2.patch

One suggestion: maybe add a comment explaining why the allocated buffer
which size is based on strlen(cp) for the decimal digit values,
is guaranteed to be large enough also for the result's digit buffer?

I.e. some kind of proof why

(NUMERIC_HDRSZ + strlen(cp) + DEC_DIGITS * 2) >= ((ndigits + 1) * sizeof(NumericDigit)))

holds true in general.

/Joel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ankit Kumar Pandey 2023-03-05 11:00:30 [Question] Similar Cost but variable execution time in sort
Previous Message Gilles Darold 2023-03-05 08:03:33 Re: [Proposal] Allow pg_dump to include all child tables with the root table