[Bug](function) fix current_date not equal to curdate (#11463)

* fix current_date not equal to curdate
This commit is contained in:
Pxl
2022-08-04 09:25:50 +08:00
committed by GitHub
parent 33053ad1fe
commit ce68d24e95
5 changed files with 21 additions and 5 deletions

View File

@ -309,11 +309,13 @@ public class DateLiteral extends LiteralExpr {
this.year = dateTime.getYear();
this.month = dateTime.getMonthValue();
this.day = dateTime.getDayOfMonth();
this.hour = dateTime.getHour();
this.minute = dateTime.getMinute();
this.second = dateTime.getSecond();
this.microsecond = dateTime.get(ChronoField.MICRO_OF_SECOND);
this.type = type;
if (type.equals(Type.DATETIME) || type.equals(Type.DATETIMEV2)) {
this.hour = dateTime.getHour();
this.minute = dateTime.getMinute();
this.second = dateTime.getSecond();
this.microsecond = dateTime.get(ChronoField.MICRO_OF_SECOND);
}
}
public DateLiteral(DateLiteral other) {

View File

@ -745,7 +745,7 @@ public abstract class Expr extends TreeNode<Expr> implements ParseNode, Cloneabl
try {
return trySubstituteList(exprs, smap, analyzer, preserveRootTypes);
} catch (Exception e) {
throw new IllegalStateException("Failed analysis after expr substitution.", e);
throw new IllegalStateException("Failed analysis after expr substitution: " + e.getMessage());
}
}