Use hexadecimal form to create a unique condition for geometry fields

This commit is contained in:
Madhura Jayaratne 2011-08-03 18:11:32 +05:30
parent 7fe1ce201f
commit 175a6e0948

View File

@ -1962,6 +1962,13 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
// this blob won't be part of the final condition
$condition = '';
}
} elseif (in_array($meta->type, PMA_getGISDatatypes()) && ! empty($row[$i])) {
// do not build a too big condition
if (strlen($row[$i]) < 5000) {
$condition .= '=0x' . bin2hex($row[$i]) . ' AND';
} else {
$condition = '';
}
} elseif ($meta->type == 'bit') {
$condition .= "= b'" . PMA_printable_bit_value($row[$i], $meta->length) . "' AND";
} else {