bug #1659176, memory error displaying a table with large BLOBs

This commit is contained in:
Marc Delisle
2007-02-27 22:54:11 +00:00
parent 58314835e4
commit a6acfb641b
2 changed files with 15 additions and 7 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog
$Id$ $Id$
$HeadURL$ $HeadURL$
2007-02-27 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php: bug #1659176, memory error displaying
a table with large BLOBs
2007-02-26 Marc Delisle <lem9@users.sourceforge.net> 2007-02-26 Marc Delisle <lem9@users.sourceforge.net>
* scripts/upgrade_tables_mysql_4_1_2+.sql: bug #1668662, * scripts/upgrade_tables_mysql_4_1_2+.sql: bug #1668662,
can create the new pma_designer_coords table can create the new pma_designer_coords table

View File

@@ -2072,6 +2072,7 @@ if (typeof(window.parent) != 'undefined'
$nonprimary_condition = ''; $nonprimary_condition = '';
for ($i = 0; $i < $fields_cnt; ++$i) { for ($i = 0; $i < $fields_cnt; ++$i) {
$condition = '';
$field_flags = PMA_DBI_field_flags($handle, $i); $field_flags = PMA_DBI_field_flags($handle, $i);
$meta = $fields_meta[$i]; $meta = $fields_meta[$i];
@@ -2126,13 +2127,16 @@ if (typeof(window.parent) != 'undefined'
// hexify only if this is a true not empty BLOB // hexify only if this is a true not empty BLOB
&& stristr($field_flags, 'BINARY') && stristr($field_flags, 'BINARY')
&& !empty($row[$i])) { && !empty($row[$i])) {
// use a CAST if possible, to avoid problems // do not waste memory building a too big condition
// if the field contains wildcard characters % or _ if (strlen($row[$i]) < 1000) {
if (PMA_MYSQL_INT_VERSION < 40002) { if (PMA_MYSQL_INT_VERSION < 40002) {
$condition .= 'LIKE 0x' . bin2hex($row[$i]) . ' AND'; $condition .= 'LIKE 0x' . bin2hex($row[$i]) . ' AND';
} else { } else {
$condition .= '= CAST(0x' . bin2hex($row[$i]) // use a CAST if possible, to avoid problems
. ' AS BINARY) AND'; // if the field contains wildcard characters % or _
$condition .= '= CAST(0x' . bin2hex($row[$i])
. ' AS BINARY) AND';
}
} }
} else { } else {
$condition .= '= \'' $condition .= '= \''