[MDEV-19829] CURRENT_TIMESTAMP produces zeros via trigger Created: 2019-06-21 Updated: 2020-08-25 Resolved: 2019-08-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Triggers |
| Affects Version/s: | 5.5, 10.0, 10.1 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Muhammad Irfan | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This already reported upstream https://bugs.mysql.com/bug.php?id=84077
column 'c' contains non-zero date time value. |
| Comments |
| Comment by Alice Sherepa [ 2019-06-24 ] | |||||||||||||||||||||||
|
Reproducible on current 5.5-10.1
| |||||||||||||||||||||||
| Comment by Alexander Barkov [ 2019-08-05 ] | |||||||||||||||||||||||
|
The problem happens because in pre-10.2 versions, Item_trigger_field::save_in_field() is called before Field_timestamp::set_time(), so Item_trigger_field stores the `global` default TIMESTAMP value of '0000-00-00 00:00:00' into the table t2. In 10.2+ this is fixed by these lines in fill_record():
These lines were added by this change set:
monty, please check if it's feasible to backport a part of this commit into earlier versions. Thanks. | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2019-08-05 ] | |||||||||||||||||||||||
|
It was part of a big feature in 10.2, I don't think it could or should be backported into an old GA branch. |