Do not walk chars for hex and numbers one by one, this boosts performance while inserting huge blobs (bug #1315232).

This commit is contained in:
Michal Čihař
2005-10-14 12:36:50 +00:00
parent 12670d72b9
commit 087751483b
2 changed files with 11 additions and 0 deletions

View File

@@ -8,6 +8,9 @@ $Source$
2005-10-14 Michal Čihař <michal@cihar.com> 2005-10-14 Michal Čihař <michal@cihar.com>
* libraries/sql_query_form.lib.php: Do not attempt to read upload dir when * libraries/sql_query_form.lib.php: Do not attempt to read upload dir when
not configured. not configured.
* libraries/sqlparser.lib.php: Do not walk chars for hex and numbers one
by one, this boosts performance while inserting huge blobs (bug
#1315232).
2005-10-14 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2005-10-14 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* lang/*: typo 'unser' -> 'user' * lang/*: typo 'unser' -> 'user'

View File

@@ -460,8 +460,16 @@ if ($is_minimum_common == FALSE) {
$is_float_digit = FALSE; $is_float_digit = FALSE;
$is_float_digit_exponent = FALSE; $is_float_digit_exponent = FALSE;
// Nijel: Fast skip is especially needed for huge BLOB data:
if ($is_hex_digit) { if ($is_hex_digit) {
$count2++; $count2++;
$pos = strspn($sql, '0123456789abcdefABCDEF', $count2);
if ($pos > $count2) $count2 = $pos;
unset($pos);
} elseif ($is_digit) {
$pos = strspn($sql, '0123456789', $count2);
if ($pos > $count2) $count2 = $pos;
unset($pos);
} }
while (($count2 < $len) && PMA_STR_isSqlIdentifier(PMA_substr($sql, $count2, 1), ($is_sql_variable || $is_digit))) { while (($count2 < $len) && PMA_STR_isSqlIdentifier(PMA_substr($sql, $count2, 1), ($is_sql_variable || $is_digit))) {