Bug #109482 The mysql slow query log contains invalid content, and the mysql common log file
Submitted: 25 Dec 2022 9:33 Modified: 26 Dec 2022 4:56
Reporter: xichao li (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:8.0.27 OS:Any
Assigned to: CPU Architecture:Any

[25 Dec 2022 9:33] xichao li
Description:
Each time mysql is started, the slow query log contains invalid content (which should only be in the general log content) :

Time                 Id Command    Argument

And with the challenge of the Time format of the new version of mysql, the log format of the mysql common log file is not aligned (Time and Id Spaces are too short) :
Time                 Id Command    Argument
2022-12-23T22:56:16.145610Z	    8 Connect	root@localhost on  using Socket

How to repeat:
Starting the mysql slow query log (slow_query_log) and general_log (general log) Restart the mysql instance. Then view the mysql slow query log, general log.

Suggested fix:
The content will be in the code file sql/log.cc

    end =
        my_stpncpy(buff + len, "Time                 Id Command    Argument\n",
                   sizeof(buff) - len);
    
    Replace with:
    
    if (log_type == QUERY_LOG_GENERAL)
      end =
        my_stpncpy(buff + len, "Time                               Id Command    Argument\n",
                   sizeof(buff) - len);
    else
      end = buff + len;
[26 Dec 2022 4:56] MySQL Verification Team
Hello xichao li,

Thank you for the report and feedback.

regards,
Umesh