MySQL Connector/Python Release Notes
Connector/Python now permits the type for stored procedure parameters to be specified. To do this, specify a parameter as a two-item tuple consisting of the parameter value and type. For more information, see MySQLCursor.callproc() Method. (Bug #71124, Bug #17965619)
It was not possible to initiate an SSL session without
explicitly giving a key and certificate. Now it is possible to
connect to a MySQL server using only the
ssl_ca
connection argument pointing to a file
of CA certificates. This means the ssl_key
and ssl_cert
connection arguments are
optional. However, when either is given, both must be given or
an AttributeError
is raised.
(Bug #69418, Bug #17054848)
Connector/Python now supports authentication plugins found in
MySQL 5.6. This includes mysql_clear_password
and sha256_password
, both of which require an
SSL connection. The sha256_password
plugin
does not work over a non-SSL connection because Connector/Python
does not support RSA encryption.
The connect()
method now supports an
auth_plugin
parameter that can be used to
force use of a particular plugin. For example, if the server is
configured to use sha256_password
by default
and you want to connect to an account that authenticates using
mysql_native_password
, either connect using
SSL or specify
auth_plugin='mysql_native_password'
.
(Bug #68054, Bug #16217765)
The connect()
method now accepts a
failover
argument that provides information
to use for server failover in the event of connection failures.
The argument value is a tuple or list of dictionaries (tuple is
preferred because it is nonmutable). Each dictionary contains
connection arguments for a given server in the failover
sequence. Permitted dictionary values are:
user
, password
,
host
, port
,
unix_socket
, database
,
pool_name
, pool_size
.
Connector/Python now enables applications to specify additional
information to be used when connecting to Fabric: User name and
credentials, and information to use for establishing an SSL
connection. The fabric
dictionary argument to
the connect()
method accepts these additional
values: username
,
password
, ssl_ca
,
ssl_cert
, ssl_key
. Only
the ssl_ca
value is required to establish an
SSL connection. If ssl_cert
or
ssl_key
are given, both must be specified.
Connector/Python now can report errors to Fabric that occur while accessing a MySQL instance. The information can be used to update the backing store and trigger a failover operation, provided that the instance is a primary server and Fabric has received a sufficient number of problem reports from different connectors.
The fabric
dictionary argument to the
connect()
method now accepts a
report_errors
value. Its default value is
False
; pass a value of
True
to enable error reporting to Fabric.
To define which errors to report, use the
extra_failure_report()
function:
from mysql.connector.fabric import extra_failure_report extra_failure_report([error_code_0, error_code_1, ...])
A new MySQLConnection
class
reset_connection()
method enables
applications to send a COM_RESET_CONNECTION
to the server. This method is analogous to the
mysql_reset_connection()
C API
function added in MySQL 5.7.3.
A new MySQLConnection
class
reset_session()
method is similar to
reset_connection()
but falls back to use
reauthentication for older servers that do not support
COM_RESET_CONNECTION
. For more information,
see
MySQLConnection.cmd_reset_connection() Method,
and
MySQLConnection.reset_session() Method.
The MySQLConnection.autocommit
attribute
failed to set the value of the
self._autocommit
attribute.
(Bug #18172769)
Uninstalling Connector/Python using an RPM package failed to
remove the fabric
folder.
(Bug #18143073)
The global MYSQL_FABRIC_PORT
variable was
changed from 8080 to 32274 to match the port change made in
Fabric.
(Bug #18075339)
References: See also: Bug #70954.
For Fabric connections, any connect_attempts
and connect_delay
values specified by the
user were ignored.
(Bug #18055719)
For Fabric sharding operations, Connector/Python raised an
incorrect error when a table was given with the
tables
connection property for which no
sharding information was available. This now results in a
DatabaseError
(with
errorcode.ER_BAD_TABLE_ERROR
) mentioning that
the table is unknown.
(Bug #18047794)
For Fabric operations, an incorrect exception was raised by
set_property()
when a connection property
value had the wrong type (for example, when the
tables
property was not a tuple or a list).
set_property()
now correctly raises a
ValueError
.
(Bug #18047758)
For Fabric operations, the default mode was supposed to be read/write but was set to read-only. (Bug #18047591)
The delay between attempts when trying to connect to a MySQL Fabric-managed server was not honored. (Bug #71905, Bug #18335432)
Fabric has renamed the dump functionality to a new command
called dump
. Consequently, Connector/Python
now uses the new functions
dump.sharding_information,
dump.fabric_nodes
, and
dump.servers.
(Bug #71124, Bug #17965619)
MySQLCursor.executemany()
caused a
UnicodeDecodeError
when non-ASCII characters
existed in the seq_params
parameter and the
operation was a Unicode instance with Python 2. This is now
corrected by encoding the operation per the current connection
character set.
(Bug #69067, Bug #18220593)