readyset
readyset copied to clipboard
MySQL replicated Timestamp fields are always UTC
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