[MDEV-6907] Can't drop column for which a foreign key exists Created: 2014-10-21 Updated: 2014-10-22 Resolved: 2014-10-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 5.5.40 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Vitaliy Filippov | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | upstream | ||
| Environment: |
Debian Wheezy 32-bit |
||
| Description |
|
Hi! In MariaDB, it's impossible to drop a column which references another table with a foreign key - i.e. not the REFERENCED column, but the one that REFERENCES other table. I find it strange - why MariaDB doesn't just drop the FK along with the dropped column?
|
| Comments |
| Comment by Elena Stepanova [ 2014-10-21 ] |
|
The manual doesn't specify one way or another, so it's not clear whether it's a bug. I have my doubts. This implicit action would be obscure and more confusing than the current behavior, and an attempt to do it this way would cause lots of questions, e.g.
And the only gain would be that a DBA does not have to perform an extra step dropping the FK when they encounter the error? In any case, the current behavior comes from upstream. If you feel strong about this, please try to file a bug report at bugs.mysql.com – if they decide to implement it, eventually it will make it to MariaDB too. |
| Comment by Vitaliy Filippov [ 2014-10-21 ] |
|
Hm... sorry. I had a strange feeling that upstream MySQL just drop FKs in this case... It seems I was incorrect. Feel free to close the issue. It's PostgreSQL that drops FKs in this case. |