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

Different result from MySQL using DIV with decimal type. #11180

Closed
SunRunAway opened this issue Jul 10, 2019 · 0 comments · Fixed by #11804
Closed

Different result from MySQL using DIV with decimal type. #11180

SunRunAway opened this issue Jul 10, 2019 · 0 comments · Fixed by #11804
Labels
component/expression help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug. type/compatibility

Comments

@SunRunAway
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
create table test1(a decimal(10,4) unsigned, b float);
insert into test1 value(1.0090, -1);
SELECT   ( `a` DIV  `b`  )   FROM test1;
  1. What did you expect to see?

In MySQL,

mysql> SELECT   ( `a` DIV  `b`  )   FROM test1;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(`randgen_test`.`test1`.`a` DIV `randgen_test`.`test1`.`b`)'
  1. What did you see instead?

In TiDB,

mysql> SELECT   ( `a` DIV  `b`  )   FROM test1;
+----------------------+
| ( `a` DIV  `b`  )    |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    fdbc149
@SunRunAway SunRunAway added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug. type/compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants