From 212f3900b2541199fa5459b411a29484d6d8dbcd Mon Sep 17 00:00:00 2001 From: DvirDukhan Date: Mon, 24 Feb 2020 13:20:40 +0200 Subject: [PATCH] added cartesian product clone --- src/execution_plan/ops/op_cartesian_product.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/execution_plan/ops/op_cartesian_product.c b/src/execution_plan/ops/op_cartesian_product.c index b0533f27a5..9766021d86 100644 --- a/src/execution_plan/ops/op_cartesian_product.c +++ b/src/execution_plan/ops/op_cartesian_product.c @@ -10,6 +10,7 @@ static OpResult CartesianProductInit(OpBase *opBase); static Record CartesianProductConsume(OpBase *opBase); static OpResult CartesianProductReset(OpBase *opBase); +static OpBase *CartesianProductClone(const ExecutionPlan *plan, const OpBase *opBase); static void CartesianProductFree(OpBase *opBase); OpBase *NewCartesianProductOp(const ExecutionPlan *plan) { @@ -19,7 +20,8 @@ OpBase *NewCartesianProductOp(const ExecutionPlan *plan) { // Set our Op operations OpBase_Init((OpBase *)op, OPType_CARTESIAN_PRODUCT, "Cartesian Product", CartesianProductInit, - CartesianProductConsume, CartesianProductReset, NULL, NULL, CartesianProductFree, false, plan); + CartesianProductConsume, CartesianProductReset, NULL, CartesianProductClone, CartesianProductFree, + false, plan); return (OpBase *)op; } @@ -109,6 +111,11 @@ static OpResult CartesianProductReset(OpBase *opBase) { return OP_OK; } +static OpBase *CartesianProductClone(const ExecutionPlan *plan, const OpBase *opBase) { + assert(opBase->type == OPType_CARTESIAN_PRODUCT); + return NewCartesianProductOp(plan); +} + static void CartesianProductFree(OpBase *opBase) { CartesianProduct *op = (CartesianProduct *)opBase; if(op->r) {