* ExecPrepareExpr --- initialize for expression execution outside a normal * Plan tree context. * * This differs from ExecInitExpr in that we don't assume the caller is * already running in the EState's per-query context. Also, we run the * passed expression tree through expression_planner() to prepare it for * execution. (In ordinary Plan trees the regular planning process will have * ma
| 755 | * expressions this won't have happened.) |
| 756 | */ |
| 757 | ExprState * |
| 758 | ExecPrepareExpr(Expr *node, EState *estate) |
| 759 | { |
| 760 | ExprState *result; |
| 761 | MemoryContext oldcontext; |
| 762 | |
| 763 | oldcontext = MemoryContextSwitchTo(estate->es_query_cxt); |
| 764 | |
| 765 | node = expression_planner(node); |
| 766 | |
| 767 | result = ExecInitExpr(node, NULL); |
| 768 | |
| 769 | MemoryContextSwitchTo(oldcontext); |
| 770 | |
| 771 | return result; |
| 772 | } |
| 773 | |
| 774 | /* |
| 775 | * ExecPrepareQual --- initialize for qual execution outside a normal |
no test coverage detected