[MDEV-14038] ALTER TABLE does not exit on error with InnoDB + bad default function Created: 2017-10-10 Updated: 2017-10-11 Resolved: 2017-10-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3 |
| Fix Version/s: | 10.2.10, 10.3.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This script with a bad literal in DEFAULT correctly returns the "Out of range" error:
With ENGINE=InnoDB and the same literal it also return the same error:
With ENGINE=MyISAM and a bad function in DEFAULT, it also returns the same error:
So far so good. With ENGINE=InnoDB and a bad function in DEFAULT, it does not return any errors:
This looks wrong. DESCRIBE reports that the ALTER did actually happen:
And this query tells that 1000 was silently changed to 127:
InnoDB should be fixed to return the error, like MyISAM does, and like InnoDB does with literals. |
| Comments |
| Comment by Marko Mäkelä [ 2017-10-10 ] | ||||||||||
|
I think that InnoDB should behave the same as MyISAM when ALGORITHM=COPY or old_alter_table=1 is in effect. | ||||||||||
| Comment by Alexander Barkov [ 2017-10-11 ] | ||||||||||
|
The same problem is repeatable with this script:
It correctly returns the error:
But the DESCRIBE query tells that the ALTER in fact happened:
Looks wrong. The column b should not have been added. If I change ENGINE to MyISAM, it correctly refuses to do ALTER. |