Re: Bug in query rewriter - hasModifyingCTE not getting set - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in query rewriter - hasModifyingCTE not getting set
Date
Msg-id 336787.1612652601@sss.pgh.pa.us
Whole thread Raw
In response to Bug in query rewriter - hasModifyingCTE not getting set  (Greg Nancarrow <gregn4422@gmail.com>)
Responses Re: Bug in query rewriter - hasModifyingCTE not getting set
Re: Bug in query rewriter - hasModifyingCTE not getting set
RE: Bug in query rewriter - hasModifyingCTE not getting set
List pgsql-hackers
Greg Nancarrow <gregn4422@gmail.com> writes:
> I found a bug in the query rewriter. If a query that has a modifying
> CTE is re-written, the hasModifyingCTE flag is not getting set in the
> re-written query.

Ugh.

> I've attached the patch with the suggested fix (reviewed by Amit Langote).

I think either the bit about rule_action is unnecessary, or most of
the code immediately above this is wrong, because it's only updating
flags in sub_action.  Why do you think it's necessary to change
rule_action in addition to sub_action?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Nancarrow
Date:
Subject: Bug in query rewriter - hasModifyingCTE not getting set
Next
From: Tom Lane
Date:
Subject: Re: Bug in query rewriter - hasModifyingCTE not getting set