* ExecPrepareQual --- initialize for qual execution outside a normal * Plan tree context. * * This differs from ExecInitQual 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 * made the
| 783 | * expressions this won't have happened.) |
| 784 | */ |
| 785 | ExprState * |
| 786 | ExecPrepareQual(List *qual, EState *estate) |
| 787 | { |
| 788 | ExprState *result; |
| 789 | MemoryContext oldcontext; |
| 790 | |
| 791 | oldcontext = MemoryContextSwitchTo(estate->es_query_cxt); |
| 792 | |
| 793 | qual = (List *) expression_planner((Expr *) qual); |
| 794 | |
| 795 | result = ExecInitQual(qual, NULL); |
| 796 | |
| 797 | MemoryContextSwitchTo(oldcontext); |
| 798 | |
| 799 | return result; |
| 800 | } |
| 801 | |
| 802 | /* |
| 803 | * ExecPrepareCheck -- initialize check constraint for execution outside a |
no test coverage detected