From db40959fd23e5f5b483100a58af431547be3a504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sat, 8 Oct 2005 13:28:07 +0000 Subject: [PATCH] Fix execution of single large queries. --- ChangeLog | 1 + libraries/import.lib.php | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06e5f72db..51fd68add 100755 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,7 @@ $Source$ over login, needed for RFE #1278312. * Documentation.html: Add example for redirects like /phpMyAdmin/database/table (RFE #1278312). + * libraries/import.lib.php: Fix execution of single large queries. 2005-10-07 Marc Delisle * libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a diff --git a/libraries/import.lib.php b/libraries/import.lib.php index 5b71cdc2f..c28386c27 100644 --- a/libraries/import.lib.php +++ b/libraries/import.lib.php @@ -88,6 +88,9 @@ function PMA_importRunQuery($sql = '', $full = '') { if (!$sql_query_disabled) { $complete_query = $sql_query; $display_query = $sql_query; + } else { + $complete_query = ''; + $display_query = ''; } $sql_query = $import_run_buffer['sql']; } elseif ($run_query) { @@ -144,16 +147,18 @@ function PMA_importRunQuery($sql = '', $full = '') { } } } - // check length of query - if ($cfg['VerboseMultiSubmit'] && !empty($sql_query)) { - if (strlen($sql_query) > 50000 || $executed_queries > 50 || $max_sql_len > 1000) { - $sql_query = ''; - $sql_query_disabled = TRUE; - } - } else { - if (strlen($sql_query) > 10000 || $executed_queries > 10 || $max_sql_len > 500) { - $sql_query = ''; - $sql_query_disabled = TRUE; + // check length of query unless we decided to pass it to sql.php + if (!$go_sql) { + if ($cfg['VerboseMultiSubmit'] && !empty($sql_query)) { + if (strlen($sql_query) > 50000 || $executed_queries > 50 || $max_sql_len > 1000) { + $sql_query = ''; + $sql_query_disabled = TRUE; + } + } else { + if (strlen($sql_query) > 10000 || $executed_queries > 10 || $max_sql_len > 500) { + $sql_query = ''; + $sql_query_disabled = TRUE; + } } } } // end do query (no skip)