[MDEV-20860] Mariadb 10.0.38 datetime representation in binlog Created: 2019-10-18  Updated: 2019-10-24  Resolved: 2019-10-24

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 10.0.38
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Dawid Szymaniuk-Paryż Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: binlog, datetime


 Description   

HI.

I'm trying to connect kafka connector to my existing database and it reports problem when I try to insert/delete/update rows:

org.apache.kafka.connect.errors.ConnectException: Invalid value for MonthOfYear (valid values 1 - 12): 75
    at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
    at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:197)
    at io.debezium.connector.mysql.BinlogReader$ReaderThreadLifecycleListener.onEventDeserializationFailure(BinlogReader.java:992)
    at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:935)
    at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:580)
    at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:825)
    at java.lang.Thread.run(Thread.java:748)

I use datetime field in my table:

datetime(6)

This is my sample insert:

INSERT INTO `xxx` VALUES ('2019-10-18 14:45:40.000000');

When I select this record I get proper value:

select time from xxx where time='2019-10-18 14:45:40.000000';
+----------------------------+
| time                       |
+----------------------------+
| 2019-10-18 14:45:40.000000 |
+----------------------------+
1 row in set (0.00 sec)

But the problem is that this filed has strange value in binlog file:

mysqlbinlog -vv mysqld-bin.000004
 
### INSERT INTO `yyy`.`xxx`
### SET
###   @1=5775995-95-28 11:23:85 /* DATETIME meta=0 nullable=0 is_null=0 */

This is my configuration file:

[mysqld]
server-id         = 223344
log_bin           = mysql-bin
expire_logs_days  = 1
binlog_format     = row

In new version of mariadb I don't have this problem. Unfortunately version 10.0.38 is our production version and I can't migrate to newer version for now.

Do you know how to fix this problem without upgrading mariadb?

Thanks



 Comments   
Comment by Dawid Szymaniuk-Paryż [ 2019-10-21 ]

Hi, any chance that someone will look at this issue?

Comment by Sergei Golubchik [ 2019-10-24 ]

In MariaDB 5.3 to 10.0 the binary format for high-res temporal values is different from what MySQL is using (because MariaDB implementation predates MySQL 5.6 implementation).

You have some kind of a binlog reader client, and apparently it expects MySQL high-res temporal values in the binlog and is not compatible with MariaDB binlog.

In 10.1 you can use --opt_mysql56_temporal_format option to make MariaDB to use MySQL-compatible temporal format. In 10.0 there is no way to do it.

Besides, 10.0 has reached end of life more than a half a year ago, there will be no more 10.0 releases. There is nothing we can change in 10.0 at this point.

Generated at Thu Feb 08 09:02:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.