Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeParseException;
import org.apache.commons.lang3.StringUtils;
import org.apache.gravitino.catalog.jdbc.converter.JdbcColumnDefaultValueConverter;
import org.apache.gravitino.catalog.jdbc.converter.JdbcTypeConverter;
import org.apache.gravitino.rel.expressions.Expression;
Expand All @@ -50,7 +51,7 @@ public Expression toGravitino(
}

if (isExpression) {
if (columnDefaultValue.startsWith(CURRENT_TIMESTAMP)) {
if (StringUtils.startsWithIgnoreCase(columnDefaultValue, CURRENT_TIMESTAMP)) {
return DEFAULT_VALUE_OF_CURRENT_TIMESTAMP;
}
// The parsing of MySQL expressions is complex, so we are not currently undertaking the
Expand Down Expand Up @@ -89,7 +90,7 @@ public Expression toGravitino(
return Literals.timeLiteral(LocalTime.parse(columnDefaultValue, TIME_FORMATTER));
case JdbcTypeConverter.TIMESTAMP:
case MysqlTypeConverter.DATETIME:
if (columnDefaultValue.startsWith(CURRENT_TIMESTAMP)) {
if (StringUtils.startsWithIgnoreCase(columnDefaultValue, CURRENT_TIMESTAMP)) {
return DEFAULT_VALUE_OF_CURRENT_TIMESTAMP;
}
try {
Expand Down
Loading