| 50 | NULL, NULL, NULL}; |
| 51 | |
| 52 | OpBase *NewUpdateOp(const ExecutionPlan *plan, rax *update_exps) { |
| 53 | OpUpdate *op = rm_calloc(1, sizeof(OpUpdate)); |
| 54 | op->gc = QueryCtx_GetGraphCtx(); |
| 55 | op->records = array_new(Record, 64); |
| 56 | op->update_ctxs = update_exps; |
| 57 | op->node_updates = HashTableCreate(&_dt); |
| 58 | op->edge_updates = HashTableCreate(&_dt); |
| 59 | op->updates_committed = false; |
| 60 | |
| 61 | // set our op operations |
| 62 | OpBase_Init((OpBase *)op, OPType_UPDATE, "Update", NULL, UpdateConsume, |
| 63 | UpdateReset, NULL, UpdateClone, UpdateFree, true, plan); |
| 64 | |
| 65 | // iterate over all update expressions |
| 66 | // set the record index for every entity modified by this operation |
| 67 | raxStart(&op->it, update_exps); |
| 68 | raxSeek(&op->it, "^", NULL, 0); |
| 69 | while(raxNext(&op->it)) { |
| 70 | EntityUpdateEvalCtx *ctx = op->it.data; |
| 71 | ctx->record_idx = OpBase_Modifies((OpBase *)op, ctx->alias); |
| 72 | } |
| 73 | |
| 74 | return (OpBase *)op; |
| 75 | } |
| 76 | |
| 77 | static Record UpdateConsume |
| 78 | ( |
no test coverage detected