Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1954

unwanted duplicate foreign key constraints sneaking in... (no replies)

$
0
0
I am using MySQL 5.0.51a-3ubuntu5.7 and managing with phpMyAdmin version 3.3.5...

Here is the problem - well, first of all my InnoDB tables work perfectly and the foreign constraints behave exactly as intended. However when I export the DB for backup purposes and browse the SQL text file I notice this (see SQL on bottom)... somehow duplicates of my FK's are sneaking in (not intentionally!) I have not tracked down the precise action that causes these duplicate FK's to manifest yet, but they don't appear to be causing any problems. But this can't be good for performance as I assume that InnoDB will check all the FK's including duplicates on each query. I manually removed all the duplicate FK entries from the SQL file and re-imported it and they were gone... but then they sneak back in. What is causing this? (I have hundreds of tables in my DB and they all have duplicate FK entries)... is it a bug in phpMyAdmin or is InnoDB doing this somehow?

Thanks for any help you can give me!

Marvin


--
-- Constraints for table `writer_available_2`
--
ALTER TABLE `writer_available_2`
ADD CONSTRAINT `writer_available_2_ibfk_5` FOREIGN KEY (`writer_available_id`) REFERENCES `writer_available_1` (`writer_available_id`),
ADD CONSTRAINT `writer_available_2_ibfk_6` FOREIGN KEY (`access_log_id`) REFERENCES `access_log_1` (`access_log_id`),
ADD CONSTRAINT `writer_available_2_ibfk_7` FOREIGN KEY (`access_log_id`) REFERENCES `access_log_1` (`access_log_id`),
ADD CONSTRAINT `writer_available_2_ibfk_8` FOREIGN KEY (`writer_available_id`) REFERENCES `writer_available_1` (`writer_available_id`),
ADD CONSTRAINT `writer_available_2_ibfk_1` FOREIGN KEY (`access_log_id`) REFERENCES `access_log_1` (`access_log_id`),
ADD CONSTRAINT `writer_available_2_ibfk_2` FOREIGN KEY (`writer_available_id`) REFERENCES `writer_available_1` (`writer_available_id`),
ADD CONSTRAINT `writer_available_2_ibfk_3` FOREIGN KEY (`writer_available_id`) REFERENCES `writer_available_1` (`writer_available_id`),
ADD CONSTRAINT `writer_available_2_ibfk_4` FOREIGN KEY (`access_log_id`) REFERENCES `access_log_1` (`access_log_id`);

Viewing all articles
Browse latest Browse all 1954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>