Bug #82414 Incorrect charset in INFORMATION_SCHEMA
Submitted: 2 Aug 2016 16:01 Modified: 2 Aug 2016 16:20
Reporter: Ryan Lowe Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.7, 5.7.14 OS:Any
Assigned to: CPU Architecture:Any

[2 Aug 2016 16:01] Ryan Lowe
Description:
> SHOW CREATE TABLE INFORMATION_SCHEMA.GLOBAL_VARIABLES\G
*************************** 1. row ***************************
       Table: GLOBAL_VARIABLES
Create Table: CREATE TEMPORARY TABLE `GLOBAL_VARIABLES` (
  `VARIABLE_NAME` varchar(64) NOT NULL DEFAULT '',
  `VARIABLE_VALUE` varchar(1024) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

When I set log_bin as follows:

log-bin=💩

It correctly sets the files on disk:

-rw-rw----   1 rlowe  1278   174B Aug  2 08:34 💩.000001
-rw-rw----   1 rlowe  1278   174B Aug  2 08:40 💩.000002
-rw-rw----   1 rlowe  1278   151B Aug  2 08:53 💩.000003
-rw-rw----   1 rlowe  1278    42B Aug  2 08:53 💩.index

But I cannot accurately retrieve log_bin_basename:

> SHOW GLOBAL VARIABLES LIKE 'log_bin_basename';
+------------------+-----------------------------------------------------------+
| Variable_name    | Value                                                     |
+------------------+-----------------------------------------------------------+
| log_bin_basename | /Users/rlowe/sandboxes/rsandbox_mysql-5_6_23/master/data/ |
+------------------+-----------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)

> SHOW WARNINGS;
+---------+------+---------------------------------------------------------------------------------+
| Level   | Code | Message                                                                         |
+---------+------+---------------------------------------------------------------------------------+
| Warning | 1366 | Incorrect string value: '\xF0\x9F\x92\xA9' for column 'VARIABLE_VALUE' at row 1 |
+---------+------+---------------------------------------------------------------------------------+
1 row in set (0.00 sec)

How to repeat:
Follow the steps above

Suggested fix:
Disallow utf8mb4 characters when setting log_bin OR change the character set of GLOBAL_VARIABLES
[2 Aug 2016 16:20] MySQL Verification Team
Hello Lowe Ryan,

Thank you for the report.

Thanks,
Umesh