Comment 8 for bug 1245934

Revision history for this message
bwitt (brianwitt) wrote :

We have this problem on a few of our hosts; UNIX_TIMESTAMP(ts) is returning fractional values:

$ ./pmp-check-mysql-replication-delay --version
Percona Monitoring Plugins pmp-check-mysql-replication-delay 1.1.3

also pt-heartbeat on the master:
$ /usr/bin/pt-heartbeat --version
pt-heartbeat 2.2.6

mysql> SELECT UTC_TIMESTAMP, UNIX_TIMESTAMP(UTC_TIMESTAMP), ts, UNIX_TIMESTAMP(ts), UNIX_TIMESTAMP(UTC_TIMESTAMP) - UNIX_TIMESTAMP(ts) FROM heartbeat;
+---------------------+-------------------------------+----------------------------+--------------------+----------------------------------------------------+
| UTC_TIMESTAMP | UNIX_TIMESTAMP(UTC_TIMESTAMP) | ts | UNIX_TIMESTAMP(ts) | UNIX_TIMESTAMP(UTC_TIMESTAMP) - UNIX_TIMESTAMP(ts) |
+---------------------+-------------------------------+----------------------------+--------------------+----------------------------------------------------+
| 2014-05-12 23:25:03 | 1399937103 | 2014-05-12T23:25:03.000370 | 1399937103.000370 | -0.000370 |
| 2014-05-12 23:25:03 | 1399937103 | 2014-05-12T23:25:03.000410 | 1399937103.000410 | -0.000410 |
+---------------------+-------------------------------+----------------------------+--------------------+----------------------------------------------------+
2 rows in set (0.00 sec)

we're using
ii percona-nagios-plugins 1.1.3-1
ii percona-server-client-5.6 1:5.6.15-rel63.0-519.precise
ii percona-server-common-5.6 1:5.6.15-rel63.0-519.precise
ii percona-server-server-5.6 1:5.6.15-rel63.0-519.precise
ii percona-toolkit 2.2.6

Everything seems to work fine on the hosts that have mysql 5.5 and 5.1.

Is that because since 5.6.4, these functions now work with fractional values?
http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html#function_unix-timestamp