Fix grammar oddities in comments

Started by James Colemanover 1 year ago4 messages
#1James Coleman
jtc331@gmail.com
1 attachment(s)

Hi,

See attached for a small patch fixing some typos and grammatical
errors in a couple of comments.

Side note: It's not clear to me what "Vars of higher levels don't
matter here" means in this context (or how that claim is justified),
but I haven't changed that part of the comment opting to simply
resolve the clear mistakes in the wording here.

Regards,
James Coleman

Attachments:

v1-0001-Fix-comment-grammar-oddities.patchapplication/octet-stream; name=v1-0001-Fix-comment-grammar-oddities.patchDownload
From f4b53414b9ff3ba854c06a5813bb38a10e4f2f26 Mon Sep 17 00:00:00 2001
From: jcoleman <jtc331@gmail.com>
Date: Sat, 1 Jun 2024 11:22:27 -0700
Subject: [PATCH v1] Fix comment grammar oddities

---
 src/backend/optimizer/plan/subselect.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c
index e35ebea8b4..846081dc73 100644
--- a/src/backend/optimizer/plan/subselect.c
+++ b/src/backend/optimizer/plan/subselect.c
@@ -1271,15 +1271,15 @@ convert_ANY_sublink_to_join(PlannerInfo *root, SubLink *sublink,
 	Assert(sublink->subLinkType == ANY_SUBLINK);
 
 	/*
-	 * If the sub-select refers to any Vars of the parent query, we so let's
-	 * considering it as LATERAL.  (Vars of higher levels don't matter here.)
+	 * If the sub-select refers to any Vars of the parent query, we treat it
+	 * as LATERAL.  (Vars of higher levels don't matter here.)
 	 */
 	sub_ref_outer_relids = pull_varnos_of_level(NULL, (Node *) subselect, 1);
 	use_lateral = !bms_is_empty(sub_ref_outer_relids);
 
 	/*
-	 * Check that sub-select refers nothing outside of available_rels of the
-	 * parent query.
+	 * The sub-select can't refer to any rels beyond what the parent query
+	 * makes available.
 	 */
 	if (!bms_is_subset(sub_ref_outer_relids, available_rels))
 		return NULL;
-- 
2.39.3 (Apple Git-146)

#2David Rowley
dgrowleyml@gmail.com
In reply to: James Coleman (#1)
Re: Fix grammar oddities in comments

On Sun, 2 Jun 2024 at 10:08, James Coleman <jtc331@gmail.com> wrote:

See attached for a small patch fixing some typos and grammatical
errors in a couple of comments.

Thanks. I pushed this after messing with the comments a bit more.

Side note: It's not clear to me what "Vars of higher levels don't
matter here" means in this context (or how that claim is justified),
but I haven't changed that part of the comment opting to simply
resolve the clear mistakes in the wording here.

It just means Vars with varlevelsup >= 2 don't matter. It only cares
about Vars with varlevelsup==1, i.e. Vars of the sub-query's direct
parent.

David

#3Aaron Altman
aaronaltman@posteo.net
In reply to: David Rowley (#2)
Re: Fix grammar oddities in comments

The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: not tested
Spec compliant: not tested
Documentation: not tested

Confirming linguistic correctness of changes, and lack of anything changed outside of comments that would otherwise affect readiness to commit.

The new status of this patch is: Ready for Committer

#4James Coleman
jtc331@gmail.com
In reply to: David Rowley (#2)
Re: Fix grammar oddities in comments

On Wed, Jun 5, 2024 at 5:34 AM David Rowley <dgrowleyml@gmail.com> wrote:

On Sun, 2 Jun 2024 at 10:08, James Coleman <jtc331@gmail.com> wrote:

See attached for a small patch fixing some typos and grammatical
errors in a couple of comments.

Thanks. I pushed this after messing with the comments a bit more.

Thanks!

Side note: It's not clear to me what "Vars of higher levels don't
matter here" means in this context (or how that claim is justified),
but I haven't changed that part of the comment opting to simply
resolve the clear mistakes in the wording here.

It just means Vars with varlevelsup >= 2 don't matter. It only cares
about Vars with varlevelsup==1, i.e. Vars of the sub-query's direct
parent.

Yes, I understood the content, but I didn't see any justification
provided, which is what I'd hope for in a comment like this (why not
simply what).

Anyway, thanks again for reviewing and committing.

James Coleman