Bug #101357 Bug in MySQL Role MySQL community 8.0.21
Submitted: 28 Oct 2020 13:20 Modified: 29 Oct 2020 0:04
Reporter: lokesh singhal Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version: OS:Windows (10)
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: general_log

[28 Oct 2020 13:20] lokesh singhal
Description:
when I enable general log.

config: my.cnf
 

general_log=1
log_output=TABLE

================================================

CREATE TABLE mysql.general_log (
  `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `thread_id` bigint unsigned NOT NULL,
  `server_id` int unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumblob NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8mb4 COMMENT='General log';

general_log does not start.

	

How to repeat:

general_log=1
log_output=TABLE
==============================================================

CREATE TABLE mysql.general_log (
  `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `thread_id` bigint unsigned NOT NULL,
  `server_id` int unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumblob NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8mb4 COMMENT='General log';

Suggested fix:
When I set CHARSET=utf8 It works fine with a warning.

CREATE TABLE mysql.general_log (
  `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `thread_id` bigint unsigned NOT NULL,
  `server_id` int unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumblob NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';

 warning:

 warning(s): 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. 
Please consider using UTF8MB4 in order to be unambiguous.
[29 Oct 2020 0:04] MySQL Verification Team
Hi,

You will receive error in the log:

[ERROR] [MY-010013] [Server] Failed to write to mysql.general_log:
[ERROR] [MY-013139] [Server] Incorrect definition of table mysql.general_log: expected the type of column 'user_host' at position 1 to have character set 'utf8' but found character set 'utf8mb4'.

The format of the table attm is with utf8mb3 not mb4, when we change the logging to use utf8mb4 we'll announce it (it will happen).

all best
Bogdan