When a connection disabled SSL Mode using
ssl_disabled=True(or withssl-mode='DISABLED'for X Protocol connections), specifying other TLS or SSL connection options caused Connector/Python to throw an error. For example, definingtls_versionwithssl_disabled=Trueraised such an error. Now, disabling SSL now means that additional TLS and SSL connection options are ignored. (WL #14852)The Connector/Python C extension now supports FIDO pluggable authentication, and adds a new
fido_callbackconnection option. (WL #14860)The version of
protobufused by the C extension is updated to version 3.19.4. (WL #15080)-
Removed support for Python 3.6.
On EL7, EL8, and SUSE Linux: A
python3-protobufRPM package is not available for Python 3.8 on these platforms, so the dependency was removed from the RPM specification; instead this package must be installed manually withpip install protobufor similar. (WL #14824) Expanded Kerberos Authentication Protocol support to include Windows clients using the pure Python implementation of Connector/Python. (WL #14665)
Django support now allows a custom class for data type conversion in the Django backend, typically used to convert non-default data types. This is implemented as a subclass of
mysql.connector.django.base.DjangoMySQLConverter. (WL #14679)
Microsoft Windows: When using the C extension with
prepared=True,BIGINTdata was seen asMYSQL_TYPE_LONGinstead ofMYSQL_TYPE_LONGLONG, which raised overflow errors with values greater than 2147483647. (Bug #96588, Bug #105254, Bug #30203754, Bug #33481203)Upon connecting to the server, Connector/Python executed a number of
SHOW [SESSION] VARIABLESstatements to retrieve system variable values. Such statements involve locking in the server, so they are now avoided in favor ofSELECT @@. (Bug #33861549)var_nameWhen using the C extension, an expression used as a column without an alias raised a UnicodeDecodeError error. (Bug #33747585)
The deprecated
utf8mb3character set is now recognized because theutf8alias showsutf8mb3in the Information Schema andSHOWstatements in MySQL 8.0.28 and later. For additional information, see The utf8 Character Set (Deprecated alias). (Bug #33729842)With consume_results=True, the C extension implementation threw an error with some methods such as cmd_refresh(), reset_session() and commit() if there were pending results to fetch. Now, unread results are handled and consumed. (Bug #21528553)
When connecting to MySQL Server versions previous to 5.7.35, servers failed to execute
change_usercommands due to the default collation used by Connector/Python, a problem which affected connection pooling functionality by raising an exception when closing a pooled connection. Now Connector/Python reconnects instead of emitting the exception. (Bug #104569, Bug #33203161)-
Previously, unsuccessful decoding a byte array raised a UnicodeDecodeError error. Now in such the raw bytes or byte array is returned instead.
Thanks to Meik Milevczik for the contribution. (Bug #93065, Bug #28877987)
Added support for Decimal parsing. Thanks to Luke Weber for the patch. (Bug #81571, Bug #23338623)
Added a context manager to open files in the optionfiles module to be closed correctly. Thanks to Vilnis Termanis for the patch. (Bug #81519, Bug #23324748)
Attempts to insert Python
ByteArraydata into binary table columns failed when using the c-extension implementation of Connector/Python. (Bug #77822, Bug #21498719)Added support for NaN in the float to MySQL conversion; it's now set to None. (Bug #74934, Bug #20065830)