- When catching errors from cursor the try/except construct must be either
within a context or we need to explicitly call traceback.clear_frames().
Otherwise traceback will hold a reference to the cursor which
generates a msan error.
- Before executing a cursor command via execute, callproc or executemany we
now reset the cursor.
- Fixed various tests, which didn't close cursor or connection properly.
- Added internal attribute cursor._thread_id to detect
automatic reconnect.
- If a reconnect occurred, only buffered resultsets using
the text protocol can be accessed. (The same applies
if a connection was closed).
- If connection reconnected, _thread_id attribute will be updated
when using execute() or executemany() method.
Callback functions for session or fetch callbacks didn't work properly
when passing connection->thread_state in threaded environment.
Instead we acquire and release the GIL explicitly in these callback
functions.
Implemented support for VECTOR paramter. Beside text representation
(Vec_FromText) or array to byte conversion (array.tobytes) it is now
possible to specify an float array as parameter.
Example:
import mariadb, array
...
sql = """
CREATE OR REPLACE TABLE test(
id INT PRIMARY KEY,
v VECTOR(3) NOT NULL,
VECTOR INDEX (v))")"""
cursor.execute(sql)
vector= array.array('f', [123.1, 230.9, 981.7])
cursor.execute("INSERT INTO test VALUES (?,?)", (1, vector))
Please note that the opposite way, retrieving a float array is not
supported yet. This will require either a new or extended field
type for vector data type.
- Always set/unset peer certificate verification flag
- Return None (instead of raising an exception) for tls connection
properties if TLS is not in use
- bumped version number to 1.1.11
In case of an (automatic) reconnect the connection property
connection_id was not updated, since there is no callback
functionality in Connector/C available to notify the application
that a reconnect occured. Instead of obtaining the connection_id
via MemberDef, connection_id is now implemented as getter function.
Methods which are defined via PyMemberDef with flag METH_VARARGS
and have only one parameter are using METH_O now: Instead of parsing
and converting parameter via PyArgs_ParseTuple we now check the type
and convert passed python object directly to the corresponding c type.