[MDEV-32889] Unexpected Results when Comparing Boolean with Floating-point Created: 2023-11-27 Updated: 2023-12-18 Resolved: 2023-12-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 11.2.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Suyang Zhong | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Latest docker image on Ubuntu 22.04 |
||
| Description |
|
Considering the test case below: The third `SELECT` returns an empty result, which is surprising: If the result of second query is -0.4 (`TRUE`), the value of the `true - c1/10` in `WHERE` condition should also be true, and thus the third query should return the row in `t0`.
I originally find this in the latest docker image. |
| Comments |
| Comment by Sergei Golubchik [ 2023-12-18 ] |
|
you evaluate a decimal in the integer context, it gets rounded, -0.4 becomes 0, that is FALSE. |