Re: [bug fix??] Fishy code in tts_cirtual_copyslot() - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [bug fix??] Fishy code in tts_cirtual_copyslot()
Date
Msg-id 20190924215744.wljemztwtn74vehs@alap3.anarazel.de
Whole thread Raw
In response to Re: [bug fix??] Fishy code in tts_cirtual_copyslot()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2019-09-22 14:24:36 -0400, Tom Lane wrote:
> "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com> writes:
> > In the following code in execTuples.c, shouldn' srcdesc point to the source slot's tuple descriptor?  The attached
fixpasses make check.  What kind of failure could this cause?
 
> 
> Yeah, sure looks like a typo to me too.

Indeed, thanks for catching and pushing.


> I temporarily changed the Assert to be "==" rather than "<=", and
> it still passed check-world, so evidently we are not testing any
> cases where the descriptors are of different lengths.  This explains
> the lack of symptoms.

I have a hard time seeing cases where it'd be a good idea to copy slots
of a smaller natts into a slot with larger natts. So i'm not too
surprised.


> It's still a bug though, so pushed.

Indeed.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Hypothetical indexes using BRIN broken since pg10
Next
From: Tom Lane
Date:
Subject: Re: allocation limit for encoding conversion