clone the execution ctx and return a shallow copy for the ast deep copy for the execution plan
| 72 | // clone the execution ctx and return a shallow copy for the ast |
| 73 | // deep copy for the execution plan |
| 74 | ExecutionCtx *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 |
nothing calls this directly
no test coverage detected