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

expression: fix DIV with decimal type #11804

Merged
merged 6 commits into from
Aug 21, 2019

Conversation

Reminiscent
Copy link
Contributor

@Reminiscent Reminiscent commented Aug 21, 2019

What problem does this PR solve?

Closes: #11180
operator_div in mysql.
In TiDB, the division operator does not correctly resolve the case that an operand is an unsigned number.

What is changed and how it works?

When evaluating the expression of 'div with decimal type', it will check the operands first.
And do different things depend on whether either of the operands is unsigned.

Check List

Tests

  • Unit test
    add two test cases and pass all the tests

@CLAassistant
Copy link

CLAassistant commented Aug 21, 2019

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Aug 21, 2019

Codecov Report

Merging #11804 into master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master    #11804   +/-   ##
=========================================
  Coverage   81.519%   81.519%           
=========================================
  Files          435       435           
  Lines        93891     93891           
=========================================
  Hits         76539     76539           
  Misses       11883     11883           
  Partials      5469      5469

Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

LGTM

@qw4990 qw4990 requested a review from SunRunAway August 21, 2019 06:46
Copy link
Contributor

@wshwsh12 wshwsh12 left a comment

Choose a reason for hiding this comment

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

LGTM

@wshwsh12 wshwsh12 added status/LGT2 Indicates that a PR has LGTM 2. status/can-merge Indicates a PR has been approved by a committer. labels Aug 21, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Aug 21, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Aug 21, 2019

@Reminiscent merge failed.

@wshwsh12
Copy link
Contributor

/run-auto-merge

@sre-bot
Copy link
Contributor

sre-bot commented Aug 21, 2019

/run-all-tests

@sre-bot sre-bot merged commit 1805d7a into pingcap:master Aug 21, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Aug 21, 2019

cherry pick to release-2.1 in PR #11812

@sre-bot
Copy link
Contributor

sre-bot commented Aug 21, 2019

cherry pick to release-3.0 in PR #11813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different result from MySQL using DIV with decimal type.
5 participants