Re: Use outerPlanState macro instead of referring to leffttree

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use outerPlanState macro instead of referring to leffttree
Date: 2022-07-07 06:59:27
Message-ID: CAMbWs483RVxexNQxztX0=t_qEhnWbSTN3vXB9RnxoHiuFak_XQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 6, 2022 at 10:48 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Typically, if one applies outerPlan() or outerPlanState() to the
> wrong pointer, the mistake will become obvious upon even minimal
> testing. My concern here is more about usages in edge cases that
> perhaps escape testing, for instance in the arguments of an
> elog() for some nearly-can't-happen case.

Yeah, concur with that. For edge case usages maybe we can use the
local-variable style to avoid wrong-pointer mistakes.

Update the patch to include changes about righttree. But this doesn't
include changes for edge case usages. (A rough look through shows to me
that the current usages should be able to be covered by tests.)

Thanks
Richard

Attachment Content-Type Size
v2-0001-Use-outerPlanState-innerPlanState-macro.patch application/octet-stream 10.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message talk to ben 2022-07-07 07:08:39 Re: archive modules
Previous Message Pavel Stehule 2022-07-07 06:52:17 Re: Schema variables - new implementation for Postgres 15