Patch 859034 better BLOB comparison

This commit is contained in:
Marc Delisle
2004-04-29 17:35:57 +00:00
parent 6d2d9f6421
commit 4d197aa5dc
2 changed files with 8 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ $Source$
* lang/slovak: Updated, thanks to Lubos Klokner (erkac). * lang/slovak: Updated, thanks to Lubos Klokner (erkac).
* lang/swedish: Updated, thanks to Björn T. Hallberg (bth). * lang/swedish: Updated, thanks to Björn T. Hallberg (bth).
* lang/slovenian update, thanks to Kositer Uros * lang/slovenian update, thanks to Kositer Uros
* libraries/common.lib.php: patch #859034, better BLOB comparison
2004-04-29 Michal Cihar <michal@cihar.com> 2004-04-29 Michal Cihar <michal@cihar.com>
* libraries/display_tbl.lib.php, libraries/sqlparser.lib.php, * libraries/display_tbl.lib.php, libraries/sqlparser.lib.php,

View File

@@ -1971,7 +1971,13 @@ if (typeof(document.getElementById) != '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])) {
$condition .= 'LIKE 0x' . bin2hex($row[$i]). ' AND'; // 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';
}
} else { } else {
$condition .= '= \'' . PMA_sqlAddslashes($row[$i], FALSE, TRUE) . '\' AND'; $condition .= '= \'' . PMA_sqlAddslashes($row[$i], FALSE, TRUE) . '\' AND';
} }