[MDEV-29078] For old binary logs explicit_defaults_for_timestamp presumed to be OFF, server value ignored Created: 2022-07-10 Updated: 2022-09-07 Resolved: 2022-08-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication, Variables |
| Affects Version/s: | 10.5, 10.6, 10.7, 10.8, 10.9 |
| Fix Version/s: | 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Before Now it expects to find explicit_defaults_for_timestamp in the binary log, which is good; but when it's not there (the log is created by a server which doesn't yet have this functionality), it apparently falls back to "always OFF". While it will work for the vast majority of old masters (those which have the default explicit_defaults_for_timestamp=off), it will make OM => NS replication impossible for those remaining ones which have non-default explicit_defaults_for_timestamp=on already. The other option would be to fall back to the value configured on the slave instead. It will require an additional action from users with the default OFF on the old master, but it will keep the replication configurable for those who have ON on the master. So, it is a judgement call which needs to be thought through and at least documented explicitly. MySQL seems to use the server value in such case. An example of the old log is attached for convenience (naturally it is easy to create by any existing server). It was produced on a 10.6.8 server started with explicit_defaults_for_timestamp=on and binlog_format=row. A table with two timestamps was created
and a (NULL,NULL) row was inserted.
On the original server the result is a table with nullable columns and NULL values (as the row event also demonstrates),
while on the preview server started with the new default explicit_defaults_for_timestamp=on, after replaying the log it is
|
| Comments |
| Comment by Sergei Golubchik [ 2022-07-23 ] | |||||||||||||||||||
|
Elkin, please, take a look at commits https://github.com/MariaDB/server/commit/e19254ef90f and https://github.com/MariaDB/server/commit/f852b1b153a | |||||||||||||||||||
| Comment by Andrei Elkin [ 2022-07-26 ] | |||||||||||||||||||
|
I pushed a "review" commit into bb-10.10-MDEV-28632-review that covers two findings. | |||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-07-27 ] | |||||||||||||||||||
|
Applied, slightly modified. Added a test case. | |||||||||||||||||||
| Comment by Andrei Elkin [ 2022-07-28 ] | |||||||||||||||||||
|
That's
even nicer! Thanks for the replication contribution |