Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Incomplete
-
10.1.14
-
Description
We have setup a replication from MySQL Master, to MariaDB.
if we perform "select now();" in mysql console, both master and mariadb return correct time.
However, the now() in trigger is incorrect.
(Remarks: the timezone in Mariadb is "US/Eastern", the timezone in MySQL is "America/New_York")
------------------------------------------------------------------------------------
Here is the script to reproduce the bug:
select now(); |
/*both mysql and mariadb return '2016-09-07 22:09:47' */
|
|
/*In mysql: */
|
CREATE TABLE `table_a` ( |
`id` int(11) NOT NULL AUTO_INCREMENT, |
`price` int(11) NOT NULL, |
PRIMARY KEY (`id`) |
) ENGINE=InnoDB;
|
|
CREATE TABLE `table_a_log` ( |
`id` int(11) NOT NULL AUTO_INCREMENT, |
`price` int(11) NOT NULL, |
`logged_at` datetime NOT NULL, |
PRIMARY KEY (`id`) |
) ENGINE=InnoDB;
|
|
DELIMITER ;;
|
CREATE TRIGGER table_a_trigger AFTER UPDATE ON table_a |
FOR EACH ROW |
BEGIN |
INSERT INTO table_a_log (id, price, logged_at) |
VALUES (NEW.id, NEW.price, NOW()); |
END;; |
DELIMITER ;
|
|
insert into table_a(id, price) values (90, 9999); |
update table_a set price = 8888; |
Result |
The table_a_log in mysql has time '2016-09-07 22:09:47'.
|
The table_a_log in mariadb has time '2016-09-08 02:09:47'.
|