Tried a fix for bug #508746 - PMA_splitSqlFile() crashes server
This commit is contained in:
@@ -5,11 +5,16 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2002-02-17 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||||
|
* read_dump.php3; libraries/build_dump.lib.php3: tried a fix for
|
||||||
|
bug #508746 - PMA_splitSqlFile() crashes server. Thanks to
|
||||||
|
Matthias Fichtner (mfichtner) for the suggestions he did.
|
||||||
|
|
||||||
2002-02-16 Marc Delisle <lem9@users.sourceforge.net>
|
2002-02-16 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* db_details.php3, no links if no data,
|
* db_details.php3, no links if no data,
|
||||||
thanks to Alexander M. Turek (rabus)
|
thanks to Alexander M. Turek (rabus)
|
||||||
|
|
||||||
2002-02-09 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
2002-02-15 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||||
* Documentation.html: line sizes.
|
* Documentation.html: line sizes.
|
||||||
* sql.php3: optimized a bit.
|
* sql.php3: optimized a bit.
|
||||||
* libraries/select_lang.php3: sorted the languages array.
|
* libraries/select_lang.php3: sorted the languages array.
|
||||||
|
@@ -210,6 +210,13 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
|
|||||||
|
|
||||||
@set_time_limit($GLOBALS['cfgExecTimeLimit']);
|
@set_time_limit($GLOBALS['cfgExecTimeLimit']);
|
||||||
|
|
||||||
|
// loic1: send a fake header to bypass browser timeout if data
|
||||||
|
// are bufferized - part 1
|
||||||
|
if (!empty($GLOBALS['ob_mode'])
|
||||||
|
|| (isset($GLOBALS['zip']) || isset($GLOBALS['bzip']) || isset($GLOBALS['gzip']))) {
|
||||||
|
$time0 = time();
|
||||||
|
}
|
||||||
|
|
||||||
while ($row = mysql_fetch_row($result)) {
|
while ($row = mysql_fetch_row($result)) {
|
||||||
$current_row++;
|
$current_row++;
|
||||||
for ($j = 0; $j < $fields_cnt; $j++) {
|
for ($j = 0; $j < $fields_cnt; $j++) {
|
||||||
@@ -247,11 +254,14 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
|
|||||||
$handler($insert_line);
|
$handler($insert_line);
|
||||||
|
|
||||||
// loic1: send a fake header to bypass browser timeout if data
|
// loic1: send a fake header to bypass browser timeout if data
|
||||||
// are bufferized
|
// are bufferized - part 2
|
||||||
if (!empty($GLOBALS['ob_mode'])
|
if (isset($time0)) {
|
||||||
|| (isset($GLOBALS['zip']) || isset($GLOBALS['bzip']) || isset($GLOBALS['gzip']))) {
|
$time1 = time();
|
||||||
header('Expires: 0');
|
if ($time1 >= $time0 + 30) {
|
||||||
}
|
$time0 = $time1;
|
||||||
|
header('X-pmaPing: Pong');
|
||||||
|
}
|
||||||
|
} // end if
|
||||||
} // end while
|
} // end while
|
||||||
} // end if ($result != FALSE)
|
} // end if ($result != FALSE)
|
||||||
mysql_free_result($result);
|
mysql_free_result($result);
|
||||||
@@ -301,6 +311,13 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
|
|||||||
|
|
||||||
@set_time_limit($GLOBALS['cfgExecTimeLimit']); // HaRa
|
@set_time_limit($GLOBALS['cfgExecTimeLimit']); // HaRa
|
||||||
|
|
||||||
|
// loic1: send a fake header to bypass browser timeout if data
|
||||||
|
// are bufferized - part 1
|
||||||
|
if (!empty($GLOBALS['ob_mode'])
|
||||||
|
|| (isset($GLOBALS['zip']) || isset($GLOBALS['bzip']) || isset($GLOBALS['gzip']))) {
|
||||||
|
$time0 = time();
|
||||||
|
}
|
||||||
|
|
||||||
while ($row = mysql_fetch_row($result)) {
|
while ($row = mysql_fetch_row($result)) {
|
||||||
$current_row++;
|
$current_row++;
|
||||||
$table_list = '(';
|
$table_list = '(';
|
||||||
@@ -360,12 +377,15 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
|
|||||||
$schema_insert .= ')';
|
$schema_insert .= ')';
|
||||||
$handler(trim($schema_insert));
|
$handler(trim($schema_insert));
|
||||||
|
|
||||||
// loic1: send a fake header to bypass browser timeout if data are
|
// loic1: send a fake header to bypass browser timeout if data
|
||||||
// bufferized
|
// are bufferized - part 2
|
||||||
if (!empty($GLOBALS['ob_mode'])
|
if (isset($time0)) {
|
||||||
&& (isset($GLOBALS['zip']) || isset($GLOBALS['bzip']) || isset($GLOBALS['gzip']))) {
|
$time1 = time();
|
||||||
header('Expires: 0');
|
if ($time1 >= $time0 + 30) {
|
||||||
}
|
$time0 = $time1;
|
||||||
|
header('X-pmaPing: Pong');
|
||||||
|
}
|
||||||
|
} // end if
|
||||||
} // end while
|
} // end while
|
||||||
mysql_free_result($result);
|
mysql_free_result($result);
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@ function PMA_splitSqlFile(&$ret, $sql, $release)
|
|||||||
$char = '';
|
$char = '';
|
||||||
$string_start = '';
|
$string_start = '';
|
||||||
$in_string = FALSE;
|
$in_string = FALSE;
|
||||||
|
$time0 = time();
|
||||||
|
|
||||||
for ($i = 0; $i < $sql_len; ++$i) {
|
for ($i = 0; $i < $sql_len; ++$i) {
|
||||||
$char = $sql[$i];
|
$char = $sql[$i];
|
||||||
@@ -120,8 +121,12 @@ function PMA_splitSqlFile(&$ret, $sql, $release)
|
|||||||
$sql[$i] = ' ';
|
$sql[$i] = ' ';
|
||||||
} // end else if
|
} // end else if
|
||||||
|
|
||||||
// loic1: send a fake header to bypass browser timeout
|
// loic1: send a fake header each 30 sec. to bypass browser timeout
|
||||||
header('Expires: 0');
|
$time1 = time();
|
||||||
|
if ($time1 >= $time0 + 30) {
|
||||||
|
$time0 = $time1;
|
||||||
|
header('X-pmaPing: Pong');
|
||||||
|
} // end if
|
||||||
} // end for
|
} // end for
|
||||||
|
|
||||||
// add any rest to the returned array
|
// add any rest to the returned array
|
||||||
|
Reference in New Issue
Block a user