Incorrect comment for expand_single_inheritance_child

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

Here is part of comments for expand_single_inheritance_child:

* expand_single_inheritance_child
* Expand a single inheritance child, if needed.
*
* If this is a temp table of another backend, we'll return without doing
* anything at all. Otherwise, build a RangeTblEntry and an
AppendRelInfo, if
* appropriate, plus maybe a PlanRowMark.

The sentence "If this is a temp table of another backend, we'll return
without doing anything at all" is not correct, because that function
doesn't even check whether the given child is such a temp table. (The
caller does, so that function assumes that the given child is not such a
temp table.) So I think we should remove that sentence entirely. Also,
I think we should remove "if needed" from the headline: Expand a single
inheritance child, if needed. IMO I don't think that "Expand a single
inheritance child" says much, so I'd like to propose changing that part
simply to something like this:

* expand_single_inheritance_child
* Build a RangeTblEntry and an AppendRelInfo, if appropriate, plus
* maybe a PlanRowMark.

Attached is a patch for that.

Best regards,
Etsuro Fujita

Attachments:

prepunion-comment-fix.patchtext/x-diff; name=prepunion-comment-fix.patchDownload
*** a/src/backend/optimizer/prep/prepunion.c
--- b/src/backend/optimizer/prep/prepunion.c
***************
*** 1634,1644 **** expand_partitioned_rtentry(PlannerInfo *root, RangeTblEntry *parentrte,
  
  /*
   * expand_single_inheritance_child
!  *		Expand a single inheritance child, if needed.
!  *
!  * If this is a temp table of another backend, we'll return without doing
!  * anything at all.  Otherwise, build a RangeTblEntry and an AppendRelInfo, if
!  * appropriate, plus maybe a PlanRowMark.
   *
   * We now expand the partition hierarchy level by level, creating a
   * corresponding hierarchy of AppendRelInfos and RelOptInfos, where each
--- 1634,1641 ----
  
  /*
   * expand_single_inheritance_child
!  *		Build a RangeTblEntry and an AppendRelInfo, if appropriate, plus
!  *		maybe a PlanRowMark.
   *
   * We now expand the partition hierarchy level by level, creating a
   * corresponding hierarchy of AppendRelInfos and RelOptInfos, where each
#2Robert Haas
robertmhaas@gmail.com
In reply to: Etsuro Fujita (#1)
Re: Incorrect comment for expand_single_inheritance_child

On Mon, Jan 8, 2018 at 10:37 PM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp> wrote:

Attached is a patch for that.

Committed.

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

#3Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp
In reply to: Robert Haas (#2)
Re: Incorrect comment for expand_single_inheritance_child

(2018/01/09 23:46), Robert Haas wrote:

On Mon, Jan 8, 2018 at 10:37 PM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp> wrote:

Attached is a patch for that.

Committed.

Thank you!

Best regards,
Etsuro Fujita