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 processing of float in logic operation is inconsistent with mysql #11552

Closed
DQinYuan opened this issue Aug 1, 2019 · 1 comment
Closed
Labels
component/expression type/bug The issue is confirmed as a bug.

Comments

@DQinYuan
Copy link
Contributor

DQinYuan commented Aug 1, 2019

Bug Report

  1. What did you do?
select null or 0.1;
select 0 or 0.1;
select 1 and 0.1;
  1. What did you expect to see?

but in tidb, the result is:

NULL
0
0
  1. What did you see instead?

In mysql, the result is:

1
1
1

Perhaps Because tidb will round float before logic processing.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
mysql> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                              |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0
Git Commit Hash: 60965b006877ca7234adaced7890d7b029ed1306
Git Branch: HEAD
UTC Build Time: 2019-06-28 12:14:07
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql is 5.7

@DQinYuan DQinYuan added the type/bug The issue is confirmed as a bug. label Aug 1, 2019
@SunRunAway
Copy link
Contributor

Duplicate of #11199

@SunRunAway SunRunAway marked this as a duplicate of #11199 Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants