EVOLUTION-MANAGER
Edit File: timestamp.result
for master_1 for child2 child2_1 child2_2 child2_3 for child3 child3_1 child3_2 child3_3 Initialize Time Zone connection master_1; SET GLOBAL time_zone='MET'; SET time_zone='MET'; connection child2_1; SET GLOBAL time_zone='MET'; SET time_zone='MET'; drop and create databases connection master_1; DROP DATABASE IF EXISTS ts_test_local; CREATE DATABASE ts_test_local; USE ts_test_local; connection child2_1; SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; DROP DATABASE IF EXISTS ts_test_remote; CREATE DATABASE ts_test_remote; USE ts_test_remote; test select 1 connection master_1; SELECT 1; 1 1 connection child2_1; SELECT 1; 1 1 create table connection child2_1; CHILD2_1_DROP_TABLE CHILD2_1_DROP_TABLE_F CHILD2_1_CREATE_TABLE CHILD2_1_CREATE_TABLE_F TRUNCATE TABLE mysql.general_log; connection master_1; DROP TABLE IF EXISTS tbl_a; CREATE TABLE tbl_a ( col_a INT UNSIGNED NOT NULL AUTO_INCREMENT, col_dt DATETIME, col_ts TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY(col_a), UNIQUE INDEX i_ts (col_ts) ) MASTER_1_ENGINE MASTER_1_AUTO_INCREMENT_2_1 MASTER_1_COMMENT_2_1 CREATE TABLE tbl_f ( col_d DATE, col_t TIME ) ENGINE=Spider COMMENT='database "ts_test_remote", table "tbl_f", srv "s_2_1"' SHOW CREATE TABLE tbl_a; Table Create Table tbl_a CREATE TABLE `tbl_a` ( `col_a` int(10) unsigned NOT NULL AUTO_INCREMENT, `col_dt` datetime DEFAULT NULL, `col_ts` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`col_a`), UNIQUE KEY `i_ts` (`col_ts`) ) ENGINE=SPIDER AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='database "ts_test_remote", table "tbl_a", srv "s_2_1"' SHOW CREATE TABLE tbl_f; Table Create Table tbl_f CREATE TABLE `tbl_f` ( `col_d` date DEFAULT NULL, `col_t` time DEFAULT NULL ) ENGINE=SPIDER DEFAULT CHARSET=latin1 COMMENT='database "ts_test_remote", table "tbl_f", srv "s_2_1"' Set a different time zone that has DST SET time_zone='+01:00'; Insert Rows connection master_1; Min value SET @@timestamp=1; INSERT INTO tbl_a VALUES (1, now(), now()); SET @@timestamp=0; Ambiguous DST values for MET time zone that result in the same UTC timestamp INSERT INTO tbl_a VALUES (2, '2018-03-25 02:00:00', '2018-03-25 02:00:00'); INSERT INTO tbl_a VALUES (3, '2018-03-25 02:30:00', '2018-03-25 02:30:00'); Ambiguous DST values for MET time zone in the 2:00 am to 3:00 am hour that occur twice when transitioning from DST to standard time SET @@timestamp=1540686600; INSERT INTO tbl_a VALUES (4, now(), now()); SET @@timestamp=1540690200; INSERT INTO tbl_a VALUES (5, now(), now()); Max value SET @@timestamp=2147483647; INSERT INTO tbl_a VALUES (6, now(), now()); SET @@timestamp=0; SELECTs connection child2_1; TRUNCATE TABLE mysql.general_log; connection master_1; SELECT *, unix_timestamp(col_ts) FROM tbl_a; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 connection child2_1; SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; argument select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 03:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 03:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 02:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 DELETEs connection child2_1; TRUNCATE TABLE mysql.general_log; connection master_1; DELETE FROM tbl_a WHERE col_ts='1970-01-01 01:00:01'; SELECT *, unix_timestamp(col_ts) FROM tbl_a; col_a col_dt col_ts unix_timestamp(col_ts) 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 connection child2_1; SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; argument select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; col_a col_dt col_ts unix_timestamp(col_ts) 2 2018-03-25 02:00:00 2018-03-25 03:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 03:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 02:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 connection child2_1; TRUNCATE TABLE mysql.general_log; connection master_1; SET @@timestamp=1; INSERT INTO tbl_a VALUES (1, now(), now()); SET @@timestamp=0; SELECT *, unix_timestamp(col_ts) FROM tbl_a; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 connection child2_1; SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; argument select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 03:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 03:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 02:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 UPDATEs connection child2_1; TRUNCATE TABLE mysql.general_log; connection master_1; UPDATE tbl_a SET col_ts=col_dt; SELECT *, unix_timestamp(col_ts) FROM tbl_a; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 connection child2_1; SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; argument select `col_a`,`col_dt`,`col_ts` from `ts_test_remote`.`tbl_a` for update select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 03:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 03:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 02:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 Lookups connection child2_1; TRUNCATE TABLE mysql.general_log; connection master_1; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > '2018-01-01'; col_a col_dt col_ts unix_timestamp(col_ts) 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts < '2018-10-28 02:30:00'; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE '2018-10-28 02:30:00' > col_ts; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts BETWEEN '2018-10-28 01:30:00' AND '2018-10-28 02:30:00'; col_a col_dt col_ts unix_timestamp(col_ts) 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts >= '2018-10-28 01:30:00' AND col_ts <= '2018-10-28 02:30:00'; col_a col_dt col_ts unix_timestamp(col_ts) 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 180325020000; col_a col_dt col_ts unix_timestamp(col_ts) 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 19700101010001; col_a col_dt col_ts unix_timestamp(col_ts) 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 connection child2_1; SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; argument select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '2017-12-31 23:00:00') select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` < '2018-10-28 01:30:00') select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where ('2018-10-28 01:30:00' > t0.`col_ts`) select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` between '2018-10-28 00:30:00' and '2018-10-28 01:30:00') select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where ((t0.`col_ts` >= '2018-10-28 00:30:00') and (t0.`col_ts` <= '2018-10-28 01:30:00')) select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '2018-03-25 01:00:00') select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '1970-01-01 00:00:01') SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 03:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 03:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 02:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 Drop the index on the timestamp column connection child2_1; DROP INDEX i_ts ON tbl_a; SHOW CREATE TABLE tbl_a; Table Create Table tbl_a CREATE TABLE `tbl_a` ( `col_a` int(10) unsigned NOT NULL AUTO_INCREMENT, `col_dt` datetime DEFAULT NULL, `col_ts` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`col_a`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 TRUNCATE TABLE mysql.general_log; connection master_1; DROP INDEX i_ts ON tbl_a; SHOW CREATE TABLE tbl_a; Table Create Table tbl_a CREATE TABLE `tbl_a` ( `col_a` int(10) unsigned NOT NULL AUTO_INCREMENT, `col_dt` datetime DEFAULT NULL, `col_ts` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`col_a`) ) ENGINE=SPIDER AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='database "ts_test_remote", table "tbl_a", srv "s_2_1"' Retry lookups on unindexed timestamp column connection child2_1; TRUNCATE TABLE mysql.general_log; connection master_1; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > '2018-01-01'; col_a col_dt col_ts unix_timestamp(col_ts) 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts < '2018-10-28 02:30:00'; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE '2018-10-28 02:30:00' > col_ts; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts BETWEEN '2018-10-28 01:30:00' AND '2018-10-28 02:30:00'; col_a col_dt col_ts unix_timestamp(col_ts) 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts >= '2018-10-28 01:30:00' AND col_ts <= '2018-10-28 02:30:00'; col_a col_dt col_ts unix_timestamp(col_ts) 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 180325020000; col_a col_dt col_ts unix_timestamp(col_ts) 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 19700101010001; col_a col_dt col_ts unix_timestamp(col_ts) 2 2018-03-25 02:00:00 2018-03-25 02:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 02:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 01:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 connection child2_1; SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; argument select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '2017-12-31 23:00:00') select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` < '2018-10-28 01:30:00') select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where ('2018-10-28 01:30:00' > t0.`col_ts`) select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` between '2018-10-28 00:30:00' and '2018-10-28 01:30:00') select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where ((t0.`col_ts` >= '2018-10-28 00:30:00') and (t0.`col_ts` <= '2018-10-28 01:30:00')) select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '2018-03-25 01:00:00') select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '1970-01-01 00:00:01') SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; col_a col_dt col_ts unix_timestamp(col_ts) 1 1970-01-01 01:00:01 1970-01-01 01:00:01 1 2 2018-03-25 02:00:00 2018-03-25 03:00:00 1521939600 3 2018-03-25 02:30:00 2018-03-25 03:30:00 1521941400 4 2018-10-28 01:30:00 2018-10-28 02:30:00 1540686600 5 2018-10-28 02:30:00 2018-10-28 02:30:00 1540690200 6 2038-01-19 04:14:07 2038-01-19 04:14:07 2147483647 Test the TIMESTAMP function connection master_1; INSERT INTO tbl_f VALUES ('2018-06-24', '01:23:45'), ('2018-06-24', '01:23:45'), ('2018-08-01', '12:34:56'); connection child2_1; TRUNCATE TABLE mysql.general_log; connection master_1; SELECT * FROM tbl_f; col_d col_t 2018-06-24 01:23:45 2018-06-24 01:23:45 2018-08-01 12:34:56 SELECT TIMESTAMP(col_d, col_t) FROM tbl_f; TIMESTAMP(col_d, col_t) 2018-06-24 01:23:45 2018-06-24 01:23:45 2018-08-01 12:34:56 SELECT TIMESTAMP('2018-06-25', col_t) FROM tbl_f; TIMESTAMP('2018-06-25', col_t) 2018-06-25 01:23:45 2018-06-25 01:23:45 2018-06-25 12:34:56 SELECT TIMESTAMP(col_d, '10:43:21') FROM tbl_f; TIMESTAMP(col_d, '10:43:21') 2018-06-24 10:43:21 2018-06-24 10:43:21 2018-08-01 10:43:21 SELECT TIMESTAMP('2018-06-25', '10:43:21') FROM tbl_f; TIMESTAMP('2018-06-25', '10:43:21') 2018-06-25 10:43:21 2018-06-25 10:43:21 2018-06-25 10:43:21 connection child2_1; SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; argument select t0.`col_d` `col_d`,t0.`col_t` `col_t` from `ts_test_remote`.`tbl_f` t0 select (timestamp(t0.`col_d` , t0.`col_t`)) `TIMESTAMP(col_d, col_t)` from `ts_test_remote`.`tbl_f` t0 select (timestamp('2018-06-25' , t0.`col_t`)) `TIMESTAMP('2018-06-25', col_t)` from `ts_test_remote`.`tbl_f` t0 select (timestamp(t0.`col_d` , '10:43:21')) `TIMESTAMP(col_d, '10:43:21')` from `ts_test_remote`.`tbl_f` t0 select (timestamp('2018-06-25' , '10:43:21')) `TIMESTAMP('2018-06-25', '10:43:21')` from `ts_test_remote`.`tbl_f` t0 SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' SELECT col_d, col_t FROM tbl_f; col_d col_t 2018-06-24 01:23:45 2018-06-24 01:23:45 2018-08-01 12:34:56 Restore Time Zone settings connection master_1; SET GLOBAL time_zone=DEFAULT; SET time_zone=DEFAULT; connection child2_1; SET GLOBAL time_zone=DEFAULT; SET time_zone=DEFAULT; deinit connection master_1; DROP DATABASE IF EXISTS ts_test_local; connection child2_1; DROP DATABASE IF EXISTS ts_test_remote; SET GLOBAL log_output = @old_log_output; for master_1 for child2 child2_1 child2_2 child2_3 for child3 child3_1 child3_2 child3_3 end of test