1) When retrieving data with column type MYSQL_TYPE_NEWDECIMAL C/Python
now loads the decimal module and converts data from string into Pythons
decimal.Decimal type.
2) Wnen sending a decimal.Decimal parameter, value will be converted to string
and send with type MYSQL_TYPE_NEWDECIMAL to server.
When using a buffered cursor, we need to store the field_count inside
Mrdb_Cursor, since db.commit/rollback will overwrite/clear mysql->field_count
inside Connector/C.
According to PEP-249 parameters for cursor methods execute() and executemany() are passed as a sequence.
The current implementation accepted Tuple only, this fix also allows List as parameter.
Valid examples:
cursor.execute("SELECT %s", [1])
cursor.execute("SELECT %s", (1,))
cursor.executemany("INSERT INTO t1 VALUES (%s)", [[1],[2]])
cursor.executemany("INSERT INTO t1 VALUES (%s)", [(1,),(2,)])
cursor.executemany("INSERT INTO t1 VALUES (%s)", [[1],(2,)])
When converting time or datetime values with microseconds, the
calculation was wrong, e.g. a millisecond value of .123 was converted
to .000123 instead of .123000. This was already fixed in C/C but not
in C/Python.
Fixed crash when fetching GEOMETRY column. Don't handle GEOMETRY
column type as a string value, instead we need to convert it to
a Python binary object.
Since we can't reset internal members of statement handle (MYSQL_STMT *), we
need to close and reinitialize statement handle in case a different statement
will be executed with same cursor.
We now throw an error if a Python object cannot be converted to the corresponding
MariaDB type instead of serializing it.
This means that Python objects that do not have a corresponding MariaDB server
type must be serialized in the application.
Input/Output or Output parameters have to be retrieved by .fetch methods,
the .sp_outparams attribute indicates if the result set contains output
parameters.
- correct tests according to server/maxscale, and multiple python version
- Cpython (3.6.0, 3.8.0) pypy (3.6-7.2.0), miniconda3-4.3.30
- add scroll test
- benchmark added to test suite. See benchmarks/README.md for info
- cursor.scroll now permit position 0 when using absolute mode
- return Cursor.rownumber None if no result-set, not 0
- exception missing type sqlstate and according tests
While the default paramstyle is still 'qmark', MariaDB Connector/Python
now also supports the paramstyles 'format' and 'pyformat'. The paramstyles
can't be mixed.
* adding file encoding
* test file renamed with test_ prefix permitting unittest discovery
* test configuration using dict using environment data for futur CI testing
* test correction (using table t1) permitting unittest parallel testing
now tests can be run using `python -m unittest -v`
or for python 2 `python -m unittest discover -v`