diff --git a/integration_tests/mysql/main.go b/integration_tests/mysql/main.go index ac671c55..dbfa4896 100644 --- a/integration_tests/mysql/main.go +++ b/integration_tests/mysql/main.go @@ -289,19 +289,19 @@ const expectedPayloadTemplate = `{ "parameters": null }, { - "type": "string", + "type": "int64", "optional": false, "default": null, "field": "c_datetime", - "name": "io.debezium.time.ZonedTimestamp", + "name": "io.debezium.time.MicroTimestamp", "parameters": null }, { - "type": "int64", + "type": "string", "optional": false, "default": null, "field": "c_timestamp", - "name": "io.debezium.time.MicroTimestamp", + "name": "io.debezium.time.ZonedTimestamp", "parameters": null }, { @@ -409,7 +409,7 @@ const expectedPayloadTemplate = `{ "c_char": "X", "c_date": 18263, "c_date_0000_00_00": null, - "c_datetime": "2001-02-03T04:05:06Z", + "c_datetime": 981173106000000, "c_decimal": "EtRQ", "c_double": 45.678, "c_enum": "medium", @@ -422,7 +422,7 @@ const expectedPayloadTemplate = `{ "c_smallint": 2, "c_text": "ZXCV", "c_time": 14706000000, - "c_timestamp": 981173106000000, + "c_timestamp": "2001-02-03T04:05:06Z", "c_tinyint": 1, "c_varbinary": "Qk5N", "c_varchar": "GHJKL", diff --git a/lib/postgres/scanner_test.go b/lib/postgres/scanner_test.go index 915e8791..cb9fa55d 100644 --- a/lib/postgres/scanner_test.go +++ b/lib/postgres/scanner_test.go @@ -96,7 +96,7 @@ func TestScanAdapter_ParsePrimaryKeyValue(t *testing.T) { name: "unsupported data type", dataType: schema.Array, value: "1234", - expectedErr: "DataType(20) for column 'col' is not supported for use as a primary key", + expectedErr: "DataType(21) for column 'col' is not supported for use as a primary key", }, { name: "boolean - malformed", diff --git a/sources/mysql/adapter/adapter.go b/sources/mysql/adapter/adapter.go index 5ddf9d78..ebc7f7de 100644 --- a/sources/mysql/adapter/adapter.go +++ b/sources/mysql/adapter/adapter.go @@ -111,9 +111,9 @@ func valueConverterForType(d schema.DataType, opts *schema.Opts) (converters.Val case schema.Date: return converters.DateConverter{}, nil case schema.DateTime: - return converters.ZonedTimestampConverter{}, nil - case schema.Timestamp: return converters.MicroTimestampConverter{}, nil + case schema.Timestamp: + return converters.ZonedTimestampConverter{}, nil case schema.Year: return converters.YearConverter{}, nil case schema.Enum: diff --git a/sources/mysql/adapter/adapter_test.go b/sources/mysql/adapter/adapter_test.go index 5cefa00d..1579a01c 100644 --- a/sources/mysql/adapter/adapter_test.go +++ b/sources/mysql/adapter/adapter_test.go @@ -218,8 +218,8 @@ func TestValueConverterForType(t *testing.T) { name: "datetime", dataType: schema.DateTime, expected: debezium.Field{ - Type: "string", - DebeziumType: "io.debezium.time.Timestamp", + Type: "int64", + DebeziumType: "io.debezium.time.MicroTimestamp", FieldName: colName, }, }, @@ -228,7 +228,7 @@ func TestValueConverterForType(t *testing.T) { dataType: schema.Timestamp, expected: debezium.Field{ Type: "string", - DebeziumType: "io.debezium.time.Timestamp", + DebeziumType: "io.debezium.time.ZonedTimestamp", FieldName: colName, }, },