Add an assert about Param kind

Currently there is a check function used, but let's keep a stronger
point for the future, just in case.
pull/7914/head
Cédric Villemain 2025-03-07 09:28:31 +01:00
parent c8afdd0bb8
commit 10c953a883
1 changed files with 5 additions and 0 deletions

View File

@ -100,6 +100,7 @@ PartiallyEvaluateExpression(Node *expression,
} }
NodeTag nodeTag = nodeTag(expression); NodeTag nodeTag = nodeTag(expression);
/* ExecInitExpr cannot handle some expressions (PARAM_MULTIEXPR and PARAM_SUBLINK) */ /* ExecInitExpr cannot handle some expressions (PARAM_MULTIEXPR and PARAM_SUBLINK) */
if (!CheckExprExecutorSafe(expression)) if (!CheckExprExecutorSafe(expression))
{ {
@ -109,6 +110,8 @@ PartiallyEvaluateExpression(Node *expression,
/* ExecInitExpr cannot handle PARAM_MULTIEXPR and PARAM_SUBLINK but we have guards */ /* ExecInitExpr cannot handle PARAM_MULTIEXPR and PARAM_SUBLINK but we have guards */
else if (nodeTag == T_Param) else if (nodeTag == T_Param)
{ {
Assert(((Param *) expression)->paramkind != PARAM_MULTIEXPR &&
((Param *) expression)->paramkind != PARAM_SUBLINK);
return (Node *) citus_evaluate_expr((Expr *) expression, return (Node *) citus_evaluate_expr((Expr *) expression,
exprType(expression), exprType(expression),
exprTypmod(expression), exprTypmod(expression),
@ -261,9 +264,11 @@ ShouldEvaluateExpression(Expr *expression)
} }
default: default:
{
return false; return false;
} }
} }
}
/* /*