diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-09-14 10:43:44 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-09-14 11:03:23 -0400 |
commit | 448aa36e8b969da257bb58a6fe3db6498d48d4e8 (patch) | |
tree | 64631da8dc4fe9b681d3dfb0aee10adcf69ae07d /src/backend/optimizer/plan/planner.c | |
parent | 253c8afc9eb178b7241b4cc571acf7fb6ac6f976 (diff) | |
download | postgresql-448aa36e8b969da257bb58a6fe3db6498d48d4e8.tar.gz postgresql-448aa36e8b969da257bb58a6fe3db6498d48d4e8.zip |
Set partitioned_rels appropriately when UNION ALL is used.
In most cases, this omission won't matter, because the appropriate
locks will have been acquired during parse/plan or by AcquireExecutorLocks.
But it's a bug all the same.
Report by Ashutosh Bapat. Patch by me, reviewed by Amit Langote.
Discussion: http://postgr.es/m/CAFjFpRdHb_ZnoDTuBXqrudWXh3H1ibLkr6nHsCFT96fSK4DXtA@mail.gmail.com
Diffstat (limited to 'src/backend/optimizer/plan/planner.c')
-rw-r--r-- | src/backend/optimizer/plan/planner.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 3e93eee6d8e..793242759d1 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6068,7 +6068,8 @@ plan_cluster_use_sort(Oid tableOid, Oid indexOid) * Returns a list of the RT indexes of the partitioned child relations * with rti as the root parent RT index. * - * Note: Only call this function on RTEs known to be partitioned tables. + * Note: This function might get called even for range table entries that + * are not partitioned tables; in such a case, it will simply return NIL. */ List * get_partitioned_child_rels(PlannerInfo *root, Index rti) @@ -6087,8 +6088,5 @@ get_partitioned_child_rels(PlannerInfo *root, Index rti) } } - /* The root partitioned table is included as a child rel */ - Assert(list_length(result) >= 1); - return result; } |