Fix allocation of UniqueRelInfo

Reported-by: Richard Guo
Discussion: https://postgr.es/m/CAMbWs4_STsG1PKQBuvQC8W4sPo3KvML3=jOTjKLUYQuK3g8cpQ@mail.gmail.com
This commit is contained in:
Alexander Korotkov 2023-11-06 10:02:52 +02:00
parent 2c7c6c417f
commit 93c85db3b5
1 changed files with 1 additions and 1 deletions

View File

@ -1321,7 +1321,7 @@ innerrel_is_unique_ext(PlannerInfo *root,
* supersets of them anyway.
*/
old_context = MemoryContextSwitchTo(root->planner_cxt);
uniqueRelInfo = palloc(sizeof(UniqueRelInfo));
uniqueRelInfo = makeNode(UniqueRelInfo);
uniqueRelInfo->extra_clauses = outer_exprs;
uniqueRelInfo->outerrelids = bms_copy(outerrelids);
innerrel->unique_for_rels = lappend(innerrel->unique_for_rels,