Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Geier <david(at)swarm64(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault
Date: 2021-01-18 21:09:20
Message-ID: CALNJ-vQoKAtKsbKFHDgvAo5o+EGv7yGFiUjzY4sLA+imkzfJ+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Tom:
I was thinking that, if sstate->ss_currentRelation is null for the other
cases, that would be a bug.
An assertion can be added for the cases ending with T_TidScanState.
Though, the null sstate->ss_currentRelation would surface immediately
(apart from assertion). So I omitted the assertion in the diff.

Cheers

On Mon, Jan 18, 2021 at 12:16 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Zhihong Yu <zyu(at)yugabyte(dot)com> writes:
> > It seems sstate->ss_currentRelation being null can only
> > occur for T_ForeignScanState and T_CustomScanState.
> > What about the following change ?
>
> Seems like more code for no very good reason.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Victor Yegorov 2021-01-18 21:10:08 Re: Deleting older versions in unique indexes to avoid page splits
Previous Message Tom Lane 2021-01-18 20:58:35 Re: Narrow the scope of the variable outputstr in logicalrep_write_tuple