The branch, master has been updated via 2aec106b901ff5d799bbd66c4eb29dd66d9db90e (commit) via 2e101cc7336f2a448dd1682a49f8b343386f8c07 (commit) from 66b879c458667b50f9243acebfc47efe53517c59 (commit)
- Log ----------------------------------------------------------------- commit 2aec106b901ff5d799bbd66c4eb29dd66d9db90e Merge: 66b879c 2e101cc Author: Madhura Jayaratne madhura.cj@gmail.com Date: Tue Sep 27 21:11:10 2011 +0530
Merge branch 'QA_3_4'
Conflicts: tbl_relation.php
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + tbl_relation.php | 17 +++++------------ 2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog index e9971da..576bd5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -62,6 +62,7 @@ phpMyAdmin - ChangeLog - bug #3411633 [core] Call to undefined function PMA_isSuperuser() - bug #3413743 [interface] Display options link missing after search - bug #3324161 [core] CSP policy causing designer JS buttons to fail +- bug #3412862 [relation] Relations/constraints are dropped/created on every change
3.4.5.0 (2011-09-14) - bug #3375325 [interface] Page list in navigation frame looks odd diff --git a/tbl_relation.php b/tbl_relation.php index 6bebd28..7e49758 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -216,25 +216,18 @@ if (isset($_REQUEST['destination_foreign'])) { } elseif (PMA_backquote($existrel_foreign[$master_field]['foreign_db']) != $foreign_db || PMA_backquote($existrel_foreign[$master_field]['foreign_table']) != $foreign_table || PMA_backquote($existrel_foreign[$master_field]['foreign_field']) != $foreign_field - || ($_REQUEST['on_delete'][$master_field_md5] != (!empty($existrel_foreign[$master_field]['on_delete']) ? $existrel_foreign[$master_field]['on_delete'] : '')) - || ($_REQUEST['on_update'][$master_field_md5] != (!empty($existrel_foreign[$master_field]['on_update']) ? $existrel_foreign[$master_field]['on_update'] : '')) + || ($_REQUEST['on_delete'][$master_field_md5] != (!empty($existrel_foreign[$master_field]['on_delete']) ? $existrel_foreign[$master_field]['on_delete'] : 'RESTRICT')) + || ($_REQUEST['on_update'][$master_field_md5] != (!empty($existrel_foreign[$master_field]['on_update']) ? $existrel_foreign[$master_field]['on_update'] : 'RESTRICT')) ) { // another foreign key is already defined for this field // or // an option has been changed for ON DELETE or ON UPDATE
- // remove existing key + // remove existing key and add the new one $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP FOREIGN KEY ' - . PMA_backquote($existrel_foreign[$master_field]['constraint']) . ';'; - - // I tried to send both in one query but it failed - PMA_DBI_query($sql_query); - $display_query .= $sql_query . "\n"; - - // add another - $sql_query = 'ALTER TABLE ' . PMA_backquote($table) - . ' ADD FOREIGN KEY (' + . PMA_backquote($existrel_foreign[$master_field]['constraint']) . ', ' + . 'ADD FOREIGN KEY (' . PMA_backquote($master_field) . ')' . ' REFERENCES ' . $foreign_db . '.'
hooks/post-receive