From: | Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Zhihong Yu <zyu(at)yugabyte(dot)com>, simon(dot)riggs(at)enterprisedb(dot)co, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Daniel Westermann <dwe(at)dbi-services(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: support for MERGE |
Date: | 2022-04-12 14:19:00 |
Message-ID: | CAEudQAoatJsO8Nf4aPMcijJrqfL=Roeqspj5Mr3_Ps_pcqN==Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Em ter., 12 de abr. de 2022 às 10:47, Alvaro Herrera <
alvherre(at)alvh(dot)no-ip(dot)org> escreveu:
> On 2022-Apr-02, Ranier Vilela wrote:
>
> > Em sáb., 2 de abr. de 2022 às 12:01, Alvaro Herrera <
> alvherre(at)alvh(dot)no-ip(dot)org>
> > escreveu:
>
> > IMHO, actually there are bug here.
> > ExecGetChildToRootMap is clear, is possible returning NULL.
> > To discover if the map is NULL, ExecGetChildToRootMap needs to process
> > "ResultRelInfo *leaf_part_rri".
> > So, the argument "if the map is NULL, this function should not be
> called",
> > is contradictory.
>
> I was not explicit enough. I meant "if no map is needed to adjust
> columns, then this function should not be called". The caller already
> knows if it's needed or not; it doesn't depend on literally testing
> 'map'. If somebody mis-calls this function, it would have crashed, yes;
> but that's a caller bug, not this function's.
>
Thanks for the explanation.
>
> A few days ago, the community Coverity also complained about this, so I
> added an Assert that the map is not null, which should silence it.
>
Thanks for hardening this.
>
> > If the right fix is to return the original list, here is the patch
> attached.
>
> ... for a buggy caller (one that calls it when unnecessary), then yes
> this would be the correct code -- except that now the caller doesn't
> know if the returned list needs to be freed or not. So it seems better
> to avoid accumulating pointless calls to this function by just not
> coping with them.
>
Sure, it is always better to avoid doing work, unless strictly necessary.
regards,
Ranier Vilela
From | Date | Subject | |
---|---|---|---|
Next Message | Matthias van de Meent | 2022-04-12 15:00:24 | Re: Temporary file access API |
Previous Message | Euler Taveira | 2022-04-12 14:07:27 | Re: PG DOCS - logical replication filtering |