Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111072 - Foreign key issues restoring database
Summary: Foreign key issues restoring database
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-developer
Classification: Unclassified
Component: Guide XML (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: nm (RETIRED)
URL: http://www.gentoo.org/doc/en/mysql-up...
Whiteboard:
Keywords:
: 120853 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-31 17:30 UTC by George Clark
Modified: 2007-01-06 21:38 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
http://overlays.gentoo.org/proj/mysql/changeset/508?format=diff&new=508 (url.txt,71 bytes, text/plain)
2007-01-06 13:01 UTC, Francesco R. (RETIRED)
Details
http://overlays.gentoo.org/proj/mysql/changeset/509?format=diff&new=509 (url.txt,71 bytes, text/plain)
2007-01-06 13:07 UTC, Francesco R. (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description George Clark 2005-10-31 17:30:19 UTC
In section 3.5 of the upgrade documentation, the procedure is given to import
the previously saved data back into MySQL.  Depending upon table order and
InnoDB foreign key dependencies, the import will fail to create tables that are
dependent upon tables that are created later in the dump.   The errors regarding
table creation are not necessarily obvious.  You might want to mention the
resolution in the document.

This can be resolved by inserting the following line into the backup file:

SET FOREIGN_KEY_CHECKS=0

And then re-enabling the checks at the end of the file:

SET FOREIGN_KEY_CHECKS=1

Also note that issuing SET AUTOCOMMIT=0 and SET SQL_LOG_BIN=0 might increase the
speed of the upload for large sets of data.
Comment 1 Chris White (RETIRED) gentoo-dev 2006-01-18 11:08:47 UTC
yes, this should be noted as foreign key support is somewhat new, and I honestly wouldn't be surprised that sql imports would cause this.
Comment 2 Xavier Neys (RETIRED) gentoo-dev 2006-02-01 03:52:57 UTC
*** Bug 120853 has been marked as a duplicate of this bug. ***
Comment 3 nm (RETIRED) gentoo-dev 2006-11-22 00:02:40 UTC
(In reply to comment #0)
Uh, is this still an issue? The original report is a year old; mysql versions have come and gone.

CCing chriswhite, as he's the master of all things mysql. What do you think, chris? Should we add any of the suggestions here to the guide?
Comment 4 Francesco R. (RETIRED) gentoo-dev 2007-01-06 13:01:41 UTC
Created attachment 105643 [details]
http://overlays.gentoo.org/proj/mysql/changeset/508?format=diff&new=508

Mentioning the problem should be enough these days
Comment 5 Francesco R. (RETIRED) gentoo-dev 2007-01-06 13:07:34 UTC
Created attachment 105647 [details]
http://overlays.gentoo.org/proj/mysql/changeset/509?format=diff&new=509

Another change that fix a real bug in the flow of the unload,
LOCKs are bound to sessions, so execute "FLUSH TABLES WITH READ LOCK" the way it's now is a totally non-sense.

Thanks to Alex Efros that mentioning it in gentoo-server ml.
Comment 6 nm (RETIRED) gentoo-dev 2007-01-06 21:38:22 UTC
Fixed in CVS, thanks for reporting and to vivo for the patches.