4 messages in com.mysql.lists.clusterRe: Foreign key check fails when migr...
FromSent OnAttachments
Philipp Taprogge18 Oct 2006 05:31 
Anatoly Pidruchny18 Oct 2006 05:49 
Philipp Taprogge18 Oct 2006 06:12 
Philipp Taprogge18 Oct 2006 07:20 
Subject:Re: Foreign key check fails when migrating to ndb
From:Anatoly Pidruchny (apid@newxt.com)
Date:10/18/2006 05:49:20 AM
List:com.mysql.lists.cluster

Hi, Philipp!

do you know that NDB engine does not support foreign key constraints? Therefore, if you are moving the whole database to NDB storage engine, then you can drop them now, you will not really loose anything useful. If your application needs those foreign key constraints, then you will probably have to make some changes. For example, you can use triggers to ensure database consistency.

Best Regards,

Anatoly.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Hello!

I am relatively new to clustering MySQL and I ran into a wall here...

We have an existing database that needs to be migrated during the upgrade of one of our applications. Since the db already contains huge amounts of data, a migratins directly to ndb storage does not seem wise. I therefor created the new tables as innodb, let our migration tool insert the records and now I would like to move those tables to the cluster.

Unforturately, a

ALTER TABLE sometable ENGINE=NDB;

fails because of

ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails

for all tables in the database. I would hate to drop and recreate the foreign key constraints manually, because the tables themselves are auto-generated by the application server and the potential for error seems too great.

I tried to issue a

SET FOREIGN_KEY_CHECKS=0;

before the ALTER TABLE, but that did nothing. The error remains.

Can anyone enlighten me? What is the correct procedure for moving a whole db to a cluster environment?

Regards,

Phil

- -- All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer. -- IBM maintenance manual, 1925 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRTYeyeSILlca4lrrAQKZTwP9EdnsUZ+nJ2fB8m6SC3leU6xvi+2TtyDF cwrLXHowHhj9VnLPptPkdOytSi2YNBhkyJmB5gRYZsD1p92F3Ay40/hX/Spuzlz7 GHyPqdFXOt20IT/xWhyoe66s3wpGdETCSJCdd15rvsA8rL/Ps8ue+6KaPypcqbgL kW6BanZh0lo= =ewnI -----END PGP SIGNATURE-----