From d1bb02603436e1ad056582298fc7ee14156f62f6 Mon Sep 17 00:00:00 2001 From: Nisarg Jhaveri Date: Thu, 11 Jun 2015 08:05:42 +0530 Subject: [PATCH] Fix bug#4948 Signed-off-by: Nisarg Jhaveri --- libraries/import.lib.php | 3 +-- libraries/sql.lib.php | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/import.lib.php b/libraries/import.lib.php index 4bd0c6d243..e2fab3c3ed 100644 --- a/libraries/import.lib.php +++ b/libraries/import.lib.php @@ -135,8 +135,7 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false, && ! $error && ((! empty($import_run_buffer['sql']) && preg_match($pattern, $import_run_buffer['sql'])) - || ($executed_queries == 1 - && ! isset($_REQUEST['fk_checks']))) + || ($executed_queries == 1)) ) { $go_sql = true; if (! $sql_query_disabled) { diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index f946450314..f392aefa34 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -2086,6 +2086,9 @@ function PMA_executeQueryAndGetQueryResponse($analyzed_sql_results, include_once 'libraries/DisplayResults.class.php'; + // Hnadle disable/enable foreign key checks + $default_fk_check = PMA_Util::handleDisableFKCheckInit(); + // Handle remembered sorting order, only for single table query // Handling is not required when it's a union query // (the parser never sets the 'union' key to 0) @@ -2163,6 +2166,9 @@ function PMA_executeQueryAndGetQueryResponse($analyzed_sql_results, ); } + // Hnadle disable/enable foreign key checks + PMA_Util::handleDisableFKCheckCleanup($default_fk_check); + return $html_output; }