Hi, Holyfoot! On Jan 31, holyfoot@askmonty.org wrote:
At file:///home/hf/wmar/mdev-4439/
------------------------------------------------------------ revno: 3886 revision-id: holyfoot@askmonty.org-20140131134044-ej3ftpf240xbn0lc parent: knielsen@knielsen-hq.org-20131107065240-gxxg4ilcs8o2v0q2 committer: Alexey Botchkov <holyfoot@askmonty.org> branch nick: mdev-4439 timestamp: Fri 2014-01-31 17:40:44 +0400 message: MDEV-4439 ALTER TABLE .. [ADD|DROP] FOREIGN KEY IF [NOT] EXISTS does not work if constraint name is not used. Patches for server and the Innodb engine. Server is fixed so it does nothing if no indexes left to alter. Innodb parser is fixed so it looks for the IF [NOT] EXISTS option, takes into account the drop->if_not_exists parameter. Another change is that it uses the index name for the internal dictionary. Prior to that it only used the CONSTRAINT name for it.
That looks pretty much ok, but please add tests that use generated FK names. For example, it doesn't look like you handle the case of ADD FOREIGN KEY IF NOT EXISTS existing_generated_name (...) Regards, Sergei