Skip to content

Commit

Permalink
0005892: DbCompare fails to write comparison SQL for timestamp with
Browse files Browse the repository at this point in the history
timezone values
  • Loading branch information
Catherine Quamme authored and Catherine Quamme committed Jun 21, 2023
1 parent 5354b10 commit f9cfe04
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions symmetric-db/src/main/java/org/jumpmind/db/sql/Row.java
Expand Up @@ -302,14 +302,18 @@ protected void checkForColumn(String columnName) {
}
}

final private java.util.Date getDate(String value, String[] pattern) {
final private java.util.Date getDate(String value, String[] patterns) {
int spaceIndex = value.lastIndexOf(" ");
int fractionIndex = value.lastIndexOf(".");
int plusIndex = value.lastIndexOf("+");
int minusIndex = value.substring(fractionIndex).lastIndexOf("-");
if (spaceIndex > 0 && fractionIndex > 0 && value.substring(fractionIndex, value.length()).length() > 3) {
if (plusIndex != -1 || minusIndex != -1) {
return FormatUtils.parseTimestampWithTimezone(value);
}
return Timestamp.valueOf(value);
} else {
return FormatUtils.parseDate(value, pattern);
}
return FormatUtils.parseDate(value, patterns);
}

public Object[] toArray(String[] keys) {
Expand Down

0 comments on commit f9cfe04

Please sign in to comment.