[MDEV-12044] Unsigned bigint overflow problem when using an index Created: 2017-02-10 Updated: 2021-11-03 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.0.21, 10.1.19, 10.2.3 |
| Fix Version/s: | 10.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Claudio Nanni | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | bigint, unsigned | ||
| Attachments: |
|
| Description |
|
When using an index a query may present the following strange behaviour: 1) A constant value is wrongly returned 2) Results are not found 3) ERROR 1690 (22003): BIGINT value is out of range is not consistent
And I think there are many other related side effects. Test case attached. |
| Comments |
| Comment by Elena Stepanova [ 2017-02-13 ] | ||||||||||||||||||||||||||||||||||||||
|
Constant value wrongly returned:
Results are not found:
| ||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2017-06-14 ] | ||||||||||||||||||||||||||||||||||||||
|
A smaller script demonstrating the problem.
Problem N1This query returns a correct result:
Now I run the same query with a WHERE condition added, it returns a wrong result for the last column:
Problem N2This query returns a correct result:
Now if I change the WHERE condition to use an equivalent BETWEEN predicate, it erroneously returns 0:
Problem N3This query correctly returns a result:
This query unexpectedly returns an error:
|