diff --git a/ChangeLog b/ChangeLog index a2b4a165c..b8d3bdd12 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ $Source$ 2003-05-22 Michal Cihar * tbl_indexes.php3, libraries/common.lib.php3: Better tabs highlighting when editing indexes. + * tbl_replace_fields.php3, libraries/build_dump.lib.php3, + libraries/display_tbl.lib.php3: Don't hexify BLOB if it is empty (bug + #741599). 2003-05-22 Garvin Hicking * sql.php3, libraries/common.lib.php3: Bug #692854: Never execute diff --git a/libraries/build_dump.lib.php3 b/libraries/build_dump.lib.php3 index e91925d87..1224f7891 100644 --- a/libraries/build_dump.lib.php3 +++ b/libraries/build_dump.lib.php3 @@ -327,8 +327,8 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){ // a number if ($field_num[$j]) { $values[] = $row[$j]; - // a blob - } else if ($field_blob[$j]) { + // a not empty blob + } else if ($field_blob[$j] && !empty($row[$j])) { $values[] = '0x' . bin2hex($row[$j]); // a string } else { @@ -465,7 +465,7 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){ $type == 'bigint' ||$type == 'timestamp') { $schema_insert .= $row[$j] . ', '; // blob - } else if ($type == 'blob' || $type == 'mediumblob' || $type == 'largeblob' || $type == 'tinyblob') { + } else if (($type == 'blob' || $type == 'mediumblob' || $type == 'largeblob' || $type == 'tinyblob') && !empty($row[$j])) { $schema_insert .= '0x' . bin2hex($row[$j]) . ', '; // a string } else { diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index 757fbc727..3eedbd411 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -961,8 +961,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { $condition .= 'IS NULL AND'; } else { if ($meta->type == 'blob' - // hexify only if this is a true BLOB - && eregi('BINARY', $field_flags)) { + // hexify only if this is a true not empty BLOB + && eregi('BINARY', $field_flags) + && !empty($row[$pointer])) { $condition .= 'LIKE 0x' . bin2hex($row[$pointer]). ' AND'; } else { $condition .= '= \'' . PMA_sqlAddslashes($row[$pointer], FALSE, TRUE) . '\' AND'; diff --git a/tbl_replace_fields.php3 b/tbl_replace_fields.php3 index 311161cda..a966de29d 100755 --- a/tbl_replace_fields.php3 +++ b/tbl_replace_fields.php3 @@ -163,7 +163,7 @@ if (!$check_stop) { // mode, insert empty field because no values were submitted. If protected // blobs where set, insert original fields content. if (isset($fieldlist)) { - if (isset($prot_row) && isset($prot_row[$key]) && $prot_row[$key] != '') { + if (isset($prot_row) && isset($prot_row[$key]) && !empty($prot_row[$key])) { $val = '0x' . bin2hex($prot_row[$key]); $seen_binary = TRUE; } else {