From 4a50d17c97f29e81794dc1dac3a5f7a77644b6ff Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 23 Sep 2007 14:02:19 +0000 Subject: [PATCH] bug #1798841 [relations] Copying db does not copy internal relations --- ChangeLog | 1 + libraries/Table.class.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 027e1bec7..fd0c60a72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA 2.11.2.0 (not yet released) - patch #1791576 HTTP auth: support REDIRECT_REMOTE_USER, thanks to Allard + [lang] Serbian update, thanks to Mihailo Stefanovic +- bug #1798841 [relations] Copying db does not copy internal relations 2.11.1.0 (2007-09-20) diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 96d5fd86b..afa0f20c0 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -838,15 +838,20 @@ class PMA_Table { $where_fields = array('db_name' => $source_db, 'table_name' => $source_table); $new_fields = array('db_name' => $target_db, 'table_name' => $target_table); PMA_Table::duplicateInfo('displaywork', 'table_info', $get_fields, $where_fields, $new_fields); + - $get_fields = array('master_field', 'foreign_db', 'foreign_table', 'foreign_field'); + /** + * @todo revise this code when we support cross-db relations + */ + $get_fields = array('master_field', 'foreign_table', 'foreign_field'); $where_fields = array('master_db' => $source_db, 'master_table' => $source_table); - $new_fields = array('master_db' => $target_db, 'master_table' => $target_table); + $new_fields = array('master_db' => $target_db, 'foreign_db' => $target_db, 'master_table' => $target_table); PMA_Table::duplicateInfo('relwork', 'relation', $get_fields, $where_fields, $new_fields); + - $get_fields = array('foreign_field', 'master_db', 'master_table', 'master_field'); + $get_fields = array('foreign_field', 'master_table', 'master_field'); $where_fields = array('foreign_db' => $source_db, 'foreign_table' => $source_table); - $new_fields = array('foreign_db' => $target_db, 'foreign_table' => $target_table); + $new_fields = array('master_db' => $target_db, 'foreign_db' => $target_db, 'foreign_table' => $target_table); PMA_Table::duplicateInfo('relwork', 'relation', $get_fields, $where_fields, $new_fields); /**