Re: Violation of principle that plan trees are read-only

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Violation of principle that plan trees are read-only
Date: 2025-05-19 14:35:26
Message-ID: 405314.1747665326@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Sun, May 18, 2025 at 7:31 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> While chasing down Valgrind leakage reports, I was disturbed
>> to realize that some of them arise from a case where the
>> executor scribbles on the plan tree it's given, which it is
>> absolutely not supposed to do:

> Is there some way that we can detect violations of this rule
> automatically? I recall that we were recently discussing with Richard
> Guo a proposed patch that would have had a similar problem, so it's
> evidently not that hard for a committer to either fail to understand
> what the rule is or fail to realize that they are violating it.

I proposed a possible way to test for this at [1]. I was intending to
get around to that sooner or later, but the urgency of the matter just
went up in my eyes...

regards, tom lane

[1] https://www.postgresql.org/message-id/flat/2531459.1743871597%40sss.pgh.pa.us

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-05-19 14:39:51 Re: Violation of principle that plan trees are read-only
Previous Message David Steele 2025-05-19 14:31:24 Regression in statement locations