diff options
author | Amit Langote <amitlan@postgresql.org> | 2023-10-02 13:48:15 +0900 |
---|---|---|
committer | Amit Langote <amitlan@postgresql.org> | 2023-10-02 13:48:15 +0900 |
commit | c8ec5e0543b90372c8e6d5cc2cd3d2ff89ca0e82 (patch) | |
tree | b18c63d3a11e1f6e17e9d7d35e423d62d822ae72 /src/backend/executor/execExprInterp.c | |
parent | 7fbc75b26ed8ec70c729c5e7f8233896c54c900f (diff) | |
download | postgresql-c8ec5e0543b90372c8e6d5cc2cd3d2ff89ca0e82.tar.gz postgresql-c8ec5e0543b90372c8e6d5cc2cd3d2ff89ca0e82.zip |
Revert "Add soft error handling to some expression nodes"
This reverts commit 7fbc75b26ed8ec70c729c5e7f8233896c54c900f.
Looks like the LLVM additions may not be totally correct.
Diffstat (limited to 'src/backend/executor/execExprInterp.c')
-rw-r--r-- | src/backend/executor/execExprInterp.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c index e55fd10e3b8..24c2b60c62a 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c @@ -1177,27 +1177,29 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) /* call input function (similar to InputFunctionCall) */ if (!op->d.iocoerce.finfo_in->fn_strict || str != NULL) { - bool error; + FunctionCallInfo fcinfo_in; + Datum d; - /* - * InputFunctionCallSafe() writes directly into *op->resvalue. - * Return NULL if an error is reported. - */ - error = !InputFunctionCallSafe(op->d.iocoerce.finfo_in, str, - op->d.iocoerce.typioparam, -1, - (Node *) op->d.iocoerce.escontext, - op->resvalue); - if (error) - *op->resnull = true; + fcinfo_in = op->d.iocoerce.fcinfo_data_in; + fcinfo_in->args[0].value = PointerGetDatum(str); + fcinfo_in->args[0].isnull = *op->resnull; + /* second and third arguments are already set up */ - /* - * Should get null result if and only if str is NULL or if we - * got an error above. - */ - if (str == NULL || error) + fcinfo_in->isnull = false; + d = FunctionCallInvoke(fcinfo_in); + *op->resvalue = d; + + /* Should get null result if and only if str is NULL */ + if (str == NULL) + { Assert(*op->resnull); + Assert(fcinfo_in->isnull); + } else + { Assert(!*op->resnull); + Assert(!fcinfo_in->isnull); + } } EEO_NEXT(); @@ -3743,7 +3745,7 @@ ExecEvalConstraintCheck(ExprState *state, ExprEvalStep *op) { if (!*op->d.domaincheck.checknull && !DatumGetBool(*op->d.domaincheck.checkvalue)) - errsave((Node *) op->d.domaincheck.escontext, + ereport(ERROR, (errcode(ERRCODE_CHECK_VIOLATION), errmsg("value for domain %s violates check constraint \"%s\"", format_type_be(op->d.domaincheck.resulttype), |