diff options
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r-- | src/backend/nodes/copyfuncs.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index e76b5b3f633..6b1bf7be19d 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -603,17 +603,24 @@ _copyForeignScan(const ForeignScan *from) static CustomScan * _copyCustomScan(const CustomScan *from) { - CustomScan *newnode; - - newnode = from->methods->CopyCustomScan(from); - Assert(nodeTag(newnode) == nodeTag(from)); + CustomScan *newnode = makeNode(CustomScan); + /* + * copy node superclass fields + */ CopyScanFields((const Scan *) from, (Scan *) newnode); + + /* + * copy remainder of node + */ COPY_SCALAR_FIELD(flags); + COPY_NODE_FIELD(custom_exprs); + COPY_NODE_FIELD(custom_private); + /* - * NOTE: The method field of CustomScan is required to be a pointer - * to a static table of callback functions. So, we don't copy the - * table itself, just reference the original one. + * NOTE: The method field of CustomScan is required to be a pointer to a + * static table of callback functions. So we don't copy the table itself, + * just reference the original one. */ COPY_SCALAR_FIELD(methods); |