Removed distutils support, which is deprecated as of Python 3.10 and removed in Python 3.12.
Adopted type hint enforcement for function and class attributes with mypy; this is compliant with PEP 8 for module mysql.connector. The integration includes a git pre-commit hook for mypy.
On Windows, added a
kerberos_auth_modeconnection option that's set to either "SSPI" (default) or "GSSAPI". This allows choosing between SSPI and GSSAPI at runtime for the
authentication_kerberos_clientauthentication plugin on Windows. Previously, only the SSPI mode was supported on Windows. For general usage information, see Kerberos Pluggable Authentication. This connection is ignored on other platforms, such as Linux, as they only support GSSAPI.
Limitation: GSSAPI can't be used with the pure Python implementation on Windows using authentication with a username and password, a limitation with the C library used by the python-gssapi package used by the pure Python implementation of Connector/Python.
Using USE_TZ=True in the Django settings would raise this exception: ValueError: Not naive datetime (tzinfo is already set). (Bug #34727432)
Removed debug messages that showed authentication data. (Bug #34695103)
Updated the protobuf version requirement to version >= 3.11.0, <=3.20.3. (Bug #34690501)
Connecting to MariaDB could fail with an unsupported character set because the default MySQL character collection is MySQL 8.0 specific. Now the 5.7 character set is used by default, but is switched to a 8.0 character set if the queried server is version 8.0. (Bug #34675508)
Incorrect MySQLCursor.statement values were returned with cursor.execute(query_string, multi=True) under the following conditions: The query string contained two or more queries seperated by a semicolon, and the non-first query used a literal or identifier containing either an odd number of backticks, quotes, or double quotes. (Bug #34655520)
On Windows, changed the security support provider (SSP) from Kerberos to Negotiate. Using Negotiate will then select either Kerberos or NTLM as the SSP. (Bug #34556157)
On Windows, the Connector/Python MSI did would not detect and install with Python 3.11. The workaround is to use
pip install mysql-connector-pythoninstead. (Bug #108911, Bug #34773422)
When using a prepared cursor, if a datetime column contained 00:00:00 as the time, a Python date object was returned instead of datetime.
Thanks to Rong Zhao for the contribution. (Bug #108733, Bug #34689812)
The MySQLCursor.executemany() method failed to batch insert data since the regular expression (RE) sentinel did not detect batch cases correctly; this meant using the one-on-one insert instead, which led to decreased performance.
Thanks to Alex Cazacu for the contribution. (Bug #108145, Bug #34499578)
Added a new
init_commandconnection option; an SQL query that's immediately executed after the connection is established.
Thanks to Sander van de Graaf for the contribution. (Bug #108076, Bug #34467201)
Russian characters were not handled correctly by the c-ext version's X DevAPI driver. String values are now encoded to their byte string representation before being sent to protobuf. (Bug #106585, Bug #33904362)
When fetching results from a prepared cursor using the pure Python implementation, it would fail if the VARBINARY column contained bytes that could not be decoded. The bytes are now returned if they cannot be decoded.
Thanks to Naoki Someya for the contribution. (Bug #96280, Bug #30089671)
Fixed multiple reference leaks and removed redundant code.
Thanks to Vilnis Termanis for the contribution. (Bug #90862, Bug #28020811)
The cursors (both pure and c-ext versions) uses a single SELECT query to retrieve procedure result parameters after a procedure call; but one SET call was used per parameter when setting the input parameters. This was optimized to always use a single SET call for one or multiple parameters.
Thanks to Vilnis Termanis for the contribution. (Bug #89345, Bug #27426532)
Improved warning handling throughout the connector.
Thanks to Vilnis Termanis for the contribution. (Bug #82366, Bug #24364556)
Added a new MySQLCursorPreparedDict class option that is similar to MySQLCursorPrepared; the difference is that the former returns a fetched row as a dictionary where column names are used as keys while the latter returns a row as a traditional record (tuple).
Thanks to Luke Weber for the contribution. (Bug #81573, Bug #23339387)
Enable the use of dictionaries as parameters in prepared statements using the '%(param)s' format as placeholders.
Thanks to Luke Weber for the contribution. (Bug #81572, Bug #23342572)
Using MySQLConverter.escape() on datetime objects raised this error: TypeError: an integer is required. Now it does not attempt to escape values that are not bytes or string types. (Bug #80679, Bug #22906307)
Not all parameters were added to the INSERT statement when using INSERT IGNORE with cursor.executemany().
Thanks to Takashi Ichii for the contribution. (Bug #75824, Bug #20504804)