vapor-community / postgresql

Robust PostgreSQL interface for Swift
MIT License
131 stars 33 forks source link

Incorrect result when parsing "NUMERIC" values #47

Closed vzsg closed 7 years ago

vzsg commented 7 years ago

BinaryUtils.parseNumeric seems to return values with a completely off scale. 600 for example becomes a String Node with "0.0000000000000600" inside.

I will upload a failing test case soon.

t3ndai commented 7 years ago

screen shot 2017-06-12 at 14 30 48

Passing a Raw query like guard let collegeSet = try? Job.database?.raw("select college, avg(pay) as average from jobs group by college order by average desc").converted(to: JSON.self).makeResponse() else { throw SQL.serialization }

produces off scale numbers.

vzsg commented 7 years ago

Fixed by #48, now available as 2.0.2.