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(expr): round to left of decimal point when 2nd arg is negative #10961

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

xiangjinwu
Copy link
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Fix #9417

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR contains user-facing changes.

Types of user-facing changes

  • SQL commands, functions, and operators

Release note

Just like in PostgreSQL, the 2nd arg of round can now be negative, which means to round to the left of the decimal point.

@github-actions github-actions bot added type/fix Bug fix user-facing-changes Contains changes that are visible to users labels Jul 14, 2023
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #10961 (f0ce754) into main (164f069) will decrease coverage by 0.01%.
The diff coverage is 95.91%.

@@            Coverage Diff             @@
##             main   #10961      +/-   ##
==========================================
- Coverage   69.94%   69.93%   -0.01%     
==========================================
  Files        1307     1307              
  Lines      223617   223652      +35     
==========================================
+ Hits       156415   156418       +3     
- Misses      67202    67234      +32     
Flag Coverage Δ
rust 69.93% <95.91%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/connector/src/parser/avro/util.rs 50.54% <0.00%> (ø)
src/connector/src/parser/unified/avro.rs 74.27% <ø> (ø)
src/common/src/types/decimal.rs 66.77% <100.00%> (+0.33%) ⬆️
src/expr/src/vector_op/round.rs 94.00% <100.00%> (+1.50%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@wangrunji0408 wangrunji0408 left a comment

Choose a reason for hiding this comment

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

LGTM!

@xiangjinwu xiangjinwu added this pull request to the merge queue Jul 15, 2023
Merged via the queue into main with commit 9c5745e Jul 15, 2023
35 of 36 checks passed
@xiangjinwu xiangjinwu deleted the fix-expr-round-decimal-negative branch July 15, 2023 02:22
@xiangjinwu xiangjinwu mentioned this pull request Jul 17, 2023
7 tasks
@emile-00 emile-00 added the 📖✓ Covered or will be covered in the user docs. label Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix user-facing-changes Contains changes that are visible to users 📖✓ Covered or will be covered in the user docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(expr): round(decimal, digits) returns 0 when digits is negative
3 participants