[Bug](function) fix current_date not equal to curdate (#11463)
* fix current_date not equal to curdate
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user