Re: [PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Ranier Vilela
Em qui., 14 de mai. de 2020 às 19:49, Mark Dilger < mark.dil...@enterprisedb.com> escreveu: > > > > On May 14, 2020, at 11:34 AM, Ranier Vilela wrote: > > > > Certainly. > > In the same file you can find the appropriate use of the API. > > ItemPointerSet(&heapTuple->t_self, blkno, offnum); > > It

Re: [PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Ranier Vilela
Em qui., 14 de mai. de 2020 às 19:23, Mark Dilger < mark.dil...@enterprisedb.com> escreveu: > > > > On May 14, 2020, at 11:34 AM, Ranier Vilela wrote: > > > > htup->t_ctid = target_tid; > > htup->t_ctid = newtid; > > Both target_tid and newtid are local variable, whe loss scope, memory is > garba

Re: [PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Mark Dilger
> On May 14, 2020, at 11:34 AM, Ranier Vilela wrote: > > Certainly. > In the same file you can find the appropriate use of the API. > ItemPointerSet(&heapTuple->t_self, blkno, offnum); It took a couple reads through your patch to figure out what you were trying to accomplish, and I think you

Re: [PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Mark Dilger
> On May 14, 2020, at 11:34 AM, Ranier Vilela wrote: > > htup->t_ctid = target_tid; > htup->t_ctid = newtid; > Both target_tid and newtid are local variable, whe loss scope, memory is > garbage. Ok, thanks for the concrete example of what is bothering you. In htup_details, I see that struc

Re: [PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Ranier Vilela
Em qui., 14 de mai. de 2020 às 15:07, Tom Lane escreveu: > Ranier Vilela writes: > > The patch is primarily intended to correct the use of ItemPointerData. > > What do you think is being "corrected" here? It looks to me like > just some random code rearrangements that aren't even clearly > bug-

Re: [PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Ranier Vilela
Em qui., 14 de mai. de 2020 às 15:03, Mark Dilger < mark.dil...@enterprisedb.com> escreveu: > > > > On May 14, 2020, at 10:40 AM, Ranier Vilela wrote: > > > > Hi, > > ItemPointerData, on the contrary, from what the name says, > > it is not a pointer to a structure, but a structure in fact. > > Th

Re: [PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Tom Lane
Ranier Vilela writes: > The patch is primarily intended to correct the use of ItemPointerData. What do you think is being "corrected" here? It looks to me like just some random code rearrangements that aren't even clearly bug-free, let alone being stylistic improvements.

Re: [PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Mark Dilger
> On May 14, 2020, at 10:40 AM, Ranier Vilela wrote: > > Hi, > ItemPointerData, on the contrary, from what the name says, > it is not a pointer to a structure, but a structure in fact. The project frequently uses the pattern typedef struct FooData { ... } FooData; typedef FooData *

[PATCH] Fix ouside scope t_ctid (ItemPointerData)

2020-05-14 Thread Ranier Vilela
Hi, ItemPointerData, on the contrary, from what the name says, it is not a pointer to a structure, but a structure in fact. When assigning the name of the structure variable to a pointer, it may even work, but, it is not the right thing to do and it becomes a nightmare, to discover that any other e