Bug #77003 Support for connection attributes (contribution)
Submitted: 11 May 2015 16:28 Modified: 6 May 2022 20:52
Reporter: OCA Admin (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / Python Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[11 May 2015 16:28] OCA Admin
Description:
This bug tracks a contribution by Daniël van Eeden (Github user: dveeden) as described in http://github.com/mysql/mysql-connector-python/pull/6

How to repeat:
See description

Suggested fix:
See contribution code attached
[11 May 2015 16:28] OCA Admin
Contribution submitted via Github - Support for connection attributes 
(*) Contribution by Daniël van Eeden (Github dveeden, mysql-connector-python/pull/6#issuecomment-100475909): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_35064641.txt (text/plain), 7.03 KiB.

[12 May 2015 7:20] MySQL Verification Team
Hello!

Thank you for the report and contribution.

Thanks,
Umesh
[12 Jul 2015 15:59] Daniël van Eeden
What's the current status?
Is it ok to be merged?
If not, what's wrong with it?
[6 Jan 2019 16:04] Daniël van Eeden
Any update?
[7 Jan 2019 11:07] Nuno Mariz
Hi Daniel,
We are currently working on this feature.
Thanks for your contribution.
[6 May 2022 20:52] Philip Olson
Posted by developer:
 
This was fixed in 8.0.17 but unfortunately it appears this bug was not closed accordingly, here's the old v8.0.17 release note:

Added connection attribute support for the classic connector; new
connection attributes can be passed in with the "conn_attrs" connection
argument. Thanks to Daniël van Eeden for the patch. Example usage:

test_config = {'user': 'myuser', 'port':3306,'host':'localhost'} 
test_config['conn_attrs'] = {"foo": "bar", "_baz": "qux", "hello": "world"} _ = connect(**test_config) 

Default connection attributes are set for both the pure and c-ext implementations, but these
attributes are different due to limitations of the client library.

For general information about connection attributes, see
https://dev.mysql.com/doc/refman/8.0/en/performance-schema-connection-attribute-tables.htm...

The conn_attrs option is documented here:
https://dev.mysql.com/doc/connector-python/en/connector-python-connectargs.html