Navigation Menu

Skip to content

Commit

Permalink
0005238: Bulk loaders should report missing table
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Mar 14, 2022
1 parent 08c6fc0 commit c53b2a9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
16 changes: 14 additions & 2 deletions symmetric-db/src/main/java/org/jumpmind/db/sql/LogSqlBuilder.java
Expand Up @@ -24,6 +24,8 @@
import java.nio.charset.Charset;
import java.sql.Blob;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.Arrays;
import java.util.Date;
Expand Down Expand Up @@ -165,9 +167,19 @@ protected String formatDateTimeValue(Object object, int type) {
}
}
}
if (type == Types.TIME) {
if (object instanceof Timestamp) {
if (type == Types.TIME) {
return (useJdbcTimestampFormat ? "{t " : "")
+ "'" + FormatUtils.TIME9_FORMATTER.format(((Timestamp) object).toInstant()) + "'"
+ (useJdbcTimestampFormat ? "}" : "");
}
return (useJdbcTimestampFormat ? "{ts " : "")
+ "'" + FormatUtils.TIME_FORMATTER.format(date) + "'"
+ "'" + FormatUtils.TIMESTAMP9_FORMATTER.format(((Timestamp) object).toInstant()) + "'"
+ (useJdbcTimestampFormat ? "}" : "");

} else if (object instanceof Time) {
return (useJdbcTimestampFormat ? "{t " : "")
+ "'" + FormatUtils.TIME9_FORMATTER.format(((Time) object).toInstant()) + "'"
+ (useJdbcTimestampFormat ? "}" : "");
} else {
return (useJdbcTimestampFormat ? "{ts " : "")
Expand Down
Expand Up @@ -23,6 +23,8 @@
import java.sql.Timestamp;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
Expand Down Expand Up @@ -53,7 +55,10 @@ public final class FormatUtils {
};
public static final FastDateFormat TIMESTAMP_FORMATTER = FastDateFormat
.getInstance("yyyy-MM-dd HH:mm:ss.SSS");
public static final DateTimeFormatter TIMESTAMP9_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.nnnnnnnnn").withZone(ZoneId.from(
ZoneOffset.UTC));
public static final FastDateFormat TIME_FORMATTER = FastDateFormat.getInstance("HH:mm:ss.SSS");
public static final DateTimeFormatter TIME9_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss.nnnnnnnnn").withZone(ZoneId.from(ZoneOffset.UTC));
/* special characters for wildcard triggers */
public final static String WILDCARD = "*";
public final static String WILDCARD_SEPARATOR = ",";
Expand Down

0 comments on commit c53b2a9

Please sign in to comment.