Merge #17242 - #16005 - performance improvement on the Import and Export pages

Pull-request: #17242
Ref: #16005

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2021-12-19 22:20:48 +01:00
commit 78fd92fde9
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
2 changed files with 9 additions and 3 deletions

View File

@ -2464,6 +2464,11 @@ class ExportSql extends ExportPlugin
$separator = ';';
}
$isBinaryField = [];
for ($j = 0; $j < $fields_cnt; $j++) {
$isBinaryField[$j] = stripos($field_flags[$j], 'BINARY') !== false;
}
while ($row = $dbi->fetchRow($result)) {
if ($current_row == 0) {
$head = $this->possibleCRLF()
@ -2510,7 +2515,7 @@ class ExportSql extends ExportPlugin
// timestamp is numeric on some MySQL 4.1, BLOBs are
// sometimes numeric
$values[] = $row[$j];
} elseif (stripos($field_flags[$j], 'BINARY') !== false
} elseif ($isBinaryField[$j]
&& isset($GLOBALS['sql_hex_for_binary'])
) {
// a true BLOB

View File

@ -857,8 +857,6 @@ class Tracker
if (! (substr($query, -1) === ';')) {
$query .= ";\n";
}
// Get some information about query
$result = self::parseQuery($query);
// Get database name
$dbname = trim($GLOBALS['db'] ?? '', '`');
@ -868,6 +866,9 @@ class Tracker
return;
}
// Get some information about query
$result = self::parseQuery($query);
// If we found a valid statement
if (! isset($result['identifier'])) {
return;