pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use lfirst_int in cmp_list_len_contents_asc
Date: Fri, 19 Mar 2021 23:06:36 +0000
Message-ID: <E1lNOCS-0000wd-7c@gemulon.postgresql.org> (raw)

Use lfirst_int in cmp_list_len_contents_asc

The function added in be45be9c33 is comparing integer lists (IntList) by
length and contents, but there were two bugs.  Firstly, it used intVal()
to extract the value, but that's for Value nodes, not for extracting int
values from IntList.  Secondly, it called it directly on the ListCell,
without doing lfirst().  So just do lfirst_int() instead.

Interestingly enough, this did not cause any crashes on the buildfarm,
but valgrind rightfully complained about it.

Discussion: https://postgr.es/m/bf3805a8-d7d1-ae61-fece-761b7ff41ecc@postgresfriends.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b822ae13ea93c18326d58d47829bbc66d36fae5c

Modified Files
--------------
src/backend/parser/parse_agg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



Message-ID: <E1lNOCS-0000wd-7c@gemulon.postgresql.org>
Permalink:  ../E1lNOCS-0000wd-7c@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lNOCS-0000wd-7c@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Use lfirst_int in cmp_list_len_contents_asc
  In-Reply-To: <E1lNOCS-0000wd-7c@gemulon.postgresql.org>
  References: <E1lNOCS-0000wd-7c@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox