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

The 'xor' result is different between tidb and mysql8 #12867

Closed
aytrack opened this issue Oct 22, 2019 · 5 comments · Fixed by #15934
Closed

The 'xor' result is different between tidb and mysql8 #12867

aytrack opened this issue Oct 22, 2019 · 5 comments · Fixed by #15934
Assignees
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.

Comments

@aytrack
Copy link
Contributor

aytrack commented Oct 22, 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.001 xor 0;
  1. What did you expect to see?
mysql root@127.0.0.1:(none)> select 0.001 xor 0;
+-------------+
| 0.001 xor 0 |
+-------------+
| 1           |
+-------------+
1 row in set
Time: 0.014s
mysql root@127.0.0.1:(none)> select version();
+-----------+
| version() |
+-----------+
| 8.0.17    |
+-----------+
1 row in set
Time: 0.014s
  1. What did you see instead?
mysql root@127.0.0.1:(none)> select 0.001 xor 0;
+-------------+
| 0.001 xor 0 |
+-------------+
| 0           |
+-------------+
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
mysql root@127.0.0.1:(none)> select tidb_version();
+-------------------------------------------------------------------+
| tidb_version()                                                    |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-alpha-560-g12a3ce088                      |
| Git Commit Hash: 12a3ce088b91c20261dccf6d38102b42f54eff0f         |
| Git Branch: master                                                |
| UTC Build Time: 2019-10-19 07:44:32                               |
| GoVersion: go version go1.13 darwin/amd64                         |
| Race Enabled: false                                               |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false                                    |
+-------------------------------------------------------------------+
@aytrack aytrack added the type/bug The issue is confirmed as a bug. label Oct 22, 2019
@SunRunAway
Copy link
Contributor

SunRunAway commented Oct 24, 2019

On MySQL 5.7

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.29    |
+-----------+
1 row in set (0.00 sec)

mysql> select 0.001 xor 0;
+-------------+
| 0.001 xor 0 |
+-------------+
|           0 |
+-------------+
1 row in set (0.00 sec)

On TiDB,

mysql> select 0.001 xor 0;
+-------------+
| 0.001 xor 0 |
+-------------+
|           0 |
+-------------+
1 row in set (0.00 sec)

TiDB is currently aimed to be compatible with MySQL 5.7. Closing it. Feel free to reopen this issue if you or someone have further questions.

@SunRunAway
Copy link
Contributor

I've created a bug report to MySQL, https://bugs.mysql.com/bug.php?id=99119

@SunRunAway
Copy link
Contributor

Hi, @sduzh
We've decided to follow the bug fix in MySQL 8.0, would you like to fix this?

@SunRunAway SunRunAway added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 31, 2020
@sduzh
Copy link
Contributor

sduzh commented Mar 31, 2020

@SunRunAway I can fix this.

@ChenPeng2013
Copy link
Contributor

master: v4.0.0-beta.2-479-g0ae08fa8f verified
release-4.0: v4.0.0-rc.2-10-ge9b47ea62 verified
release-3.1: v3.1.1-20-g4211cb792 verified
release-3.0: v3.0.14-10-g2e6c1ba53 verified

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants