[MDEV-29001] ALTER COLUMN DROP DEFAULT makes SHOW CREATE TABLE diverge from the actual structure Created: 2022-07-01 Updated: 2023-11-28 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Aleksey Midenkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
MariaDB KB doesn't describe the exact semantics of DROP DEFAULT (or I couldn't find it). But at least according to MySQL manual,
This is not what in fact happens (neither in MariaDB nor in MySQL).
So, the column loses NULL as a default value and doesn't get a new one. Since there is no way to indicate in SHOW CREATE TABLE that a null-able column should not have a default value, I suppose the behavior should be adjusted to what MySQL manual describes. MySQL (5.6/5.7/8.0) behaves the same way. There is an open (accepted) bug report about it in MySQL bug system. |
| Comments |
| Comment by Elena Stepanova [ 2022-12-06 ] |
|
The obvious consequence is that mysqldump-based provisioning involving such such tables is broken. |