RE: [PATCH] Tiny optmization or a bug?

2019-11-22 Thread Ranier Vilela
Para: Ranier Vilela Cc: pgsql-hack...@postgresql.org Assunto: Re: [PATCH] Tiny optmization or a bug? On Fri, Nov 22, 2019 at 11:06:53PM +, Ranier Vilela wrote: >Hi, >Hi, >Maybe this is a real bug. > >The assignment has no effect, or forget dereferencing it? > >Best re

Re: [PATCH] Tiny optmization or a bug?

2019-11-22 Thread Tomas Vondra
On Fri, Nov 22, 2019 at 11:06:53PM +, Ranier Vilela wrote: Hi, Hi, Maybe this is a real bug. The assignment has no effect, or forget dereferencing it? Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\optimizer\plan\initsplan.c Mon Sep 30 17:06:55 2019 +++ initsplan.c Fri N

Re: [PATCH] Tiny optmization.

2019-11-22 Thread Tomas Vondra
s. Ranier Vilela De: Tom Lane Enviado: sexta-feira, 22 de novembro de 2019 22:17 Para: Ranier Vilela Cc: pgsql-hack...@postgresql.org Assunto: Re: [PATCH] Tiny optmization. Ranier Vilela writes: Redudant because he it's been dereferenced here: line 3410: csta

RE: [PATCH] Tiny optmization.

2019-11-22 Thread Ranier Vilela
De: Tom Lane Enviado: sexta-feira, 22 de novembro de 2019 22:17 Para: Ranier Vilela Cc: pgsql-hack...@postgresql.org Assunto: Re: [PATCH] Tiny optmization. Ranier Vilela writes: > Redudant because he it's been dereferenced here: > line 3410: > cstate = BeginCopy(pstate,

Re: [PATCH] Tiny optmization.

2019-11-22 Thread Tomas Vondra
BeginCopy. BTW please don't top post, reply inline. It's much easier to follow the discussion. Best regards. Ranier Vilela De: Tomas Vondra Enviado: sexta-feira, 22 de novembro de 2019 22:05 Para: Ranier Vilela Cc: pgsql-hack...@postgresql.org

Re: [PATCH] Tiny optmization.

2019-11-22 Thread Tom Lane
Ranier Vilela writes: > Redudant because he it's been dereferenced here: > line 3410: > cstate = BeginCopy(pstate, true, rel, NULL, InvalidOid, attnamelist, > options); Not necessarily ... the rel!=NULL code path there doesn't touch pstate, and that seems to be what contrib/file_fdw is r

Re: [PATCH] Tiny optmization or is a bug?

2019-11-22 Thread Tomas Vondra
On Fri, Nov 22, 2019 at 09:51:50PM +, Ranier Vilela wrote: Hi, Maybe this is a real bug. The assignment has no effect, or forget dereferencing it? Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\lockcmds.c Mon Sep 30 17:06:55 2019 +++ lockcmds.c Fri Nov 22 18:45:0

RE: [PATCH] Tiny optmization.

2019-11-22 Thread Ranier Vilela
Para: Ranier Vilela Cc: pgsql-hack...@postgresql.org Assunto: Re: [PATCH] Tiny optmization. On Fri, Nov 22, 2019 at 09:41:44PM +, Ranier Vilela wrote: >Hi, >Maybe it doesn't matter, but, I think it's worth discussing. >The expression "if(pstate)" is redundant or i

Re: [PATCH] Tiny optmization.

2019-11-22 Thread Tomas Vondra
On Fri, Nov 22, 2019 at 09:41:44PM +, Ranier Vilela wrote: Hi, Maybe it doesn't matter, but, I think it's worth discussing. The expression "if(pstate)" is redundant or is possible null dereference. Eh? Redundant with what? Why would it be a null dereference? It's a parameter passed from ou