[fix](planner)nvl should match function signature in the same way as ifnull (#25849)

This commit is contained in:
starocean999
2023-10-27 11:13:30 +08:00
committed by GitHub
parent 8206252e0a
commit a3ac8b98b8
3 changed files with 7 additions and 1 deletions

View File

@ -1517,7 +1517,8 @@ public class FunctionCallExpr extends Expr {
fn.setReturnType(assignmentCompatibleType);
}
} else if (fnName.getFunction().equalsIgnoreCase("ifnull")) {
} else if (fnName.getFunction().equalsIgnoreCase("ifnull")
|| fnName.getFunction().equalsIgnoreCase("nvl")) {
Type[] childTypes = collectChildReturnTypes();
Type assignmentCompatibleType = ScalarType.getAssignmentCompatibleType(childTypes[0], childTypes[1], true);
if (assignmentCompatibleType != Type.INVALID) {