Bug #105517 INSERT of CURRENT_TIMESTAMP() vs. DEFAULT differs for TIMESTAMP field
| Submitted: | 10 Nov 2021 13:36 | Modified: | 25 Apr 13:02 |
|---|---|---|---|
| Reporter: | Dan Hentschel | Email Updates: | |
| Status: | Can't repeat | Impact on me: | |
| Category: | MySQL Server: Data Types | Severity: | S2 (Serious) |
| Version: | 8.0 | OS: | Any (20.0.4.1) |
| Assigned to: | CPU Architecture: | Any |
[10 Nov 2021 13:36]
Dan Hentschel
[10 Nov 2021 14:04]
MySQL Verification Team
Thank you Mr. Hentschel, We were able to repeat the behaviour on our own machines. It is possible that these two bugs are related, but we can not yet be sure that they are been duplicates. Verified as reported.
[25 Apr 12:53]
Shane Bester
Hello, I've just tried this on 8.0.46 and it was not repeatable anymore. Please check on your side. $ sudo timedatectl set-timezone America/New_York $ sudo service mysqld restart $ sudo date -s "11/07/21 01:59:59-04:00" && mysql -uroot -p test -e "SELECT VERSION(), @@global.system_time_zone;;DROP TABLE IF EXISTS t;CREATE TABLE t(ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);INSERT INTO t() VALUES();INSERT INTO t(ts) VALUES(CURRENT_TIMESTAMP());SELECT UNIX_TIMESTAMP(ts) FROM t;" Sun Nov 7 01:59:59 EDT 2021 Enter password: +-------------------+---------------------------+ | VERSION() | @@global.system_time_zone | +-------------------+---------------------------+ | 8.0.46-commercial | EST | +-------------------+---------------------------+ +--------------------+ | UNIX_TIMESTAMP(ts) | +--------------------+ | 1636264811 | | 1636264811 | +--------------------+ $
[25 Apr 12:59]
Shane Bester
However, I couldn't repeat it on 8.0.17 either. $ sudo date -s "11/07/21 01:59:59-04:00" && > mysql -uroot -p test -e "SELECT VERSION(), @@global.system_time_zone;;DROP TABLE IF EXISTS t;CREATE TABLE t(ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);INSERT INTO t() VALUES();INSERT INTO t(ts) VALUES(CURRENT_TIMESTAMP());SELECT UNIX_TIMESTAMP(ts) FROM t;" Sun Nov 7 01:59:59 EDT 2021 Enter password: +-------------------+---------------------------+ | VERSION() | @@global.system_time_zone | +-------------------+---------------------------+ | 8.0.17-commercial | EST | +-------------------+---------------------------+ +--------------------+ | UNIX_TIMESTAMP(ts) | +--------------------+ | 1636264810 | | 1636264810 | +--------------------+ $
[25 Apr 13:02]
Shane Bester
Neither on 8.0.27. $ sudo date -s "11/07/21 01:59:59-04:00" && mysql -uroot -p test -e "SELECT VERSION(), @@global.system_time_zone;;DROP TABLE IF EXISTS t;CREATE TABLE t(ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);INSERT INTO t() VALUES();INSERT INTO t(ts) VALUES(CURRENT_TIMESTAMP());SELECT UNIX_TIMESTAMP(ts) FROM t;" Sun Nov 7 01:59:59 EDT 2021 Enter password: +-------------------+---------------------------+ | VERSION() | @@global.system_time_zone | +-------------------+---------------------------+ | 8.0.27-commercial | EST | +-------------------+---------------------------+ +--------------------+ | UNIX_TIMESTAMP(ts) | +--------------------+ | 1636264805 | | 1636264805 | +--------------------+ $
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.