[CONPY-49] MariaDB python connector and have noticed a difference in how things seem to be converted Created: 2020-04-02  Updated: 2020-08-25  Resolved: 2020-04-05

Status: Closed
Project: MariaDB Connector/Python
Component/s: Generic
Affects Version/s: None
Fix Version/s: 0.9.56

Type: Bug Priority: Major
Reporter: David Hill (Inactive) Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

We are testing out utilizing the MariaDB python connector and have noticed a difference in how things seem to be converted. We have a lot of processes that return the value as a decimal, and from that point we do comparisons on them. When running the MariaDB python connector, these seem to be converted into a string when returned from the database, this causing issues in the direct comparisons.

MariaDB Connector return with decimal values, shown as a string:
[['27', 53549, '0.0005', '0.9995']]

Other connectors:
[[Decimal('27'), 53549, Decimal('0.0005'), Decimal('0.9995')]]



 Comments   
Comment by Georg Richter [ 2020-04-02 ]

Decimal is a non standard type and requires import of the decimal module. Decimal also needs to be supported when passing parameters to execute() and executemany().

Comment by Brandon Witzke [ 2020-04-03 ]

Even if it is a double it could be returned as such. Just probably not returned as a string as it is.

Generated at Thu Feb 08 03:29:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.