diff options
Diffstat (limited to 'src/backend/executor/execExpr.c')
-rw-r--r-- | src/backend/executor/execExpr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c index 91df2009bee..3181b1136a2 100644 --- a/src/backend/executor/execExpr.c +++ b/src/backend/executor/execExpr.c @@ -1560,7 +1560,10 @@ ExecInitExprRec(Expr *node, ExprState *state, * We don't check permissions here as a type's input/output * function are assumed to be executable by everyone. */ - scratch.opcode = EEOP_IOCOERCE; + if (state->escontext == NULL) + scratch.opcode = EEOP_IOCOERCE; + else + scratch.opcode = EEOP_IOCOERCE_SAFE; /* lookup the source type's output function */ scratch.d.iocoerce.finfo_out = palloc0(sizeof(FmgrInfo)); @@ -1596,6 +1599,8 @@ ExecInitExprRec(Expr *node, ExprState *state, fcinfo_in->args[2].value = Int32GetDatum(-1); fcinfo_in->args[2].isnull = false; + fcinfo_in->context = (Node *) state->escontext; + ExprEvalPushStep(state, &scratch); break; } @@ -3303,6 +3308,7 @@ ExecInitCoerceToDomain(ExprEvalStep *scratch, CoerceToDomain *ctest, /* we'll allocate workspace only if needed */ scratch->d.domaincheck.checkvalue = NULL; scratch->d.domaincheck.checknull = NULL; + scratch->d.domaincheck.escontext = state->escontext; /* * Evaluate argument - it's fine to directly store it into resv/resnull, |