Skip to content

Commit d515365

Browse files
committed
Don't bother copying empty support arrays in a zero-column MergeJoin.
The case could not arise when this code was originally written, but it can now (since we made zero-column MergeJoins work for the benefit of FULL JOIN ON TRUE). I don't think there is any actual bug here, but we might as well treat it consistently with other uses of COPY_POINTER_FIELD(). Per comment from Ashutosh Bapat.
1 parent e969f9a commit d515365

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/backend/nodes/copyfuncs.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,13 @@ _copyMergeJoin(const MergeJoin *from)
672672
*/
673673
COPY_NODE_FIELD(mergeclauses);
674674
numCols = list_length(from->mergeclauses);
675-
COPY_POINTER_FIELD(mergeFamilies, numCols * sizeof(Oid));
676-
COPY_POINTER_FIELD(mergeCollations, numCols * sizeof(Oid));
677-
COPY_POINTER_FIELD(mergeStrategies, numCols * sizeof(int));
678-
COPY_POINTER_FIELD(mergeNullsFirst, numCols * sizeof(bool));
675+
if (numCols > 0)
676+
{
677+
COPY_POINTER_FIELD(mergeFamilies, numCols * sizeof(Oid));
678+
COPY_POINTER_FIELD(mergeCollations, numCols * sizeof(Oid));
679+
COPY_POINTER_FIELD(mergeStrategies, numCols * sizeof(int));
680+
COPY_POINTER_FIELD(mergeNullsFirst, numCols * sizeof(bool));
681+
}
679682

680683
return newnode;
681684
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy