zschumacher / pydapper

a pure python port of the NuGet library dapper
https://pydapper.readthedocs.io/en/latest/
MIT License
65 stars 12 forks source link

MySQL: unsigned int #320

Closed puls200 closed 1 month ago

puls200 commented 1 month ago

I have a weird case I cannot make sense of: I am trying to insert an unsigned int value into a MySQL table into a column of type unsigned int.

commands.execute(query, schemaModel)

where schemaModel is a marshmallow Schema and the field in question is defined like this:

flags = fields.Integer(required=False, allow_none=True)

Everything works fine unless the sign bit is set. Setting the flags value to 4.294.967.295 will result in an out of range error. What is happening, am I doing something wrong?

zschumacher commented 1 month ago

What's the trace back? Does MySQL allow inserting a signed int into an unsigned column? Are you expecting it to convert implicitly?

puls200 commented 1 month ago

Hi Zach, thank you for your reply. When looking up the trace I found the error elsewhere.. the incoming value from the API was already wrong, I got on the wrong track. Sorry about that. Closing this now. brgs, Daniel