Description:
The standard MySQL clients (mysql, mysqldump, etc.) expose the program name via program_name connection attributes as of 5.6.10:
mysql> SELECT * FROM performance_schema.session_connect_attrs
-> WHERE processlist_id = CONNECTION_ID();
+----------------+-----------------+------------+------------------+
| PROCESSLIST_ID | ATTR_NAME | ATTR_VALUE | ORDINAL_POSITION |
+----------------+-----------------+------------+------------------+
| 94 | _os | Win32 | 0 |
| 94 | _client_name | libmysql | 1 |
| 94 | _pid | 6120 | 2 |
| 94 | _thread | 4740 | 3 |
| 94 | _platform | x86 | 4 |
| 94 | program_name | mysql | 5 |
| 94 | _client_version | 5.6.10 | 6 |
+----------------+-----------------+------------+------------------+
7 rows in set (0.08 sec)
The FEDERATED storage engine, which also uses libmysql, does not set a program_name to identify itself:
mysql> SELECT * FROM performance_schema.session_connect_attrs
-> WHERE processlist_id IN
-> ( SELECT processlist_id
-> FROM performance_schema.session_connect_attrs
-> WHERE attr_name = '_client_name'
-> AND attr_value = 'libmysql'
-> )
-> AND processlist_id NOT IN
-> ( SELECT processlist_id
-> FROM performance_schema.session_connect_attrs
-> WHERE attr_name = 'program_name'
-> );
+----------------+-----------------+------------+------------------+
| PROCESSLIST_ID | ATTR_NAME | ATTR_VALUE | ORDINAL_POSITION |
+----------------+-----------------+------------+------------------+
| 8 | _os | Win32 | 0 |
| 8 | _client_name | libmysql | 1 |
| 8 | _pid | 2240 | 2 |
| 8 | _thread | 5808 | 3 |
| 8 | _platform | x86 | 4 |
| 8 | _client_version | 5.6.10 | 5 |
+----------------+-----------------+------------+------------------+
6 rows in set (0.06 sec)
How to repeat:
1. Create FEDERATED table.
2. Query the FEDERATED table to establish the connection on the target server.
3. Observe that performance_schema.session_connect_attrs table does not show program_name for the associated connection.
Suggested fix:
Add connection attribute for FEDERATED:
program_name: FEDERATED