From 087751483bc42688a88fde3b7e9744561064f7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 14 Oct 2005 12:36:50 +0000 Subject: [PATCH] Do not walk chars for hex and numbers one by one, this boosts performance while inserting huge blobs (bug #1315232). --- ChangeLog | 3 +++ libraries/sqlparser.lib.php | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4008e5321..422093586 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ $Source$ 2005-10-14 Michal Čihař * libraries/sql_query_form.lib.php: Do not attempt to read upload dir when 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 * lang/*: typo 'unser' -> 'user' diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index 8713193b9..1cc7ff332 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -460,8 +460,16 @@ if ($is_minimum_common == FALSE) { $is_float_digit = FALSE; $is_float_digit_exponent = FALSE; + // Nijel: Fast skip is especially needed for huge BLOB data: if ($is_hex_digit) { $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))) {