[MDEV-8919] Wrong result for CAST(9999999999999999999.0) Created: 2015-10-08 Updated: 2019-05-17 Resolved: 2019-05-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.0, 10.1, 10.2 |
| Fix Version/s: | 10.4.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.1.15, 10.2.2-1 | ||||||||
| Description |
|
returns
The c1 value looks wrong. Note, implicit cast on INSERT works fine:
|
| Comments |
| Comment by Alexander Barkov [ 2016-06-23 ] | |||||||||||||||||||||
|
Negative numbers also do not convert well:
The expected result is to return 0 in both cases, similar to what happens in case of DECIMAL:
Note, implicit cast on INSERT works as expected:
| |||||||||||||||||||||
| Comment by Alexander Barkov [ 2016-06-23 ] | |||||||||||||||||||||
|
Negative TIME values also do not convert well:
The expected result should be 0, similar to what happens in case of CAST(-1.123 AS UNSIGNED). Note, implicit cast on INSERT works as expected:
| |||||||||||||||||||||
| Comment by Alexander Barkov [ 2016-06-27 ] | |||||||||||||||||||||
|
This script:
also returns a wrong result:
The expected result is to return 9223372036854775807 in both columns. | |||||||||||||||||||||
| Comment by Alexander Barkov [ 2016-06-27 ] | |||||||||||||||||||||
|
This script:
returns
The expected result for CAST is 9223372036854775807, with a warning. | |||||||||||||||||||||
| Comment by Alexander Barkov [ 2019-05-17 ] | |||||||||||||||||||||
|
The old patch is outdated. As this is a minor issue, let's fix in 10.4 using Type_handler infrastructrure. |