Christian,

----- Original Message -----
From: "Christian Lizell" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.mysql
Sent: Thursday, October 24, 2002 6:18 PM
Subject: Database in path to foreign key references


> Hello!
>
> Is there any way to get rid of the database name in the path to the
> reference of a foreign key. When using mysqldump to copy a database
> the name of the source database is in the path of the foreign key
> reference. In my case, that is not what I want.
>
> An example:
>
> mysql> use source_database;
> mysql> create table T (
>    myId int not null, KEY id_ind (myId),
>    FOREIGN KEY (myId) REFERENCES T2 (otherId)
> ) type=innodb;
>
> bash> mysqldump source_database
> CREATE TABLE T (
>    myId int(11) NOT NULL default '0',
>    KEY id_ind (myId),
>    FOREIGN KEY (`myId`) REFERENCES `source_database.T2` (`otherId`)
> ) TYPE=InnoDB;
>
> bash> mysqldump source_database | mysql destination_database
>
> Now I have a working copy of the source_database, however all
> references are to the source_database, which is really not what I want.
>
> Is this a feature or is it a bug? Is there a way to get mysql not to
> add the database name in the foreign key reference?

a good point. I have now added to my TODO list to remove the database name
SHOW CREATE TABLE output if the database is the same as the table itself.

> Thanks,
> /Christian

Thank you,

Heikki

> --
> __ Athega AB _____________________ for net workers __
>   Hantverkargatan 21             phone +46 8 54513330
>   SE-112 21 Stockholm, SWEDEN      fax +46 8 54513338
>   http://www.athega.se/         mobile +46 709 156000

sql query




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to