Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.14, 10.0.15
-
None
Description
Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL. This does not happen on any other types of column and does not depend on table engine. This does not happen on MySQL 5.5.40, 5.6.21, but does on MariaDB 10.0.14 and 10.0.15.
How to repeat:
-- create table
|
drop table if exists foo; |
create table foo(value TIMESTAMP NOT NULL); |
|
-- insert one row
|
insert foo set value=now(); |
|
-- update of 1 row takes 2 seconds instead of 1 second
|
update foo set value=sleep(1); |
|
-- insert one more row (two rows total)
|
insert foo set value=now(); |
|
-- update of 2 rows takes 4 seconds instead of 2 seconds
|
update foo set value=sleep(1); |
|
|
-- ----------------------------------------
|
-- just for fun - make it NULL instead of NOT NULL:
|
alter table foo modify column value TIMESTAMP NULL; |
|
-- update of 2 rows takes 2 seconds, as expected
|
update foo set value=sleep(1); |