Skip to content

Commit

Permalink
Fix date format exception caused by openGauss data type return timest…
Browse files Browse the repository at this point in the history
…amp date type (#30399)

* Use opengauss/opengauss:3.1.0 to replace enmotech/opengauss:3.0.0 image

* Fix date format exception caused by openGauss data type return timestamp date type
  • Loading branch information
strongduanmu authored Mar 5, 2024
1 parent 1b187e5 commit 1a09be6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private void assertValue(final ResultSet actual, final int columnIndex, final St
} else if (Arrays.asList(Types.TIME, Types.TIME_WITH_TIMEZONE).contains(actual.getMetaData().getColumnType(columnIndex))) {
assertThat(DateTimeFormatterFactory.getTimeFormatter().format(actual.getTime(columnIndex).toLocalTime()), is(expected));
} else if (Arrays.asList(Types.TIMESTAMP, Types.TIMESTAMP_WITH_TIMEZONE).contains(actual.getMetaData().getColumnType(columnIndex))) {
if ("Oracle".equals(databaseType.getType()) && "DATE".equalsIgnoreCase(actual.getMetaData().getColumnTypeName(columnIndex))) {
if ("Oracle".equals(databaseType.getType()) && "DATE".equalsIgnoreCase(actual.getMetaData().getColumnTypeName(columnIndex)) || "openGauss".equals(databaseType.getType())) {
assertThat(DateTimeFormatterFactory.getDateFormatter().format(actual.getDate(columnIndex).toLocalDate()), is(expected));
} else {
assertThat(DateTimeFormatterFactory.getShortMillsFormatter().format(actual.getTimestamp(columnIndex).toLocalDateTime()), is(expected));
Expand Down

0 comments on commit 1a09be6

Please sign in to comment.