[MDEV-32930] mysqlbinlog --verbose shows incorrect values for timestamps >= 2^31 if binlog was created with mysql56_temporal_format=off Created: 2023-12-01  Updated: 2024-01-13

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: N/A
Fix Version/s: 11.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Blocks
is blocked by MDEV-14760 Replication does not take into accoun... Stalled
Problem/Incident
is caused by MDEV-32188 make TIMESTAMP use whole 32-bit unsig... In Testing
Relates
relates to MDEV-32929 mysqlbinlog --verbose fails if binlog... Open

 Description   

--source include/have_binlog_format_row.inc
 
set @format.save= @@mysql56_temporal_format;
set global mysql56_temporal_format= off;
 
create table t (a timestamp);
insert into t values (from_unixtime(power(2,31)));
 
--let $datadir= `select @@datadir`
flush binary logs;
--exec $MYSQL_BINLOG --verbose $datadir/master-bin.000001
 
drop table t;
set global mysql56_temporal_format= @format.save;

bb-11.3-timestamp fd6689da3fffc4d57d8ebde5f8776aefa8cdb8a4

### INSERT INTO `test`.`t`
### SET
###   @1=-2147483648



 Comments   
Comment by Elena Stepanova [ 2023-12-01 ]

I'm not setting it as a feature blocker, because mysqlbinlog doesn't work correctly with mysql56_temporal_format=off anyway (e.g. MDEV-32929).

Comment by Michael Widenius [ 2023-12-19 ]

The problem here is similar to other cases with binary logging that we do not send the slave the environment in which the table was created, like engine, mysql56_temporal_format and other parameters that affects create table and alter table.
MDEV-14760 is supposed to fix this one

Comment by Michael Widenius [ 2023-12-20 ]

Two ways to fix it independent of MDEV-14760:

1) Store things in the binary log always in 'mysql56_temporal_format' and ensure that if the slave has this off, it will do the conversion.
2) Have a flag in the binary log for the table event where we have a bit if this variable is off. In this case we have of course to convert things if needed on the slave side if the timestamp type does not match.

Generated at Thu Feb 08 10:35:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.