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: check decimal scale and precision before casting #11644

Closed
wants to merge 3 commits into from

Conversation

amyangfei
Copy link
Contributor

What problem does this PR solve?

part of #11223 fix issue #11193

What is changed and how it works?

Check the Flen of a record is not greater than mysql.MaxDecimalWidth and the Decimal of a record is not greater than mysql.MaxDecimalScale before casting to a decimal.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

@codecov
Copy link

codecov bot commented Aug 6, 2019

Codecov Report

Merging #11644 into master will decrease coverage by 0.5056%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #11644        +/-   ##
================================================
- Coverage   81.7785%   81.2729%   -0.5057%     
================================================
  Files           426        426                
  Lines         94345      92006      -2339     
================================================
- Hits          77154      74776      -2378     
- Misses        11788      11858        +70     
+ Partials       5403       5372        -31

@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei
Copy link
Contributor Author

some sqllogic test case failed, like
[2019-08-06T15:13:21.926Z] 2019/08/06 23:13:21.670 main.go:137: [error] /git/sqllogictest/test/random/expr/slt_good_117.test:34457: query err Error 1426: Too big precision 66 specified for column '72'. Maximum is 65. - sql[ SELECT ALL 91 + - CASE 40 WHEN ( - 72 ) THEN + 67 ELSE - SUM( DISTINCT - 72 ) END ]
will investigate it later

@amyangfei amyangfei closed this Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant