diff --git a/ChangeLog b/ChangeLog index e5d3c699f2..d351b7699e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog - bug Missing tooltip in monitor - bug Missing sort icons in monitor - bug #4805 Inline edit broken when using functions in query +- bug #4821 Timed-out import fails to restart when file represented 4.4.0.0 (not yet released) + rfe #1553 InnoDB presently supports one FULLTEXT index creation at a time diff --git a/import.php b/import.php index f15af065c4..cccd4c15df 100644 --- a/import.php +++ b/import.php @@ -76,6 +76,7 @@ $post_params = array( 'MAX_FILE_SIZE', 'message_to_show', 'noplugin', + 'skip', 'skip_queries', 'local_import_file' ); @@ -655,12 +656,19 @@ if (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 2) { // Did we hit timeout? Tell it user. if ($timeout_passed) { + $importUrl = $err_url .= '&timeout_passed=1&offset=' . urlencode($GLOBALS['offset']); + if (isset($local_import_file)) { + $importUrl .= '&local_import_file=' . urlencode($local_import_file); + } $message = PMA_Message::error( __( 'Script timeout passed, if you want to finish import,' - . ' please resubmit same file and import will resume.' + . ' please click %shere%s to resubmit same file and import will resume.' ) ); + $message->addParam('', false); + $message->addParam('', false); + if ($offset == 0 || (isset($original_skip) && $original_skip == $offset)) { $message->addString( __( diff --git a/libraries/display_import.inc.php b/libraries/display_import.inc.php index 8431f2c1c3..359be83f8d 100644 --- a/libraries/display_import.inc.php +++ b/libraries/display_import.inc.php @@ -35,6 +35,16 @@ if (empty($import_list)) { exit; } +if (PMA_isValid($_REQUEST['offset'], 'numeric')) { + $offset = $_REQUEST['offset']; +} +if (isset($_REQUEST['timeout_passed'])) { + $timeout_passed = $_REQUEST['timeout_passed']; +} +if (isset($_REQUEST['local_import_file'])) { + $local_import_file = $_REQUEST['local_import_file']; +} + $timeout_passed_str = isset($timeout_passed)? $timeout_passed : null; $offset_str = isset($offset)? $offset : null; $html = PMA_getHtmlForImport( diff --git a/libraries/plugins/import/ImportSql.class.php b/libraries/plugins/import/ImportSql.class.php index 05727d65a3..5e9c35f015 100644 --- a/libraries/plugins/import/ImportSql.class.php +++ b/libraries/plugins/import/ImportSql.class.php @@ -465,16 +465,18 @@ class ImportSql extends ImportPlugin ); } - //Commit any possible data in buffers - PMA_importRunQuery( - $this->_stringFctToUse['substr']( + if (! $timeout_passed) { + //Commit any possible data in buffers + PMA_importRunQuery( + $this->_stringFctToUse['substr']( + $this->_data, + $this->_queryBeginPosition + ), //Query to execute $this->_data, - $this->_queryBeginPosition - ), //Query to execute - $this->_data, - false, - $sql_data - ); + false, + $sql_data + ); + } PMA_importRunQuery('', '', false, $sql_data); }