Get rid of the excess semicolon in planner.c

Started by Richard Guoalmost 2 years ago3 messages
#1Richard Guo
guofenglinux@gmail.com
1 attachment(s)

I think this is a typo introduced in 0452b461b.

+ root->processed_groupClause = list_copy(parse->groupClause);;

The extra empty statement is harmless in most times, but I still think
it would be better to get rid of it.

Attached is a trivial patch to do that.

Thanks
Richard

Attachments:

v1-0001-Get-rid-of-the-excess-semicolon-in-planner.c.patchapplication/octet-stream; name=v1-0001-Get-rid-of-the-excess-semicolon-in-planner.c.patchDownload
From a3f0c8a69509118a0f5d27eeb55614edfbc3213a Mon Sep 17 00:00:00 2001
From: Richard Guo <guofenglinux@gmail.com>
Date: Tue, 5 Mar 2024 19:38:34 +0800
Subject: [PATCH v1] Get rid of the excess semicolon in planner.c

---
 src/backend/optimizer/plan/planner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index ac97575453..443ab08d75 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -1418,7 +1418,7 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
 		else if (parse->groupClause)
 		{
 			/* Preprocess regular GROUP BY clause, if any */
-			root->processed_groupClause = list_copy(parse->groupClause);;
+			root->processed_groupClause = list_copy(parse->groupClause);
 			/* Remove any redundant GROUP BY columns */
 			remove_useless_groupby_columns(root);
 		}
-- 
2.31.0

#2David Rowley
dgrowleyml@gmail.com
In reply to: Richard Guo (#1)
Re: Get rid of the excess semicolon in planner.c

On Wed, 6 Mar 2024 at 00:43, Richard Guo <guofenglinux@gmail.com> wrote:

I think this is a typo introduced in 0452b461b.

+ root->processed_groupClause = list_copy(parse->groupClause);;

"git grep -E ";;$" -- *.c *.h" tell me it's the only one.

Pushed.

David

#3Richard Guo
guofenglinux@gmail.com
In reply to: David Rowley (#2)
Re: Get rid of the excess semicolon in planner.c

On Wed, Mar 6, 2024 at 6:00 AM David Rowley <dgrowleyml@gmail.com> wrote:

On Wed, 6 Mar 2024 at 00:43, Richard Guo <guofenglinux@gmail.com> wrote:

I think this is a typo introduced in 0452b461b.

+ root->processed_groupClause = list_copy(parse->groupClause);;

"git grep -E ";;$" -- *.c *.h" tell me it's the only one.

Pushed.

Thanks for checking and pushing.

Thanks
Richard