From 5298602f8edb4475fce5d299532c7780e0e314a5 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 29 Aug 2013 10:26:24 -0400 Subject: [PATCH] bug #4046 Exporting huge Tables causes memory-Problems --- ChangeLog | 1 + export.php | 1 + libraries/common.inc.php | 12 ++++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0240b68d8e..e5a677c1c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ phpMyAdmin - ChangeLog - bug #4066 varchar field not truncated in table browse mode + rfe #1435 Opening database should expand it in the navigation menu - (performance) Removed ShowTooltip directive +- bug #4046 Exporting huge Tables causes memory-Problems 4.0.5.0 (2013-08-04) - bug #3977 Not detected configuration storage diff --git a/export.php b/export.php index 6b02d92fb0..54ad70ddd2 100644 --- a/export.php +++ b/export.php @@ -9,6 +9,7 @@ /** * Get the variables sent or posted to this script and a core script */ +define('PMA_BYPASS_GET_INSTANCE', 1); require_once 'libraries/common.inc.php'; require_once 'libraries/zip.lib.php'; require_once 'libraries/plugin_interface.lib.php'; diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 4f9b63a339..3f1f506c6b 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -749,8 +749,10 @@ if (@file_exists($_SESSION['PMA_Theme']->getLayoutFile())) { } if (! defined('PMA_MINIMUM_COMMON')) { - // get a dummy object to ensure that the class is instanciated - PMA_Response::getInstance(); + if (! defined('PMA_BYPASS_GET_INSTANCE')) { + // get a dummy object to ensure that the class is instanciated + PMA_Response::getInstance(); + } /** * Character set conversion. @@ -1055,7 +1057,9 @@ if (! defined('PMA_MINIMUM_COMMON')) { * Inclusion of profiling scripts is needed on various * pages like sql, tbl_sql, db_sql, tbl_select */ - $response = PMA_Response::getInstance(); + if (! defined('PMA_BYPASS_GET_INSTANCE')) { + $response = PMA_Response::getInstance(); + } if (isset($_SESSION['profiling'])) { $header = $response->getHeader(); $scripts = $header->getScripts(); @@ -1072,7 +1076,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { * There is no point in even attempting to process * an ajax request if there is a token mismatch */ - if ($response->isAjax() && $token_mismatch) { + if (isset($response) && $response->isAjax() && $token_mismatch) { $response->isSuccess(false); $response->addJSON( 'message',