Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom connection attributes #344

Closed
wants to merge 2 commits into from

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented May 28, 2015

This makes it possible to send custom connection attributes to the server.
Enhances #343

mysql [localhost] {msandbox} (performance_schema) > select * from session_connect_attrs where processlist_id<>connection_id();
+----------------+--------------+-----------------+------------------+
| PROCESSLIST_ID | ATTR_NAME    | ATTR_VALUE      | ORDINAL_POSITION |
+----------------+--------------+-----------------+------------------+
|            125 | _pid         | 8481            |                0 |
|            125 | _platform    | amd64           |                1 |
|            125 | program_name | test2           |                2 |
|            125 | cattr1       | foo             |                3 |
|            125 | cattr2       | bar             |                4 |
|            125 | _os          | darwin          |                5 |
|            125 | _client_name | Go MySQL Driver |                6 |
+----------------+--------------+-----------------+------------------+
7 rows in set (0.00 sec)

This sets attribute _client_name with the value "Go MySQL Driver"
Also sets _os, _platform, _pid and program_name by default.
@dveeden dveeden force-pushed the connattrs_v3 branch 4 times, most recently from 408e0da to 9976395 Compare May 28, 2015 14:48
Uses connattrs=(attr1=val1,attr2=val2) in the DSN

Example DSN: "msandbox:msandbox@(127.0.0.1:5624)/test?connattrs=(cattr1=foo,cattr2=bar)&allowOldPasswords=true"
@julienschmidt
Copy link
Member

Honestly, I don't see any need for setting custom attributes.
Unless someone can convince me otherwise, let's focus on #343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants