With implementation of CONPY-246/247 pool._connections was replaced
by _connections_used and _connections_free to the size should be
calclulated as len(_connections_used + _connections_free)
Instead of iterating through all connections and checking the health
status via ping, used and unused connections were separated in different
lists. This ensures that the last used connection will be always the first.
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.
If a bulk operation is executed and the statement doesn't need to
be reprepared, only array size has to be updated, since setting
the number of parameters (STMT_ATTR_PREBIND_PARAMS) will reset the
statement in Connector/C.
Fixed various coding style stuff detected by flake8.
Added .pre-commit-config.yaml:
With command pre_commit install a hook for flake8 will be
installed.
The default settiing for buffered in cursors.execute() method has
to be None:
- if not specified, it will use cursor defaults
- if specified, the default behavior of cursor will be changed
- 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
Extended cursor->description:
The descriptor now contains 11 elements:
descriptor[8]: table name
descriptor[9]: original column name
descriptor[10]: original table name
Since MariaDB Connector/C 3.3.0 host parameter may contain multiple hosts,
separated by a comma for simple failover. If MariaDB Connector/Python uses
a MariaDB Connector/C library < 3.3.0 an exception will be raised if host
parameter contains a comma.
Since memory for stack allocation is limited, we need to allocate
memory from the heap, otherwise in case of large strings escape_string
method might crash.
When connected against MySQL or MariaDB < 10.2 server
we need to skip tests which use INDICATOR variables,
since they can't be used in mysql_stmt_execute() C API
function.
Added connection attribute server_version_info and (for compatibiliry)
get_server_version() method.
Both return a tuple, describing the version number of connected server
in following format: (MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)