diff --git a/ChangeLog b/ChangeLog index 56802094bc..b2271d23fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ phpMyAdmin - ChangeLog + rfe #3488640 Expand table-group in non-light navigation frame if only one + Patch #3509360 Contest-3: Option "Truncate table" before "insert" + Patch #3506552 Contest-2: Show index information in the data dictionary ++ Patch #3510656 Contest-1: Ignoring foreign keys while dropping tables 3.5.1.0 (not yet released) - bug #3510784 [edit] Limit clause ignored when sort order is remembered diff --git a/js/db_structure.js b/js/db_structure.js index 5151bcaf38..5e205ed2af 100644 --- a/js/db_structure.js +++ b/js/db_structure.js @@ -253,6 +253,28 @@ $(document).ready(function() { }) // end $.post() }); + /** + * Event handler for 'Foreign Key Checks' disabling option + * in the drop table confirmation form + */ + $(".fkc_switch").click(function(event){ + if ($("#fkc_checkbox").attr('checked') == 'checked') { + $("#fkc_checkbox").removeAttr('checked'); + $("#fkc_status").html(PMA_messages['strForeignKeyCheckDisabled']); + return; + } + $("#fkc_checkbox").attr('checked','checked'); + $("#fkc_status").html(PMA_messages['strForeignKeyCheckEnabled']); + }); + + $('#fkc_checkbox').change(function () { + if ($(this).attr("checked")) { + $("#fkc_status").html(PMA_messages['strForeignKeyCheckEnabled']); + return; + } + $("#fkc_status").html(PMA_messages['strForeignKeyCheckDisabled']); + }); // End of event handler for 'Foreign Key Check' + /** * Ajax Event handler for 'Truncate Table' * diff --git a/js/messages.php b/js/messages.php index a9701430d6..6d573f2e7d 100644 --- a/js/messages.php +++ b/js/messages.php @@ -247,6 +247,9 @@ $js_messages['strNo'] = __('No'); $js_messages['strInsertTable'] = __('Insert Table'); $js_messages['strHideIndexes'] = __('Hide indexes'); $js_messages['strShowIndexes'] = __('Show indexes'); +$js_messages['strForeignKeyCheck'] = __('Foreign key check:'); +$js_messages['strForeignKeyCheckEnabled'] = __('(Enabled)'); +$js_messages['strForeignKeyCheckDisabled'] = __('(Disabled)'); /* For db_search.js */ $js_messages['strSearching'] = __('Searching'); diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index 0045a90159..d48616a41b 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -294,7 +294,17 @@ if (!empty($submit_mult) && !empty($what)) { ?>: -
+
+
+ + /> + +
@@ -464,6 +474,7 @@ if (!empty($submit_mult) && !empty($what)) { } // end for if ($query_type == 'drop_tbl') { + $default_fk_check_value = (PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'foreign_key_checks\';', 0, 1) == 'ON') ? 1 : 0; if (!empty($sql_query)) { $sql_query .= ';'; } elseif (!empty($sql_query_views)) { @@ -476,7 +487,13 @@ if (!empty($submit_mult) && !empty($what)) { include './sql.php'; } elseif (!$run_parts) { PMA_DBI_select_db($db); + if(!isset($_REQUEST['fk_check']) && $query_type == 'drop_tbl') { // for disabling foreign key checks while dropping tables + PMA_DBI_query('SET FOREIGN_KEY_CHECKS = 0;'); + } $result = PMA_DBI_try_query($sql_query); + if(!isset($_REQUEST['fk_check']) && $query_type == 'drop_tbl' && $default_fk_check_value) { + PMA_DBI_query('SET FOREIGN_KEY_CHECKS = 1;'); + } if ($result && !empty($sql_query_views)) { $sql_query .= ' ' . $sql_query_views . ';'; $result = PMA_DBI_try_query($sql_query_views); diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index d2f50e663f..712f595e5c 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -3041,6 +3041,12 @@ h2.active { color: black; font-weight: normal; } + +#foreignkeychk { + align:left; + position:absolute; + cursor:pointer; +} input.btn { color:#333; diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 8ca74ecd23..6714b55c75 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -3578,6 +3578,12 @@ h2.active { color: black; font-weight: normal; } + +#foreignkeychk { + align:left; + position:absolute; + cursor:pointer; +} input.btn { color: #333;