Bug #77833 Option to modify connection attributes for a connection
Submitted: 25 Jul 2015 11:55
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Connection Handling Severity:S4 (Feature request)
Version:5.7.8 OS:Any
Assigned to: CPU Architecture:Any

[25 Jul 2015 11:55] Daniël van Eeden
Description:
With mysql_options4() connection attributes can be set who will be sent to the server.

Please make it possible to modify connection attributes for a running connection.

Some examples:
1. Webapp with persistent connections who wants to sent a 'proxy-for' attribute to indicate the username of the client which talks to the webapp.
2. Cronjob which want to report the stage it is in

How to repeat:
See description

Suggested fix:
From SQL:
UPDATE performance_schema.session_connect_attrs SET ATTR_VALUE='testapp' WHERE PROCESSLIST_ID=CONNECTION_ID() AND ATTR_NAME='program_name';

From API:
mysql_update_connattr('program_name','testapp');