Bug #95775 Version 5.6 has the wrong format for slow logging time
Description:
There is a problem with the time output format of the following code in the function MYSQL_QUERY_LOG::write.
----------------
buff_len= my_snprintf(buff, sizeof buff,
"# Time: %02d%02d%02d %2d:%02d:%02d\n",
start.tm_year % 100, start.tm_mon + 1,
start.tm_mday, start.tm_hour,
start.tm_min, start.tm_sec);
----------------
You will find that the output format of hours is %2d, the correct should be %02d.
How to repeat:
There is a problem with the time output format of the following code in the function MYSQL_QUERY_LOG::write.
----------------
buff_len= my_snprintf(buff, sizeof buff,
"# Time: %02d%02d%02d %2d:%02d:%02d\n",
start.tm_year % 100, start.tm_mon + 1,
start.tm_mday, start.tm_hour,
start.tm_min, start.tm_sec);
----------------
You will find that the output format of hours is %2d, the correct should be %02d.
Suggested fix:
There is a problem with the time output format of the following code in the function MYSQL_QUERY_LOG::write.
----------------
buff_len= my_snprintf(buff, sizeof buff,
"# Time: %02d%02d%02d %2d:%02d:%02d\n",
start.tm_year % 100, start.tm_mon + 1,
start.tm_mday, start.tm_hour,
start.tm_min, start.tm_sec);
----------------
You will find that the output format of hours is %2d, the correct should be %02d.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.051 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.
Description: There is a problem with the time output format of the following code in the function MYSQL_QUERY_LOG::write. ---------------- buff_len= my_snprintf(buff, sizeof buff, "# Time: %02d%02d%02d %2d:%02d:%02d\n", start.tm_year % 100, start.tm_mon + 1, start.tm_mday, start.tm_hour, start.tm_min, start.tm_sec); ---------------- You will find that the output format of hours is %2d, the correct should be %02d. How to repeat: There is a problem with the time output format of the following code in the function MYSQL_QUERY_LOG::write. ---------------- buff_len= my_snprintf(buff, sizeof buff, "# Time: %02d%02d%02d %2d:%02d:%02d\n", start.tm_year % 100, start.tm_mon + 1, start.tm_mday, start.tm_hour, start.tm_min, start.tm_sec); ---------------- You will find that the output format of hours is %2d, the correct should be %02d. Suggested fix: There is a problem with the time output format of the following code in the function MYSQL_QUERY_LOG::write. ---------------- buff_len= my_snprintf(buff, sizeof buff, "# Time: %02d%02d%02d %2d:%02d:%02d\n", start.tm_year % 100, start.tm_mon + 1, start.tm_mday, start.tm_hour, start.tm_min, start.tm_sec); ---------------- You will find that the output format of hours is %2d, the correct should be %02d.