Minor fixes for couple some comments around MERGE RETURNING

Started by David Rowleyover 2 years ago3 messageshackers
Jump to latest
#1David Rowley
dgrowleyml@gmail.com

I noticed that PlannedStmt.hasReturning and hasModifyingCTE have an
outdated comment now that MERGE supports RETURNING (per commit
c649fa24a)

i.e. these two:

bool hasReturning; /* is it insert|update|delete RETURNING? */

bool hasModifyingCTE; /* has insert|update|delete in WITH? */

transformWithClause() has:

/* must be a data-modifying statement */
Assert(IsA(cte->ctequery, InsertStmt) ||
IsA(cte->ctequery, UpdateStmt) ||
IsA(cte->ctequery, DeleteStmt) ||
IsA(cte->ctequery, MergeStmt));

pstate->p_hasModifyingCTE = true;

which eventually makes it into PlannedStmt.hasModifyingCTE.

The attached trivial patch fixes these.

David

Attachments:

merge_returning_comments.patchapplication/octet-stream; name=merge_returning_comments.patchDownload+2-2
#2David Rowley
dgrowleyml@gmail.com
In reply to: David Rowley (#1)
Re: Minor fixes for couple some comments around MERGE RETURNING

On Sun, 19 May 2024 at 15:20, David Rowley <dgrowleyml@gmail.com> wrote:

I noticed that PlannedStmt.hasReturning and hasModifyingCTE have an
outdated comment now that MERGE supports RETURNING (per commit
c649fa24a)

i.e. these two:

bool hasReturning; /* is it insert|update|delete RETURNING? */

bool hasModifyingCTE; /* has insert|update|delete in WITH? */

I've pushed the fix for that.

David

#3Dean Rasheed
dean.a.rasheed@gmail.com
In reply to: David Rowley (#2)
Re: Minor fixes for couple some comments around MERGE RETURNING

On Thu, 23 May 2024 at 04:26, David Rowley <dgrowleyml@gmail.com> wrote:

On Sun, 19 May 2024 at 15:20, David Rowley <dgrowleyml@gmail.com> wrote:

I noticed that PlannedStmt.hasReturning and hasModifyingCTE have an
outdated comment now that MERGE supports RETURNING (per commit
c649fa24a)

i.e. these two:

bool hasReturning; /* is it insert|update|delete RETURNING? */

bool hasModifyingCTE; /* has insert|update|delete in WITH? */

I've pushed the fix for that.

Thanks for taking care of that.

I found another couple of similar comments that also needed updating,
so I've pushed a fix for them too.

Regards,
Dean