Bug #92021 Huge Uptime value following restart
Submitted: 15 Aug 2018 12:32 Modified: 15 Aug 2018 16:56
Reporter: Kristian Davies Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.6.40 OS:Red Hat (CentOS Linux release 7.4.1708 (Core))
Assigned to: CPU Architecture:Any

[15 Aug 2018 12:32] Kristian Davies
Description:
Just rebooted machine.  When I reconnected to mysql uptime was huge:

| Uptime                                        | 18446744073709530299 |
| Uptime_since_flush_status                     | 18446744073709530299 |

mysql> select @@version;
+------------+
| @@version  |
+------------+
| 5.6.40-log |
+------------+
1 row in set (0.00 sec)

How to repeat:
Seems it's a one off.
[15 Aug 2018 13:12] MySQL Verification Team
Thank you for the bug report. Looks duplicate/related with: https://bugs.mysql.com/bug.php?id=50378.
[15 Aug 2018 13:31] Kristian Davies
Agreed.  I already saw that bug but since it was so old I created another.

Do you want to merge them or... add my version to that other bug or should I update and close this or....?
[15 Aug 2018 16:56] MySQL Verification Team
Thank you for the feedback. I will raise the severity of https://bugs.mysql.com/bug.php?id=50378 and comment it with a link of this bug, so changing the status of this bug as duplicate which is our normal process mainly when the older has a test case. Thanks.
[10 Jan 2021 9:07] Kai Qiu
Hi

When there is a system time change and MySQL restarts, the status value of uptime becomes very large

----- version 8.0.20

mysql> status;
--------------
mysql  Ver 8.0.20 for Linux on x86_64 (MySQL Community Server - GPL)

UNIX socket:            /opt/mydata/8020/8020.sock
Binary data as:         Hexadecimal
Uptime:                 8 min 20 sec

---- Change to a system time yet to come 

[root@oel76seed ~]# date -s "Dec 12 01:22:00"
Sun Dec 12 01:22:00 WIB 2021
[root@oel76seed ~]#

mysql> status;
--------------
mysql  Ver 8.0.20 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:          849
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         8.0.20 MySQL Community Server - GPL
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:            /opt/mydata/8020/8020.sock
Binary data as:         Hexadecimal
Uptime:                 337 days 9 hours 16 min 53 sec

Threads: 8  Questions: 9841  Slow queries: 0  Opens: 389  Flush tables: 3  Open tables: 310  Queries per second avg: 0.000
--------------

mysql> show status like 'uptime%';
+---------------------------+----------+
| Variable_name             | Value    |
+---------------------------+----------+
| Uptime                    | 29150420 |
| Uptime_since_flush_status | 29149978 |
+---------------------------+----------+
2 rows in set (0.00 sec)

mysql> select now() - interval 29150420 second;
+----------------------------------+
| now() - interval 29150420 second |
+----------------------------------+
| 2021-01-08 17:05:30              |
+----------------------------------+
1 row in set (0.00 sec)

---- Modify back to the current system time

[root@oel76seed ~]#
[root@oel76seed ~]# date -s "Jan 8 01:22:00"
Fri Jan  8 01:22:00 WIB 2021

mysql> show status like 'uptime%';
+---------------------------+----------------------+
| Variable_name             | Value                |
+---------------------------+----------------------+
| Uptime                    | 18446744073709498628 |
| Uptime_since_flush_status | 18446744073709498186 |
+---------------------------+----------------------+
2 rows in set (0.00 sec)

mysql> select now() - interval 18446744073709498628 second;
+----------------------------------------------+
| now() - interval 18446744073709498628 second |
+----------------------------------------------+
| 2021-01-08 17:05:24                          |
+----------------------------------------------+
1 row in set (0.00 sec)

mysql>
mysql> status;
--------------
mysql  Ver 8.0.20 for Linux on x86_64 (MySQL Community Server - GPL)

Conn.  characterset:    utf8mb4
UNIX socket:            /opt/mydata/8020/8020.sock
Binary data as:         Hexadecimal
Uptime:                 --------------