Bug #57838 | mysqldump: sequence of CREATE TABLE ignores FOREIGN KEY | ||
---|---|---|---|
Submitted: | 29 Oct 2010 9:22 | Modified: | 7 Nov 2010 13:47 |
Reporter: | Kai Sautter (Basic Quality Contributor) | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: mysqldump Command-line Client | Severity: | S3 (Non-critical) |
Version: | 5.1.51 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | qc |
[29 Oct 2010 9:22]
Kai Sautter
[29 Oct 2010 9:48]
Peter Laursen
You need to SET FOREIGN_KEY_CHECKS = 0. Does not 'mysqldump' always? I think so. Peter (not a MySQL person)
[29 Oct 2010 12:24]
Kai Sautter
SET FOREIGN_KEY_CHECKS = 0 does the job. Thank you. Unfortunately, this option is not automatically set (and unset) by the dump file. Would it be feasible to add this automatically (maybe governed by a specific option, if required not to interfere with other functionality). I suggest to re-rate the bug to S3.
[29 Oct 2010 12:30]
Valeriy Kravchuk
Please, check output of mysqldump without any options: macbook-pro:5.5 openxs$ bin/mysqldump -uroot x -- MySQL dump 10.13 Distrib 5.5.7-rc, for apple-darwin9.6.0 (i386) -- -- Host: localhost Database: x -- ------------------------------------------------------ -- Server version 5.5.7-rc-debug /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; ... Note the last line above. I clearly see that FOREIGN_KEY_CHECKS is set to 0.
[2 Nov 2010 16:25]
Kai Sautter
I checked the files --> line is present as described I checked this against a clean installation of mysql 5.1.52, but could not reproduce the behaviour. I suggest to mark this bug as not reproducible.
[7 Nov 2010 13:47]
Valeriy Kravchuk
Not repeatable with recent versions.
[22 Nov 2013 10:56]
Andrii Nikitin
see also bug #70979 load of mysqldump script may fail with error 1215 if dest already has tables