[MDEV-9709] Unexpected modification of value and warning about out of range value upon ALTER Created: 2016-03-10 Updated: 2016-03-21 Resolved: 2016-03-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Consider the following example:
The first INSERT inserts out of range values into `f` and `d10_10` columns. The warnings are issued, and values are adjusted (whether they are adjusted correctly is another question, but it's not the point of this report):
The second INSERT also inserts out of range values into these columns, but somehow the server only complains about the float column, but not about `d10_10` (and it was so in previous versions):
But when we are adding a new unrelated column to the table, the server suddenly realizes that the value was wrong, issues a warning and amends the value:
It is not so in 10.1 and MySQL 5.7, both versions stick to the inserted value:
It does not seem right to change the value upon ALTER – if there is a problem with the value, it should be noticed and dealt with upon INSERT. |
| Comments |
| Comment by Alexander Barkov [ 2016-03-11 ] | ||||||||||
|
A smaller script demonstrating the same problem:
The expected result is -0.9999999999. This is repeatable in 10.0, 10.1, 10.2. | ||||||||||
| Comment by Alexander Barkov [ 2016-03-11 ] | ||||||||||
|
The same problem is repeatable with FLOAT:
The expected result is 0.99. |