Unsigned type mapping overflow
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
When querying to a strongly type object which uses an unsigned short (ushort) you get an arithmetic overflow if the SQL value is greater than short.MaxValue (32767).
The SQL data type is an INT (best used for ushort values)
The mapping looks to be ignoring the fact its converting to an unsigned value which should allow twice the size (65535)
Errors
"Arithmetic operation resulted in an overflow."
Error parsing column 21 (XX=65535 - Int32)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the strongly typed mapping from a SQL INT value of 65535 into a C# ushort, then trace Dapper's type-conversion path for that column. Done means values through 65535 map without an arithmetic overflow and regression coverage verifies the boundary behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100