MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _ExecutionPlan_Clone

Function _ExecutionPlan_Clone

src/execution_plan/execution_plan_clone.c:55–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static ExecutionPlan *_ExecutionPlan_Clone(const ExecutionPlan *template) {
56 // create mapping from old exec-plans to the ones
57 dict *old_to_new = HashTableCreate(&def_dt);
58
59 OpBase *clone_root = _CloneOpTree(template->root, old_to_new);
60 // The "master" execution plan is the one constructed with the root op.
61 ExecutionPlan *clone = (ExecutionPlan *)clone_root->plan;
62
63 HashTableRelease(old_to_new);
64
65 return clone;
66}
67
68/* This function clones the input ExecutionPlan by recursively visiting its tree of ops.
69 * When an op is encountered that was constructed as part of a different ExecutionPlan segment, that segment

Callers 1

ExecutionPlan_CloneFunction · 0.85

Calls 3

HashTableCreateFunction · 0.85
_CloneOpTreeFunction · 0.85
HashTableReleaseFunction · 0.85

Tested by

no test coverage detected