Skip to content

Commit

Permalink
0006214: SQLite sync error on sym_table_reload_request when
Browse files Browse the repository at this point in the history
db.treat.date.time.as.varchar.enabled
  • Loading branch information
erilong committed Jan 29, 2024
1 parent e1a9824 commit 5844960
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.jumpmind.db.sql.SqlException;
import org.jumpmind.db.sql.SqlScriptReader;
import org.jumpmind.db.sql.mapper.StringMapper;
import org.jumpmind.symmetric.io.IoConstants;
import org.jumpmind.symmetric.io.data.Batch;
import org.jumpmind.symmetric.io.data.CsvData;
import org.jumpmind.symmetric.io.data.CsvUtils;
Expand Down Expand Up @@ -1209,13 +1210,16 @@ protected Table lookupTableAtTarget(Table sourceTable) {
if (table.getPrimaryKeyColumnCount() == 0) {
table = getPlatform(table).makeAllColumnsPrimaryKeys(table);
}
Column[] columns = table.getColumns();
for (Column column : columns) {
if (column != null) {
int typeCode = column.getMappedTypeCode();
if (writerSettings.isTreatDateTimeFieldsAsVarchar() && (typeCode == Types.DATE
|| typeCode == Types.TIME || typeCode == Types.TIMESTAMP)) {
column.setMappedTypeCode(Types.VARCHAR);
if (writerSettings.isTreatDateTimeFieldsAsVarchar() && (batch.getChannelId() != null
&& !batch.getChannelId().equals(IoConstants.CHANNEL_CONFIG)
&& !batch.getChannelId().equals(IoConstants.CHANNEL_MONITOR))) {
Column[] columns = table.getColumns();
for (Column column : columns) {
if (column != null) {
int typeCode = column.getMappedTypeCode();
if (typeCode == Types.DATE || typeCode == Types.TIME || typeCode == Types.TIMESTAMP) {
column.setMappedTypeCode(Types.VARCHAR);
}
}
}
}
Expand Down

0 comments on commit 5844960

Please sign in to comment.