[MDEV-17949] DROP FOREIGN KEY IF EXISTS is not supported in 10.3.11 Created: 2018-12-09  Updated: 2019-01-06  Resolved: 2019-01-06

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: 10.3.11
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: jaborandi Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

Centos 6



 Description   

"IF EXISTS" option was added to several commands of ALTER TABLE, including "DROP FOREIGN KEY", a while ago

It throws a syntax error on 10.3.11

I am not sure on which version exactly the regression happened.

I know that DROP FOREIGN KEY IF EXISTS works fine on 10.0.36 (had it working on local setup and downgraded server to this version to avoid patching code)



 Comments   
Comment by Elena Stepanova [ 2018-12-09 ]

Could you please paste the whole statement and the output? It appears to work for me:

ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS x;
Warnings:
Note	1091	Can't DROP FOREIGN KEY `x`; check that it exists

Generated at Thu Feb 08 08:40:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.