1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-28 07:41:55 +03:00

rfe Ability to disable foreign key check when emptying tables

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
Madhura Jayaratne
2015-02-12 14:37:18 +05:30
parent ba8c811e97
commit d40a48ec39
2 changed files with 7 additions and 3 deletions

View File

@@ -215,7 +215,9 @@ if (!empty($submit_mult) && !empty($what)) {
}
if (! isset($_REQUEST['fk_check'])
&& ($query_type == 'drop_tbl' || $query_type == 'row_delete')
&& ($query_type == 'drop_tbl'
|| $query_type == 'empty_tbl'
|| $query_type == 'row_delete')
) {
$default_fk_check_value = $GLOBALS['dbi']->fetchValue(
'SHOW VARIABLES LIKE \'foreign_key_checks\';', 0, 1
@@ -273,7 +275,9 @@ if (!empty($submit_mult) && !empty($what)) {
}
}
if (! isset($_REQUEST['fk_check'])
&& ($query_type == 'drop_tbl' || $query_type == 'row_delete')
&& ($query_type == 'drop_tbl'
|| $query_type == 'empty_tbl'
|| $query_type == 'row_delete')
&& $default_fk_check_value
) {
$GLOBALS['dbi']->query('SET FOREIGN_KEY_CHECKS = 1;');

View File

@@ -433,7 +433,7 @@ function PMA_getHtmlForOtherActions($what, $action, $_url_params, $full_query)
$html .= '<form action="' . $action . '" method="post">';
$html .= PMA_URL_getHiddenInputs($_url_params);
// Display option to disable foreign key checks while dropping tables
if ($what == 'drop_tbl' || $what == 'row_delete') {
if ($what == 'drop_tbl' || $what == 'empty_tbl' || $what == 'row_delete') {
$html .= '<div id="foreignkeychk">';
$html .= '<label for="fkc_checkbox">';
$html .= __('Foreign key check:');