Commit Graph

23 Commits

Author SHA1 Message Date
fe95eb0dee CONPY-49: Added support for Decimal type
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.
2020-04-05 22:01:17 +02:00
2ee1471581 Fix for CONPY-52:
fixed double free (which was introduced when adding text protocol for
execute without parameters).
2020-04-05 21:51:41 +02:00
a992bf3568 Fix for CONPY-51:
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.
2020-04-05 21:45:44 +02:00
434a490539 Fix for CONPY-48:
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,)])
2020-04-03 18:36:54 +02:00
c96cb47825 Follow up for CONPY-47: Last commit didn't contain test case 2020-04-02 20:26:45 +02:00
4c3d2ff3bf Implementation of CONPY-46:
Implemented __enter__() and __exit__() methods for with statement (PEP-343).
These methods are available now for connection and cursor class.
2020-03-31 18:26:21 +02:00
9a36090cdc Fixed description (CONPY-9):
When using multibyte characters (default) we need to return the code
points instead of number of characters.
2020-03-29 17:55:04 +02:00
083086b1dd Fix for CONPY-45:
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.
2020-03-25 18:11:02 +01:00
3cfacf8aa2 CONPY-42:
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.
2020-02-20 09:51:38 +01:00
840de124bd - minor Documentatiion fixes
- fixed test cases using removed character set option
2020-02-18 16:11:29 +01:00
26fa254e11 Fix for CONPY-35:
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.
2020-01-25 10:33:00 +01:00
ad8504212e Fix for CONPY-34:
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.
2020-01-24 15:20:31 +01:00
8138eb9ebf test fixes 2019-12-05 11:05:13 +01:00
6c8fec31f5 Merge branch 'master' into tests 2019-12-04 15:48:47 +01:00
8bf252408c [misc] set plugin path at compile time
- connection plugin_dir possible parameter
- correction for error occurring in connection initialization
2019-12-04 10:43:12 +01:00
e218d19060 CONPY-31: Implement callproc method
Input/Output or Output parameters have to be retrieved by .fetch methods,
  the .sp_outparams attribute indicates if the result set contains output
  parameters.
2019-12-03 20:18:38 +01:00
a169c3949d [misc] various change
- 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
2019-11-29 12:13:05 +01:00
89ea56d668 Implementation of CONPY-29: Support format and pyformat paramstyle
While the default paramstyle is still 'qmark', MariaDB Connector/Python
now also supports the paramstyles 'format' and 'pyformat'. The paramstyles
can't be mixed.
2019-11-14 09:21:57 +01:00
a4648e992c Implemented CONPY-27: support prepared for cursor
Fixed line endings (dos2unix)
2019-11-13 11:45:02 +01:00
1b75fa2e7d Merge branch 'master' of https://github.com/MariaDB/mariadb-connector-python 2019-11-12 11:13:08 +01:00
ea79edcd6e [misc] correcting charset missing format identifier 2019-11-06 17:20:16 +01:00
11976139d4 [misc] python standard formatting 2019-11-06 15:13:56 +01:00
496f541fe1 [misc] Testing improvement
* 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`
2019-11-06 15:10:12 +01:00