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 8870d1f67a
commit bf3f24fa4b
2 changed files with 7 additions and 2 deletions

View File

@@ -10,6 +10,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
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

View File

@@ -68,7 +68,9 @@ while (!($finished && $i >= $len) && !$error && !$timeout_passed) {
$len = strlen($buffer); $len = strlen($buffer);
// prepare an uppercase copy of buffer for PHP < 5 // prepare an uppercase copy of buffer for PHP < 5
// outside of the loop // outside of the loop
if (PMA_PHP_INT_VERSION < 50000) { // (but on Windows and PHP 5.2.5, stripos() is very slow
// so prepare this buffer also in this case)
if (PMA_PHP_INT_VERSION < 50000 || PMA_IS_WINDOWS) {
$buffer_upper = strtoupper($buffer); $buffer_upper = strtoupper($buffer);
} }
// Grab some SQL queries out of it // Grab some SQL queries out of it
@@ -114,7 +116,8 @@ while (!($finished && $i >= $len) && !$error && !$timeout_passed) {
$p7 = $big_value; $p7 = $big_value;
} }
// catch also "delimiter" // catch also "delimiter"
if (PMA_PHP_INT_VERSION >= 50000) { // stripos() very slow on Windows (at least on PHP 5.2.5)
if (PMA_PHP_INT_VERSION >= 50000 && ! PMA_IS_WINDOWS) {
$p8 = stripos($buffer, 'DELIMITER', $i); $p8 = stripos($buffer, 'DELIMITER', $i);
} else { } else {
$p8 = strpos($buffer_upper, 'DELIMITER', $i); $p8 = strpos($buffer_upper, 'DELIMITER', $i);