[fix](planner)implicit cast should use type member variable instead of targetTypeDef (#24582)

This commit is contained in:
starocean999
2023-10-11 16:33:48 +08:00
committed by GitHub
parent e9554e36a8
commit 2221c8e2ed
2 changed files with 49 additions and 1 deletions

View File

@ -210,7 +210,8 @@ public class CastExpr extends Expr {
if (isAnalyzed) {
return "CAST(" + getChild(0).toSql() + " AS " + type.toString() + ")";
} else {
return "CAST(" + getChild(0).toSql() + " AS " + targetTypeDef.toSql() + ")";
return "CAST(" + getChild(0).toSql() + " AS "
+ (isImplicit ? type.toString() : targetTypeDef.toSql()) + ")";
}
}