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).
Also, what's the goal of "Add constraints" ? I see that if someone does not tick it, it's a way to copy a db without an error about constraints, but what's next for the user? Manual constraints creation on the copy?
Yes, currently you can use this to copy table without constraints.
A user cannot choose to copy "constraints only". If he could, this would be interesting for him because he can do the full db copy in 2 passes (assuming PMA does not let him do it in one pass).
This should be easy to add, is it really needed? Shouldn't we provide tool for copying all dependent tables?
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;
Hi
On Fri, 23 Dec 2005 09:45:11 -0500 Marc Delisle Marc.Delisle@cegepsherbrooke.qc.ca wrote:
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.
Argh I thought I handled this situation. Please file a bug report I will look at it next year ;-).
Michal Čihař a écrit :
Hi
On Fri, 23 Dec 2005 09:45:11 -0500 Marc Delisle Marc.Delisle@cegepsherbrooke.qc.ca wrote:
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.
Argh I thought I handled this situation. Please file a bug report I will look at it next year ;-).
The bug report has already been filed by a user. https://sourceforge.net/tracker/?func=detail&atid=377408&aid=1388048...
Marc
On Fri, 23 Dec 2005 10:44:32 -0500 Marc Delisle Marc.Delisle@cegepsherbrooke.qc.ca wrote:
The bug report has already been filed by a user. https://sourceforge.net/tracker/?func=detail&atid=377408&aid=1388048...
Yes, but it's about pretty old version which IMHO didn't care about relations at all.