Release Notes for MariaDB Connector/Python 1.1.5
This page is part of MariaDB's Documentation.
The parent of this page is: Release Notes for MariaDB Connector/Python 1.1
Topics on this page:
Overview
MariaDB Connector/Python is a native MariaDB connector for building Python applications on MariaDB. It is compliant with Python DB API 2.0 (PEP-249). It is written in Python and C and uses MariaDB Connector/C.
MariaDB Connector/Python 1.1.5 was released on 2022-11-07. This release is of General Availability (GA) maturity.
Notable Changes
Improved performance of the
cursor.fetchone()
,cursor.fetchall()
, andcursor.fetchmany()
methods.In previous releases, the methods build the result-set by iterating over the available rows.
Starting with this release, the methods build the result-set by loading all of the data at once.
Added the
_get_socket()
method, which returns the file descriptor associated with a connection's TCP socket by calling themysql_get_socket()
function in MariaDB Connector/C. (CONPY-220)
Issues Fixed
When a cursor has already been closed and the
del
statement is used to delete the object, amariadb.ProgrammingError
is raised. (CONPY-222)In previous releases, the following error is raised:
>>> import mariadb >>> c=mariadb.connect() >>> cursor=c.cursor() >>> cursor.close() >>> del cursor Exception ignored in: <function Cursor._del_ at 0x7ff0136b8ee0> mariadb.ProgrammingError: Cursor is closed
Starting with this release, a closed cursor can be deleted without raising an error.
When a bulk operation is executed twice with the same cursor using the
cursor.executemany()
method, the second execution causes an error to be raised. (CONPY-224)In previous releases, the following error is raised:
Commands out of sync; you can't run this command now
Starting with this release, a bulk operation can be executed twice with the same cursor without raising an error.
The
cursor.affected_rows
property is always0
. (CONPY-225)Starting with this release, the
cursor.affected_rows
property is properly set.The
cursor.affected_rows
property is deprecated, so MariaDB recommends using thecursor.rowcount
attribute instead.
MariaDB Connector/Python requires the
distutils
module, which is deprecated by PEP-632. (CONPY-226)In previous releases, MariaDB Connector/Python uses the
distutils.version.StrictVersion()
method to check the version of MariaDB Connector/C.Starting with this release, MariaDB Connector/Python uses the
packaging.version.Version()
method to check the version of MariaDB Connector/C.
When
connection.cursor(named_tuple=True)
is used, fetching query results can be too slow and use too much memory. (CONPY-227)In previous releases, MariaDB Connector/Python uses the
collections.namedtuple()
method to construct the query results object, which requires a lot of overhead.Starting with this release, MariaDB Connector/Python uses a
PyStructSequence
object to construct the query results object. Whennamed_tuple=True
ordict=True
is specified toconnection.cursor()
, conversions have less overhead, and rows are converted before they are fetched.
When the installed version of MariaDB Connector/C is not 3.2.4 or later, installing MariaDB Connector/Python raises an unhelpful error. (CONPY-228)
In previous releases, the following error is raised:
TypeError: not enough arguments for format string
Starting with this release, the following error is raised:
MariaDB Connector/Python requires MariaDB Connector/C >= 3.2.4, found version VERSION
When a converter is defined for
FIELD_TYPE.NULL
, the conversion is skipped forNULL
values. (CONPY-229)When a cursor is closed, memory can leak. (CONPY-231)