[MDEV-12691] Wrong result for: bigint_column BETWEEN time_column AND str_literal Created: 2017-05-04 Updated: 2022-12-05 Resolved: 2022-12-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.1, 10.2, 10.3 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Epic Link: | Data type cleanups |
| Description |
|
I run this script:
It correctly returns 1, because comparison is done as TIME, and '00:00:20' is really between '00:00:00' AND '10:00:00'. Now I change the data type for the column a from TIME to INT. Nothing should change: INT, TIME and STRING arguments should be compared as TIME. So BETWEEN should still return 1.
Works fine so far. Now I change the data type for a from INT to BIGINT. Nothing should change. It should still return 1. However, something different happens:
Notice, the result changed to 0, and now it returns a warning. Now if I wrap a into a function, it returns 1 again:
|
| Comments |
| Comment by Alice Sherepa [ 2022-12-05 ] |
|
currently 10.3 (4e9206736c4032069)-10.11 return the correct result, 1, no warning. |