[MDEV-15946] MEDIUMINT(N<8) creates a wrong data type on conversion to string Created: 2018-04-20 Updated: 2018-04-23 Resolved: 2018-04-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3 |
| Fix Version/s: | 10.3.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
The MEDIUMINT type has the following characteristics depending on signess:
But these characteristics are not taken into account precisely:
For INT-alike data types, the specified length does not constrain the supported type range. So MEDIUMINT(2) still supports the entire MEDIUMINT range (as mentioned above). But in all cases, the maximum possible length on conversion to string is 8, for both signed and unsigned variants. The column corresponding to the MEDIUMINT SIGNED erroneously creates a varchar(9) on conversion to string. The expected result is varchar(8). |