Michal Čihař a écrit :
Hi Marc
replying to devel list as I thing it belongs there.
On Thu, 22 Dec 2005 13:46:20 -0500 Marc Delisle Marc.Delisle@cegepsherbrooke.qc.ca wrote:
Can you confirm that there remains some work to do, to be able to copy a db containing innodb constraints? The constraints creation must be done after all necessary tables have been created.
If you copy one table, you have to handle constraints manually. While copying whole database, it should work (if there are not possible cross db relations, what I don't know right now).
In my test, the copy of the following db fails, because when calling PMA_table_move_copy() the first time with table "persons", the referenced table "towns" does not exist but an attempt is made to create the constraint.
Note that exporting this db produces a correct dump, remembering to create the constraints after all the tables are created.
CREATE TABLE `persons` ( `id` int(11) NOT NULL default '0', `name` varchar(50) NOT NULL default '', `town_id` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `town_id` (`town_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `towns` ( `id` int(11) NOT NULL default '0', `description` varchar(50) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;