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

Decimal(1.10) is not equal to Decimal(1.1) and Decimal(1.100) #11852

Closed
SunRunAway opened this issue Aug 23, 2019 · 0 comments · Fixed by #19131
Closed

Decimal(1.10) is not equal to Decimal(1.1) and Decimal(1.100) #11852

SunRunAway opened this issue Aug 23, 2019 · 0 comments · Fixed by #19131
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/execution SIG execution type/bug The issue is confirmed as a bug.

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.
drop table if exists t;
drop table if exists t1;
drop table if exists t2;

create table t (a DECIMAL(2, 1));
insert into t value (1.1);

create table t1 (a DECIMAL(3, 2));
insert into t1 value (1.10);

create table t2 (a DECIMAL(4, 3));
insert into t2 value (1.100);
select * from t, t1 where t.a=t1.a;
select * from t, t2 where t.a=t2.a;
  1. What did you expect to see?
mysql> select * from t, t1 where t.a=t1.a;
+------+------+
| a    | a    |
+------+------+
|  1.1 | 1.10 |
+------+------+
1 row in set (0.00 sec)

mysql> select * from t, t2 where t.a=t2.a;
+------+-------+
| a    | a     |
+------+-------+
|  1.1 | 1.100 |
+------+-------+
1 row in set (0.01 sec)
  1. What did you see instead?
mysql> select * from t, t1 where t.a=t1.a;
Empty set (0.00 sec)

mysql> select * from t, t2 where t.a=t2.a;
+------+-------+
| a    | a     |
+------+-------+
|  1.1 | 1.100 |
+------+-------+
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)?
| Release Version: v4.0.0-alpha-85-gd69230bf8-dirty
Git Commit Hash: d69230bf8a6fe171f2740a35367b2e1226c03010
@SunRunAway SunRunAway added type/bug The issue is confirmed as a bug. sig/execution SIG execution labels Aug 23, 2019
@SunRunAway SunRunAway self-assigned this Aug 23, 2019
@SunRunAway SunRunAway added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Dec 5, 2019
@SunRunAway SunRunAway linked a pull request Aug 12, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant