[MDEV-17098] DATE -> DATETIME replication conversion not working, even in ALL_NON_LOSSY mode Created: 2018-08-29  Updated: 2023-11-15  Resolved: 2018-10-16

Status: Closed
Project: MariaDB Server
Component/s: Documentation, Replication
Affects Version/s: 5.5, 10.0, 10.1, 10.2.17, 10.3.8, 10.2, 10.3
Fix Version/s: 10.3.11, 10.2.19

Type: Bug Priority: Major
Reporter: Hartmut Holzgraefe Assignee: Andrei Elkin
Resolution: Fixed Votes: 0
Labels: upstream

Issue Links:
Relates
relates to MDEV-17394 Row-based replication DATETIME(m) to ... Open
relates to MDEV-32805 replication from timestamp to datetim... Open

 Description   

When having a DATE column on the master, a DATETIME column on the slave, and binlog_format=ROW, inserting into the table fails on the salve with:

Last_SQL_Error: Column 1 of table 'test.t1' cannot be converted from type 'date' to type 'datetime'

even with slave_type_conversions=ALL_NON_LOSSY, even though a conversion from a DATE to a DATETIME should be a lossles operation.

In the MySQL 5.6 manual this conversion is listed as "not supported before 5.5.3". In the 5.7 and 5.8 versions of the manual this paragraph has been removed, but still DATE and DATETIME are missing from the list of supported operations.

Our own documentation doesn't seem to mention supported conversion types at all.

https://dev.mysql.com/doc/refman/5.6/en/replication-features-differing-tables.html



 Comments   
Comment by Elena Stepanova [ 2018-08-29 ]

Reproducible easily, I'll leave it to Elkin to decide whether it needs to be fixed, or documented, or both.

Comment by Andrei Elkin [ 2018-10-04 ]

Hello, Alexander!

The latest patch is ready for your review and is available in the commit list as well as
on bb-10.2-andrei.

Cheers,

Andrei

Comment by Alexander Barkov [ 2018-10-09 ]

Hi Andrei,

The patch
https://github.com/mariadb/server/commit/9fa03e5295366f66499037e7aaeab342c9ea3887
looks generally find for me.

Please consider reusing these files for new tests:

  • mysql-test/suite/rpl/include/type_conversions.test
  • mysql-test/suite/rpl/include/rpl_typeconv.inc
  • mysql-test/suite/rpl/t/rpl_typeconv.test
Comment by Andrei Elkin [ 2018-10-11 ]

Alexander, the testing part is improved per your request. A new patch 0d5b469fc32 is available for double-checking (bb-10.2-andrei and commit-list). Thanks for checking! Andrei.

Comment by Alexander Barkov [ 2018-10-11 ]

Andrei,

Looks very good for me. Ok to push.
Thanks for addressing proposed suggestions.

Comment by Andrei Elkin [ 2018-10-16 ]

Patch 2308b9afec5 is pushed to 10.2.

Generated at Thu Feb 08 08:33:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.