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

tree: correctly cast float8 -> float4 #76286

Closed
wants to merge 1 commit into from

Conversation

otan
Copy link
Contributor

@otan otan commented Feb 9, 2022

Resolves #73743, but there are many more issues.

Release note (bug fix): Previously, inserting or casting into a FLOAT4
with a range out of value would still work and be treated as a FLOAT8.
This can also means more precision is stored than necessary. This has
been resolved.

Release note (bug fix): Previously, inserting or casting into a FLOAT4
with a range out of value would still work and be treated as a FLOAT8.
This can also means more precision is stored than necessary. This has
been resolved.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@otan otan requested review from mgartner and rafiss February 9, 2022 10:05
@otan
Copy link
Contributor Author

otan commented Feb 9, 2022

hmm

------- Stdout: -------
=== RUN   TestEval/opt/cast
    eval_test.go:48: 
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/sem/tree/testdata/eval/cast:1207: '3.14'::jsonb::float4
        expected:
        3.14
        
        found:
        3.140000104904175
        --- FAIL: TestEval/opt/cast (0.01s)

maybe not

@otan otan closed this Feb 9, 2022
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.

sql: truncate floats to FLOAT4 correctly
2 participants