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

Function ExecutionCtx_Clone

src/commands/execution_ctx.c:74–90  ·  view source on GitHub ↗

clone the execution ctx and return a shallow copy for the ast deep copy for the execution plan

Source from the content-addressed store, hash-verified

72// clone the execution ctx and return a shallow copy for the ast
73// deep copy for the execution plan
74ExecutionCtx *ExecutionCtx_Clone
75(
76 const ExecutionCtx *ctx // execution context to clone
77) {
78 ExecutionCtx *clone = rm_malloc(sizeof(ExecutionCtx));
79
80 clone->ast = AST_ShallowCopy(ctx->ast);
81
82 // set the AST copy in thread local storage
83 QueryCtx_SetAST(clone->ast);
84
85 clone->plan = ExecutionPlan_Clone(ctx->plan);
86 clone->cached = ctx->cached;
87 clone->exec_type = ctx->exec_type;
88
89 return clone;
90}
91
92// returns the objects and information required for query execution
93// if the query contains error, a ExecutionCtx struct with the AST

Callers

nothing calls this directly

Calls 4

rm_mallocFunction · 0.85
AST_ShallowCopyFunction · 0.85
QueryCtx_SetASTFunction · 0.85
ExecutionPlan_CloneFunction · 0.85

Tested by

no test coverage detected