From bc7722584e46639cbd11b7ea10f6cd22f01ce7a3 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 31 Jan 2010 16:42:06 +0000 Subject: [PATCH] bug #2941101 import timeout when table already created and several data lines --- ChangeLog | 2 ++ import.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dc1a8e923..5e2c458bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -94,6 +94,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA 3.2.6.0 (not yet released) - bug #2938492 [display] information_schema sorting order +- bug #2941101 [import] import timeout when table already created and + several data lines 3.2.5.0 (2010-01-10) - patch #2903400 [bookmarks] Status of bookmark table, diff --git a/import.php b/import.php index 59274ea3e..7aa6088fb 100644 --- a/import.php +++ b/import.php @@ -433,7 +433,11 @@ if (isset($message)) { } // Parse and analyze the query, for correct db and table name // in case of a query typed in the query window -require_once './libraries/parse_analyze.lib.php'; +// (but if the query is too large, in case of an imported file, the parser +// can choke on it so avoid parsing) +if (strlen($sql_query) <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { + require_once './libraries/parse_analyze.lib.php'; +} // There was an error? if (isset($my_die)) {