encoding: fix DecodeFloatDescending for positive zero#79473
encoding: fix DecodeFloatDescending for positive zero#79473craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
yuzefovich
left a comment
There was a problem hiding this comment.
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)
rytaft
left a comment
There was a problem hiding this comment.
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 |
|
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