Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: handle float32 according to spec in all cases #208

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CL-Jeremy
Copy link

I encountered what looks quite similar to the issue submitter's case, so I replied in that issue and did a follow-up there: uptrace/bun#993 (comment).

According to the spec (https://pkg.go.dev/database/sql#Scanner), single-precision float values must always be returned as doubles, which could then be downcasted to recover the original value (leaving the binary representation unchanged, so there is no loss of precision if handled properly).

This bug is only present in readFixedType, so it seems to be due to carelessness.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.74%. Comparing base (9b84d9b) to head (72eb428).

Files Patch % Lines
types.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #208      +/-   ##
==========================================
- Coverage   74.79%   74.74%   -0.05%     
==========================================
  Files          32       32              
  Lines        6379     6379              
==========================================
- Hits         4771     4768       -3     
- Misses       1325     1327       +2     
- Partials      283      284       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants