vapor / mysql-nio

🐬 Non-blocking, event-driven Swift client for MySQL.
MIT License
87 stars 28 forks source link

Parsing of Decimal numbers failed #36

Closed nostradani closed 3 years ago

nostradani commented 4 years ago

When using a model with a Decimal property, queries for those rows fail since the decimal value cannot be parsed.

Steps to reproduce

Expected behavior

The GET method should return the Product with its price

Actual behavior

The query fails because the decimal value cannot be parsed from the MySQLData object.

Environment

Proposed solution

The MySQLData returned in our scenario is of type MYSQL_TYPE_NEWDECIMAL. The current implementation for decimal parsing however uses the "string" property of MySQLData, which cannot deal with it.

I implemented a decimal property method for MySQLData and updated the tests for it: https://github.com/vapor/mysql-nio/pull/35

tanner0101 commented 3 years ago

Fixed in #35