-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
encoding: fix DecodeFloatDescending for positive zero #79473
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want this to be backported. Thoughts?
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is TLP failing with this issue on other branches besides master? Seems worthwhile to eliminate the test failures, at least. Otherwise, maybe we should let it bake on master a bit before backporting.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @mgartner and @michae2)
pkg/sql/logictest/testdata/logic_test/float, line 84 at r1 (raw file):
query R rowsort SELECT * FROM i@i_f_idx;
nit: can you give the indexes names above so it's obvious which one you're selecting from?
Fixes: cockroachdb#77279 Our old friend -0 is back. This time the problem was in DecodeFloatDescending, which was decoding both +0 and -0 as -0. Fix it to decode both as +0. (-0 is then properly decoded as -0 when the value part of the composite encoding is decoded.) Note that the on-disk data was correct. Only the decoding was affected. Release note (bug fix): Queries reading from an index or primary key on FLOAT or REAL columns DESC would read -0 for every +0 value stored in the index. Fix this to correctly read +0 for +0 and -0 for -0. Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
A few failures were on release-22.1, so definitely worth backporting. How far back do we want to go? Looks like Roachtest Nightly only runs on master and release-22.1? |
Doesn't seem like this is a bug that would impact customers, so I'd hesitate to backport to other branches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
TFTRs! bors r=yuzefovich,rytaft,mgartner |
Build succeeded: |
Fixes: #77279
Our old friend -0 is back. This time the problem was in
DecodeFloatDescending, which was decoding both +0 and -0 as -0. Fix it
to decode both as +0. (-0 is then properly decoded as -0 when the value
part of the composite encoding is decoded.)
Note that the on-disk data was correct. Only the decoding was affected.
Release note (bug fix): Queries reading from an index or primary key on
FLOAT or REAL columns DESC would read -0 for every +0 value stored in the
index. Fix this to correctly read +0 for +0 and -0 for -0.
Co-authored-by: Yahor Yuzefovich yahor@cockroachlabs.com