1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Revert "Add soft error handling to some expression nodes"

This reverts commit 7fbc75b26e.

Looks like the LLVM additions may not be totally correct.
This commit is contained in:
Amit Langote
2023-10-02 13:48:15 +09:00
parent 7fbc75b26e
commit c8ec5e0543
9 changed files with 67 additions and 94 deletions

View File

@ -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),