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

release-20.1: builtins: fix sqrdiff when used as a window function #55999

Merged
merged 2 commits into from
Oct 28, 2020

Conversation

yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Oct 26, 2020

Backport 1/1 commits from #55957.
Backport 1/1 commits from #56006.

/cc @cockroachdb/release


builtins: fix sqrdiff when used as a window function

Fix incorrect sqrdiff evaluation due to reuse of the results from
previous iterations when used as a window function.

Fixes: #55944.

Release note (bug fix): CockroachDB previously could incorrectly
evaluate sqrdiff function when used as a window function in some
cases, and now it is fixed.

logictest: deflake a test

We've recently merged a test that in very rare circumstances could
produce a float result that differs from the expected one by 1 in the
15th significant digit (after rounding). I believe that could occur,
e.g. when the 15th and 16th significant digits were 35, and we matched
the spec of supporting 15 significant digits for floats, yet the
rounding makes us return an unexpected result. This commit rounds to the
precision of 1 digit less which should make the test non-flaky.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: in principle minus the CI failures

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @asubiotto)

@yuzefovich yuzefovich force-pushed the backport20.1-55957 branch 2 times, most recently from 66ecbbb to 505ea88 Compare October 27, 2020 22:43
mneverov and others added 2 commits October 27, 2020 17:35
Fix incorrect sqrdiff evaluation due to reuse of the results from
previous iterations when used as a window function.

Release note (bug fix): CockroachDB previously could incorrectly
evaluate sqrdiff function when used as a window function in some
cases, and now it is fixed.
We've recently merged a test that in very rare circumstances could
produce a float result that differs from the expected one by 1 in the
15th significant digit (after rounding). I believe that could occur,
e.g. when the 15th and 16th significant digits were `35`, and we matched
the spec of supporting 15 significant digits for floats, yet the
rounding makes us return an unexpected result. This commit rounds to the
precision of 1 digit less which should make the test non-flaky.

Release note: None
@yuzefovich
Copy link
Member Author

It took quite a bit of updating the logic tests (F type is only supported on the master branch, so I had to round the numbers).

@yuzefovich yuzefovich merged commit bd24aeb into cockroachdb:release-20.1 Oct 28, 2020
@yuzefovich yuzefovich deleted the backport20.1-55957 branch October 28, 2020 02:09
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.

None yet

4 participants