diff --git a/ChangeLog b/ChangeLog index 3a20b45fd..9f544ed3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog $Id$ $HeadURL$ +2007-02-27 Marc Delisle + * libraries/common.lib.php: bug #1659176, memory error displaying + a table with large BLOBs + 2007-02-26 Marc Delisle * scripts/upgrade_tables_mysql_4_1_2+.sql: bug #1668662, can create the new pma_designer_coords table diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 9cb2c8d82..23f8fe8fc 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2072,6 +2072,7 @@ if (typeof(window.parent) != 'undefined' $nonprimary_condition = ''; for ($i = 0; $i < $fields_cnt; ++$i) { + $condition = ''; $field_flags = PMA_DBI_field_flags($handle, $i); $meta = $fields_meta[$i]; @@ -2126,13 +2127,16 @@ if (typeof(window.parent) != 'undefined' // hexify only if this is a true not empty BLOB && stristr($field_flags, 'BINARY') && !empty($row[$i])) { - // use a CAST if possible, to avoid problems - // if the field contains wildcard characters % or _ - if (PMA_MYSQL_INT_VERSION < 40002) { - $condition .= 'LIKE 0x' . bin2hex($row[$i]) . ' AND'; - } else { - $condition .= '= CAST(0x' . bin2hex($row[$i]) - . ' AS BINARY) AND'; + // do not waste memory building a too big condition + if (strlen($row[$i]) < 1000) { + if (PMA_MYSQL_INT_VERSION < 40002) { + $condition .= 'LIKE 0x' . bin2hex($row[$i]) . ' AND'; + } else { + // use a CAST if possible, to avoid problems + // if the field contains wildcard characters % or _ + $condition .= '= CAST(0x' . bin2hex($row[$i]) + . ' AS BINARY) AND'; + } } } else { $condition .= '= \''