[MDEV-10305] CAST(string_expr AS SIGNED) does not truncate huge numbers well Created: 2016-06-29 Updated: 2016-06-29 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0, 10.1, 10.2 |
| Fix Version/s: | 10.2 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Implicit CAST from string to signed bigint truncates the number the to maximum possible 64-bit signed value:
So does explicit CAST from DECIMAL to SIGNED:
So does explicit CAST from DOUBLE to SIGNED:
Explicit CAST from string to SIGNED works differently:
This looks wrong. Explicit CAST from string to SIGNED should also return 9223372036854775807. |
| Comments |
| Comment by Alexander Barkov [ 2016-06-29 ] | ||||||
|
Dynamic columns also do not work well:
|