case Types.VARBINARY :
case Types.LONGVARBINARY :
if (o instanceof Binary) {
return o;
} else if (o instanceof byte[]) {
return new Binary((byte[]) o, false);
} else if (o instanceof String) {
/**
* @todo fredt - we need this for script processing only
* handle the script separately and process normal
* conversion according to rules in SQL
* standard
*/
return new Binary(
StringConverter.hexToByte((String) o), false);
}
throw Trace.error(Trace.INVALID_CONVERSION,
Types.getTypeString(type));