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.
This commit is contained in:
Georg Richter
2020-04-05 22:01:17 +02:00
parent 2ee1471581
commit fe95eb0dee
5 changed files with 48 additions and 4 deletions

View File

@ -273,6 +273,8 @@ extern PyObject *Mariadb_NotSupportedError;
extern PyObject *Mariadb_Warning;
extern PyObject *Mrdb_Pickle;
extern PyObject *decimal_module,
*decimal_type;
/* Object types */
extern PyTypeObject MrdbPool_Type;