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.
Similiar to description property, this property returns
a dictionary with complete metadata.
The dictionary contains the following keys:
- catalog: catalog (always 'def')
- schema: current schema
- field: alias column name or if no alias was specified
column name
- org_field: original column name
- table: alias table name or if no alias was specified
table name
- org_table: original table name
- type: column type
- charset: character set (utf8mb4 or binary)
- length: The length of the column
- max length: The maximum length of the column
- decimals: The numer of decimals
- flags: Flags (flags are defined in constants.FIELD_FLAG)
- ext_type: Extended data type (types are defined in
constants.EXT_FIELD_TYPE)
This fixes also CONPY-270: Instead of checking BINARY_FLAG we now
check character set for binary object types.
For backwards compatibility PyLong_FromString interprets leading
zeros as octal value which will end up in a value error, if the
number contains 2 or more leading zeros.
Replaced collections.named_tuple by C-Pythons PyStruct_Sequence.
All conversion are done now before fetching a row: converting to
other result types than tuple (named tuple or dict) now have less
overhead and are significantly faster.
- removed utf8 part of parser, instead we use python binary
object for parameter substituton (text mode)
- removed memory leaks
- fixed crash when reusing cursor with different number of
placeholders
- All parameter exceptions are now ProgrammingErrors
- A dictionary now might contain more keys than
placeholders in statement
- Fixed unhandled exception when using dictionary as parameter
According to the documentation (but also setup.py) the minimum
required version of MariaDB Connector/C is 3.1.5. Since extended
field_types were added in 3.1,8, we need to check the version
of MariaDB Connector/C.
The connect() method now accepts an addtional parameter
converter which points to a dictionary, containing one or more conversions.
A conversion must be specified in the form {FIELD_TYOE : conversion_function}
Beginning of MariaDB 10.5 metadata for JSON columns is stored
in extended field information, and the reported type is MYSQL_TYPE_BLOB.
We now check extended field information to return correct type and for
fetching values in correct format.
When a value is returned as binary type (BLOB) but has a non binary collation,
it will be converted now as a unicode string and the binary flag will be ignored.
- added a thin python wrapper around mariadb module
- added constansts under mariadb.constants (CLIENT, CURSOR, INDICATOR)
- bench and test are now in testing subdirectory
- updated documentation