Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datetime columns timezone conversion fix #1779

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -14,6 +14,7 @@
import com.zendesk.maxwell.schema.columndef.ColumnDef;
import com.zendesk.maxwell.schema.columndef.ColumnDefCastException;
import com.zendesk.maxwell.schema.columndef.DateColumnDef;
import com.zendesk.maxwell.schema.columndef.StringColumnDef;
import com.zendesk.maxwell.schema.columndef.TimeColumnDef;
import com.zendesk.maxwell.scripting.Scripting;
import org.slf4j.Logger;
Expand All @@ -39,6 +40,7 @@ public BootstrapAbortException(String message) {

private long lastInsertedRowsUpdateTimeMillis = 0;


public SynchronousBootstrapper(MaxwellContext context) {
this.context = context;
}
Expand Down Expand Up @@ -237,7 +239,7 @@ private void setRowValues(RowMap row, ResultSet resultSet, Table table) throws S
// need to explicitly coerce TIME into TIMESTAMP in order to preserve nanoseconds
if (columnDefinition instanceof TimeColumnDef)
columnValue = getTimestamp(resultSet, columnIndex);
else if ( columnDefinition instanceof DateColumnDef)
else if (columnDefinition instanceof StringColumnDef || columnDefinition instanceof DateColumnDef)
columnValue = resultSet.getString(columnIndex);
else
columnValue = resultSet.getObject(columnIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public static ColumnDef build(String name, String charset, String type, short po
case "date":
return DateColumnDef.create(name, type, pos);
case "datetime":
return StringColumnDef.create(name, type, pos, charset);
case "timestamp":
return DateTimeColumnDef.create(name, type, pos, columnLength);
case "time":
Expand Down