bug #1990342 [import] SQL file import very slow on Windows

This commit is contained in:
Marc Delisle
2008-06-13 17:18:18 +00:00
parent 6d4a7b0b2f
commit cec1847121
2 changed files with 13 additions and 1 deletions

View File

@@ -66,6 +66,8 @@ danbarry
thanks to Jason Day - jday29
- bug #1989081 [profiling] Profiling causes query to be executed again
(really causes a problem in case of INSERT/UPDATE)
- bug #1990342 [import] SQL file import very slow on Windows,
thanks to Richard Heaton - wotnot
2.11.7.0 (not yet released)
- bug #1908719 [interface] New field cannot be auto-increment and primary key

View File

@@ -83,6 +83,11 @@ while (!($GLOBALS['finished'] && $i >= $len) && !$error && !$timeout_passed) {
}
// Current length of our buffer
$len = strlen($buffer);
// prepare an uppercase copy of buffer for Windows because at least
// on PHP 5.2.5, stripos() is very slow
if (PMA_IS_WINDOWS) {
$buffer_upper = strtoupper($buffer);
}
// Grab some SQL queries out of it
while ($i < $len) {
$found_delimiter = false;
@@ -126,7 +131,12 @@ while (!($GLOBALS['finished'] && $i >= $len) && !$error && !$timeout_passed) {
$p7 = $big_value;
}
// catch also "delimiter"
$p8 = stripos($buffer, 'DELIMITER', $i);
// stripos() very slow on Windows (at least on PHP 5.2.5)
if (! PMA_IS_WINDOWS) {
$p8 = stripos($buffer, 'DELIMITER', $i);
} else {
$p8 = strpos($buffer_upper, 'DELIMITER', $i);
}
if ($p8 === FALSE || $p8 >= ($len - 11) || $buffer[$p8 + 9] > ' ') {
$p8 = $big_value;
}