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

Mod(%) operator meets inconsistent 0 results. #11211

Closed
SunRunAway opened this issue Jul 11, 2019 · 0 comments · Fixed by #11251
Closed

Mod(%) operator meets inconsistent 0 results. #11211

SunRunAway opened this issue Jul 11, 2019 · 0 comments · Fixed by #11251
Labels
component/expression help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility

Comments

@SunRunAway
Copy link
Contributor

SunRunAway commented Jul 11, 2019

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.
select 0.000 % 0.11234500000000000000;
select 1.099 % 0.00000001000000000000;
  1. What did you expect to see?

In MySQL,

mysql> select 0.000 % 0.11234500000000000000;
+--------------------------------+
| 0.000 % 0.11234500000000000000 |
+--------------------------------+
|         0.00000000000000000000 |
+--------------------------------+
1 row in set (0.00 sec)

mysql> select 1.099 % 0.00000001000000000000;
+--------------------------------+
| 1.099 % 0.00000001000000000000 |
+--------------------------------+
|         0.00000000000000000000 |
+--------------------------------+
1 row in set (0.00 sec)
  1. What did you see instead?

In TiDB,

mysql> select 0.000 % 0.11234500000000000000;
+--------------------------------+
| 0.000 % 0.11234500000000000000 |
+--------------------------------+
|                              0 |
+--------------------------------+
1 row in set (0.00 sec)

mysql> select 1.099 % 0.00000001000000000000;
+--------------------------------+
| 1.099 % 0.00000001000000000000 |
+--------------------------------+
|         0.00000000000000000000 |
+--------------------------------+
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)?
    0ea1bf0
@SunRunAway SunRunAway added the type/bug The issue is confirmed as a bug. label Jul 11, 2019
@SunRunAway SunRunAway changed the title Mod Mod(%) operator meets different 0 results. Jul 11, 2019
@SunRunAway SunRunAway added type/compatibility and removed type/bug The issue is confirmed as a bug. labels Jul 11, 2019
@SunRunAway SunRunAway changed the title Mod(%) operator meets different 0 results. Mod(%) operator meets inconsistent 0 results. Jul 11, 2019
@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
wjhuang2016 added a commit to wjhuang2016/tidb that referenced this issue Jul 15, 2019
SunRunAway pushed a commit to SunRunAway/tidb that referenced this issue Jul 22, 2019
SunRunAway pushed a commit to SunRunAway/tidb that referenced this issue Jul 22, 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/compatibility
Projects
None yet
1 participant