Add the unchecked cast from date literal to others (#2021)

Fix the ISSUE:2017
This commit enable the cast function in date.
The date literal can be cast to target type which is implicitly castable such as int, bigint, largeint.
This commit is contained in:
EmmyMiao87
2019-10-21 13:57:50 +08:00
committed by ZHAO Chun
parent 109eb79f19
commit 751a219f0a

View File

@ -313,6 +313,8 @@ public class DateLiteral extends LiteralExpr {
return this;
} else if (targetType.isStringType()) {
return new StringLiteral(getStringValue());
} else if (Type.isImplicitlyCastable(this.type, targetType, true)) {
return new CastExpr(targetType, this);
}
Preconditions.checkState(false);
return this;