Minor comment update in setrefs.c

Started by Etsuro Fujitaabout 10 years ago4 messages
#1Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp
1 attachment(s)

Hi,

Attached is a small patch to adjust a comment in setrefs.c; in
set_foreignscan_references, fdw_recheck_quals also gets adjusted to
reference foreign scan tuple, in case of a foreign join, so I added
"etc.", to a comment there, as the comment in case of a simple foreign
table scan.

Best regards,
Etsuro Fujita

Attachments:

setrefs-comment.patchapplication/x-patch; name=setrefs-comment.patchDownload
*** a/src/backend/optimizer/plan/setrefs.c
--- b/src/backend/optimizer/plan/setrefs.c
***************
*** 1108,1114 **** set_foreignscan_references(PlannerInfo *root,
  
  	if (fscan->fdw_scan_tlist != NIL || fscan->scan.scanrelid == 0)
  	{
! 		/* Adjust tlist, qual, fdw_exprs to reference foreign scan tuple */
  		indexed_tlist *itlist = build_tlist_index(fscan->fdw_scan_tlist);
  
  		fscan->scan.plan.targetlist = (List *)
--- 1108,1117 ----
  
  	if (fscan->fdw_scan_tlist != NIL || fscan->scan.scanrelid == 0)
  	{
! 		/*
! 		 * Adjust tlist, qual, fdw_exprs, etc. to reference foreign scan
! 		 * tuple
! 		 */
  		indexed_tlist *itlist = build_tlist_index(fscan->fdw_scan_tlist);
  
  		fscan->scan.plan.targetlist = (List *)
#2Robert Haas
robertmhaas@gmail.com
In reply to: Etsuro Fujita (#1)
Re: Minor comment update in setrefs.c

On Tue, Dec 8, 2015 at 6:16 AM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp> wrote:

Attached is a small patch to adjust a comment in setrefs.c; in
set_foreignscan_references, fdw_recheck_quals also gets adjusted to
reference foreign scan tuple, in case of a foreign join, so I added
"etc.", to a comment there, as the comment in case of a simple foreign
table scan.

Doesn't apply any more. I suppose we could sync up the similar
comments in set_customscan_references() too. But to be honest I'm not
sure this is adding any clarity. "etc." may not be the least
informative thing you can put in a comment, but it's pretty close.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp
In reply to: Robert Haas (#2)
1 attachment(s)
Re: Minor comment update in setrefs.c

On 2015/12/11 2:21, Robert Haas wrote:

On Tue, Dec 8, 2015 at 6:16 AM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp> wrote:

Attached is a small patch to adjust a comment in setrefs.c; in
set_foreignscan_references, fdw_recheck_quals also gets adjusted to
reference foreign scan tuple, in case of a foreign join, so I added
"etc.", to a comment there, as the comment in case of a simple foreign
table scan.

Doesn't apply any more. I suppose we could sync up the similar
comments in set_customscan_references() too. But to be honest I'm not
sure this is adding any clarity. "etc." may not be the least
informative thing you can put in a comment, but it's pretty close.

The point in the previous patch was to update the list of expressions to
be adjusted for the case of scanrelid=0 like that for the case of
scanrelid>0 case in set_foreignscan_references. So, I'd like to propose
to add *fdw_recheck_quals* to both lists, then. Updated patch attached.

Best regards,
Etsuro Fujita

Attachments:

setrefs-comment-v2.patchapplication/x-patch; name=setrefs-comment-v2.patchDownload
*** a/src/backend/optimizer/plan/setrefs.c
--- b/src/backend/optimizer/plan/setrefs.c
***************
*** 1108,1114 **** set_foreignscan_references(PlannerInfo *root,
  
  	if (fscan->fdw_scan_tlist != NIL || fscan->scan.scanrelid == 0)
  	{
! 		/* Adjust tlist, qual, fdw_exprs to reference foreign scan tuple */
  		indexed_tlist *itlist = build_tlist_index(fscan->fdw_scan_tlist);
  
  		fscan->scan.plan.targetlist = (List *)
--- 1108,1117 ----
  
  	if (fscan->fdw_scan_tlist != NIL || fscan->scan.scanrelid == 0)
  	{
! 		/*
! 		 * Adjust tlist, qual, fdw_exprs, fdw_recheck_quals to reference
! 		 * foreign scan tuple
! 		 */
  		indexed_tlist *itlist = build_tlist_index(fscan->fdw_scan_tlist);
  
  		fscan->scan.plan.targetlist = (List *)
***************
*** 1142,1148 **** set_foreignscan_references(PlannerInfo *root,
  	}
  	else
  	{
! 		/* Adjust tlist, qual, fdw_exprs, etc. in the standard way */
  		fscan->scan.plan.targetlist =
  			fix_scan_list(root, fscan->scan.plan.targetlist, rtoffset);
  		fscan->scan.plan.qual =
--- 1145,1154 ----
  	}
  	else
  	{
! 		/*
! 		 * Adjust tlist, qual, fdw_exprs, fdw_recheck_quals in the standard
! 		 * way
! 		 */
  		fscan->scan.plan.targetlist =
  			fix_scan_list(root, fscan->scan.plan.targetlist, rtoffset);
  		fscan->scan.plan.qual =
#4Robert Haas
robertmhaas@gmail.com
In reply to: Etsuro Fujita (#3)
Re: Minor comment update in setrefs.c

On Fri, Jan 15, 2016 at 5:36 AM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp> wrote:

The point in the previous patch was to update the list of expressions to be
adjusted for the case of scanrelid=0 like that for the case of scanrelid>0
case in set_foreignscan_references. So, I'd like to propose to add
*fdw_recheck_quals* to both lists, then. Updated patch attached.

OK, sure. Committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers