| 37 | } |
| 38 | |
| 39 | OpBase *NewLimitOp(const ExecutionPlan *plan, AR_ExpNode *limit_exp) { |
| 40 | // validate inputs |
| 41 | ASSERT(plan != NULL); |
| 42 | ASSERT(limit_exp != NULL); |
| 43 | |
| 44 | OpLimit *op = rm_malloc(sizeof(OpLimit)); |
| 45 | op->limit = 0; |
| 46 | op->consumed = 0; |
| 47 | op->limit_exp = NULL; |
| 48 | |
| 49 | _eval_limit(op, limit_exp); |
| 50 | |
| 51 | // set operations |
| 52 | OpBase_Init((OpBase *)op, OPType_LIMIT, "Limit", NULL, LimitConsume, LimitReset, NULL, |
| 53 | LimitClone, LimitFree, false, plan); |
| 54 | |
| 55 | return (OpBase *)op; |
| 56 | } |
| 57 | |
| 58 | static Record LimitConsume(OpBase *opBase) { |
| 59 | OpLimit *op = (OpLimit *)opBase; |
no test coverage detected