bug #1990342 [import] SQL file import very slow on Windows
This commit is contained in:
@@ -66,6 +66,8 @@ danbarry
|
|||||||
thanks to Jason Day - jday29
|
thanks to Jason Day - jday29
|
||||||
- bug #1989081 [profiling] Profiling causes query to be executed again
|
- bug #1989081 [profiling] Profiling causes query to be executed again
|
||||||
(really causes a problem in case of INSERT/UPDATE)
|
(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)
|
2.11.7.0 (not yet released)
|
||||||
- bug #1908719 [interface] New field cannot be auto-increment and primary key
|
- bug #1908719 [interface] New field cannot be auto-increment and primary key
|
||||||
|
@@ -83,6 +83,11 @@ while (!($GLOBALS['finished'] && $i >= $len) && !$error && !$timeout_passed) {
|
|||||||
}
|
}
|
||||||
// Current length of our buffer
|
// Current length of our buffer
|
||||||
$len = strlen($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
|
// Grab some SQL queries out of it
|
||||||
while ($i < $len) {
|
while ($i < $len) {
|
||||||
$found_delimiter = false;
|
$found_delimiter = false;
|
||||||
@@ -126,7 +131,12 @@ while (!($GLOBALS['finished'] && $i >= $len) && !$error && !$timeout_passed) {
|
|||||||
$p7 = $big_value;
|
$p7 = $big_value;
|
||||||
}
|
}
|
||||||
// catch also "delimiter"
|
// catch also "delimiter"
|
||||||
|
// stripos() very slow on Windows (at least on PHP 5.2.5)
|
||||||
|
if (! PMA_IS_WINDOWS) {
|
||||||
$p8 = stripos($buffer, 'DELIMITER', $i);
|
$p8 = stripos($buffer, 'DELIMITER', $i);
|
||||||
|
} else {
|
||||||
|
$p8 = strpos($buffer_upper, 'DELIMITER', $i);
|
||||||
|
}
|
||||||
if ($p8 === FALSE || $p8 >= ($len - 11) || $buffer[$p8 + 9] > ' ') {
|
if ($p8 === FALSE || $p8 >= ($len - 11) || $buffer[$p8 + 9] > ' ') {
|
||||||
$p8 = $big_value;
|
$p8 = $big_value;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user