readyset icon indicating copy to clipboard operation
readyset copied to clipboard

MySQL replicated Timestamp fields are always UTC

Open altmannmarcelo opened this issue 8 months ago • 0 comments

Description

MySQL stores timestamp internally as UTC and convert them to timezone specified at time_zone variable.

During snapshot we are getting the correct value for timestamp fields as we are running a select. However, during replication we are always getting UTC.

create table test.t (ts timestamp);
insert into t values ('2024-01-01 10:00:00');
-- start readyset
insert into t values ('2024-01-01 10:00:00');
CREATE CACHE FROM SELECT * FROM t;
SELECT * FROM t;

-- result on my system (UTC-3)
mysql> SELECT * FROM t;
+---------------------+
| ts                  |
+---------------------+
| 2024-01-01 10:00:00 |
| 2024-01-01 13:00:00 |
+---------------------+
2 rows in set (0,00 sec)

Change in user-visible behavior

Requires documentation change

altmannmarcelo avatar Jun 24 '24 12:06 altmannmarcelo