Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-6979

Some values of the datatime data type are incorrectly converted to UTC timestamp after being captured

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • None
    • sqlserver-connector
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      Bug report

      Environment

      Debezium version : 1.9

      Captured database version:Sql Server 2008

      Problem description:

      The BIRTHDATE field in my table is of the datetime data type, and there is no additional setting in my connection configuration, so in general this datatime type will be uniformly converted to timestamp format in UTC. But here's the problem, I found that part of the time was converted to a timestamp and there was an exception, an extra hour in the unit of hours.

      For example, the current BIRTHDATE field value is 1990-05-26 00:00:00.000, but after the capture of the message "BIRTHDATE": 643680000000, convert the timestamp back to the time format found as 1990-05-26 09:00:00.000, supposedly I am in China, the UTC timestamp should be +8.

      To verify the problem, I also looked at other records and found that the value of 1991-12-06 00:00:00.000 was 1694995200000 in the captured message, and converted the timestamp back to the time format and found that it was 1991-12-06 08:00:00.000 was correct. So we found that the problem is local.

      The connector configuration

       

      {
          "name": "sqlserver-connector-08",
          "config": {
              "connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",
              "database.user": "sa",
              "database.dbname": "test",
              "transforms.Reroute.type": "io.debezium.transforms.ByLogicalTableRouter",
              "database.history.kafka.bootstrap.servers": "xxx.xxx.xxx.xxx:9092",
              "database.history.kafka.topic": "JHDL-TOPIC-CDC4S-LOG-dbhistory",
              "transforms": "Reroute",
              "database.server.name": "JHDL-TOPIC-CDC4S-LOG",
              "transforms.Reroute.topic.regex": "JHDL-TOPIC-CDC4S-LOG.(.*)",
              "database.port": "1433",
              "transforms.Reroute.topic.replacement": "JHDL-TOPIC-CDC4S-LOG-08",
              "database.hostname": "xxx.xxx.xxx.xxx",
              "database.password": "xxx",
              "name": "sqlserver-connector-08",
              "table.include.list": "dbo.T_SINGLE_CHECKINFO",
              "snapshot.mode": "schema_only"
          },
          "tasks": [
              {
                  "connector": "sqlserver-connector-08",
                  "task": 0
              }
          ],
          "type": "source"

       

              Unassigned Unassigned
              simonchou12138 民帅 周 (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: