[MDEV-31208] TIMESTAMP incorrect attributes? Created: 2023-05-06 Updated: 2023-05-06 Resolved: 2023-05-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Create Table |
| Affects Version/s: | 10.6.12 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Christopher Norris | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 22.04 |
||
| Description |
|
I have a table which has an 'updated' timestamp column which on update will update the timestamp, and another timestamp column which may or may not get updated but has no default/on update attributes. I noticed that the other timestamp column was returning the same value as the updated column so looked into it a bit further. It seems DEFAULT and ON UPDATE is being set on the first TIMESTAMP column when not defined in the table definition, it seems to be reset for the second column though.
|
| Comments |
| Comment by Sergei Golubchik [ 2023-05-06 ] |
|
Seems to be in line with https://mariadb.com/kb/en/timestamp/#automatic-values
and so on |
| Comment by Sergei Golubchik [ 2023-05-06 ] |
|
Note also https://mariadb.com/kb/en/server-system-variables/#explicit_defaults_for_timestamp |