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

Incorrect results for where clause with decimal constant division #43311

Closed
yibin87 opened this issue Apr 23, 2023 · 1 comment · Fixed by #43329
Closed

Incorrect results for where clause with decimal constant division #43311

yibin87 opened this issue Apr 23, 2023 · 1 comment · Fixed by #43329
Labels

Comments

@yibin87
Copy link
Contributor

yibin87 commented Apr 23, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table test.t (id int, value decimal(7,4), c1 int, c2 int);
insert into test.t values (1,1.9285,54,28), (1,1.9286,54,28);
select * from t where value = 54 / 28;

2. What did you expect to see? (Required)

Empty set.
From mysql 8.0.30

3. What did you see instead (Required)

mysql> select * from t where value = 54 / 28;
+------+--------+------+------+
| id | value | c1 | c2 |
+------+--------+------+------+
| 1 | 1.9286 | 54 | 28 |
+------+--------+------+------+
1 row in set, 7 warnings (0.00 sec)

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.1.0-alpha
Edition: Community
Git Commit Hash: cd33faf
Git Branch: heads/refs/tags/v7.1.0-alpha
UTC Build Time: 2023-04-19 14:25:20
GoVersion: go1.20.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

@yibin87
Copy link
Contributor Author

yibin87 commented Apr 23, 2023

Tidb behaves correctly for v7.0. The behavior changed recently.

@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Apr 23, 2023
@qw4990 qw4990 removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Apr 23, 2023
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 a pull request may close this issue.

2 participants