Bug #16697 Erratic behaviour of TIMESTAMPDIFF()
| Submitted: | 21 Jan 2006 10:05 | Modified: | 21 Jan 2006 13:11 |
|---|---|---|---|
| Reporter: | Julien Bonastre | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 5.0.15-log | OS: | Other (OpenBSD 3.7 i386-release) |
| Assigned to: | CPU Architecture: | Any |
[21 Jan 2006 10:05]
Julien Bonastre
[21 Jan 2006 10:18]
Valeriy Kravchuk
Thank you for a problem report. Looks like in current 5.0.19-BK (ChangeSet@1.1997, 2006-01-20 17:21:39+03:00) there is no such problem: mysql> set @TS1 = '2006-01-21 19:52:05'; Query OK, 0 rows affected (0.00 sec) mysql> set @TS2 = '2007-01-21 18:30:14'; Query OK, 0 rows affected (0.00 sec) mysql> SELECT TIMESTAMPDIFF(MONTH, @TS1, @TS2); +----------------------------------+ | TIMESTAMPDIFF(MONTH, @TS1, @TS2) | +----------------------------------+ | 12 | +----------------------------------+ 1 row in set (0.03 sec) mysql> SELECT TIMESTAMPDIFF(YEAR, @TS1, @TS2); +---------------------------------+ | TIMESTAMPDIFF(YEAR, @TS1, @TS2) | +---------------------------------+ | 1 | +---------------------------------+ 1 row in set (0.00 sec) mysql> SELECT TIMESTAMPDIFF(DAY, @TS1, @TS2); +--------------------------------+ | TIMESTAMPDIFF(DAY, @TS1, @TS2) | +--------------------------------+ | 364 | +--------------------------------+ 1 row in set (0.00 sec) mysql> select version(); +-----------+ | version() | +-----------+ | 5.0.19 | +-----------+ 1 row in set (0.00 sec) So, please, try to upgrade to 5.0.18, check once more and inform about the results.
[21 Jan 2006 13:11]
Julien Bonastre
Thank you so much for verifying this bug. Fantastic prompt response too, thank you again. I will try with latest version.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 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.