From: | Euler Taveira <euler(at)timbira(dot)com(dot)br> |
---|---|
To: | Roma Sokolov <sokolov(dot)r(dot)v(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Cc: | Женя Зайцев <zevlg(at)yandex(dot)ru> |
Subject: | Re: [PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator |
Date: | 2016-02-26 18:58:31 |
Message-ID: | 56D0A057.7070002@timbira.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 26-02-2016 12:46, Roma Sokolov wrote:
> Regression tests are added to check DROP OPERATOR behaves as intended (including
> case with self-commutator and unlikely case with operator being both negator and
> commutator).
>
I don't think those are mandatory.
> Should this patch be added to CommitFest?
>
Why not?
I didn't test your patch but
+ if (isDelete ? (t->oprcom == baseId || t->oprnegate == baseId)
+ : !OidIsValid(t->oprcom) || !OidIsValid(t->oprnegate))
... is hard to understand. Instead, you could separate the conditional
expression into a variable.
+ if (isDelete ? t->oprnegate == baseId : !OidIsValid(t->oprnegate))
It could be separate into a variable to be readable (or at least deserve
a comment).
(isDelete ? InvalidOid : ObjectIdGetDatum(baseId))
... and this one too. It is used in 4 places in that function.
--
Euler Taveira Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
From | Date | Subject | |
---|---|---|---|
Next Message | Ivan Kartyshov | 2016-02-26 19:04:12 | Re: [PATH] Correct negative/zero year in to_date/to_timestamp |
Previous Message | Alvaro Herrera | 2016-02-26 18:43:14 | Re: Re: In-core regression tests for replication, cascading, archiving, PITR, etc. |