Support for sending connection attributes#737
Support for sending connection attributes#737Vasfed wants to merge 6 commits intogo-sql-driver:masterfrom
Conversation
628d6aa to
c6deadb
Compare
There was a problem hiding this comment.
- This feature requires the
performance_schemato be enabled on the server, so this should be clearly documented with the option. - Rename the option to
connectAttrsas this feature is namedconnect_attrsin MySQL. AlsoConnectAttrsinstead ofAttributesin structConfig. TestConnectionAttributesshould use tableINFORMATION_SCHEMA.PROCESSLISTinstead ofsys.processlistif possible because thesysschema is introduced only in MySQL 5.7.7.
3ee4429 to
b2c046d
Compare
|
Removed |
|
@dolmen fixed your suggestions. |
|
Rebased onto current master to resolve merge conflicts |
|
Commit "Fix excessive null-termination for auth data in handshake" do not seem related to this PR. Or is it? |
|
@dolmen strictly speaking - it is not, and can be merged alone, but it was included because until it is fixed this PR cannot be merged. |
|
It would be useful to add tests and make them run under Travis-CI (see file .travis.yml). Here is a scenario:
|
Summary: In order to be able track Go client usage we enable sending connection attributes as specified in https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_handshake_response.html (CLIENT_CONNECT_ATTRS). This commit is based on PR go-sql-driver#1241 which is based on PR go-sql-driver#737 (which are still open as of 11.04.2023) Test Plan: manual integration test will be added to the main repo Reviewers: amakarovych-ua, okramarenko-ua Reviewed By: okramarenko-ua Subscribers: engineering-list Differential Revision: https://grizzly.internal.memcompute.com/D61981
Description
This PR adds support for sending connection attributes, which are used for identifying individual connections in mysql. (https://dev.mysql.com/doc/refman/5.7/en/performance-schema-connection-attribute-tables.html)
For example libmysql sets attributes
_client_name,_pid,_client_version,_os,_platform. This adds default_client_name=go-mysql-driverChecklist