Closed zhangysh1995 closed 4 years ago
This is because 0.1 cannot be represented exactly by float type. You can try 6.5, which in binary is 01000000 11010000 00000000 00000000, and can be selected from t.
If you want to use float, you can try select * from t where ABS(t - 0.1) < 0.0000001.
So this matches the design.
/bug non-bug
Bug Report
1. What did you do?
2. What did you expect to see?
Returned result with one row.
3. What did you see instead?
Nothing returned. However, the predicate is evaluated to true
(-0.1=-0.1)
:4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)