mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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
This commit is contained in:
@ -6076,7 +6076,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)
|
||||
@ -6095,8 +6096,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user