-
Bug
-
Resolution: Unresolved
-
Critical
-
1.8.1.Final
-
None
-
False
-
None
-
False
-
When SQL_MODE='' (any SQL mode without NO_ZERO_IN_DATETIME basically) it is possible to insert "zero" dates. These dates are interpreted as the unixtime epoch (1970-01-01) instead of the "zero" date they are supposed to be.
Here is the debug output from my connector:
Mar 21, 2022 10:02:54 PM com.github.shyiko.mysql.binlog.BinaryLogClient connect
INFO: Connected to 127.0.0.1:3306 at 3b0f51ee-a08e-11ec-86ff-000c29221572:1-34 (sid:8192, cid:150)
SQL: START TRANSACTION;
RECORD:
Struct{after=Struct
Field{name=c4, index=3, schema=Schema{io.debezium.time.ZonedTimestamp:STRING}}
SQL: INSERT INTO `leapdb`.`mvlog_e1effbbe63d0a9b6aa4378aac07f29c8` VALUES (1, @fv_uow_id, 999, 160, 1 , 'abc' , '0000-00-00' , '1970-01-01');
SQL: COMMIT;
Data in change data capture table is wrong:
mysql> select * from mvlog_e1effbbe63d0a9b6aa4378aac07f29c8;
--------------------------------------------------------------------------------+
dml_type | uow_id | fv$server_id | fv$gsn | c1 | c2 | c3 | c4 |
--------------------------------------------------------------------------------+
1 | 50 | 999 | 175 | 1 | abc | 0000-00-00 00:00:00 | 1970-01-01 00:00:00 |
--------------------------------------------------------------------------------+
1 row in set (0.00 sec)