clickhouse: fixed unhex function [#CONV-6788].

This commit is contained in:
Michael Kolupaev 2013-03-07 13:00:40 +00:00
parent be85c7ba2b
commit 215cc0a8c1
2 changed files with 6 additions and 5 deletions

View File

@ -468,7 +468,7 @@ public:
/// Выполнить функцию над блоком.
void execute(Block & block, const ColumnNumbers & arguments, size_t result)
{
const ColumnPtr column = &*block.getByPosition(arguments[0]).column;
const ColumnPtr column = block.getByPosition(arguments[0]).column;
if (const ColumnString * col = dynamic_cast<const ColumnString *>(&*column))
{
@ -520,5 +520,5 @@ public:
}
}
};
}

View File

@ -34,9 +34,10 @@ public:
const IDataType * type = &*arguments[0];
if (!type->isNumeric() ||
dynamic_cast<const DataTypeFloat32 *>(type) ||
dynamic_cast<const DataTypeFloat64 *>(type))
if (!dynamic_cast<DataTypeUInt8>(type) &&
!dynamic_cast<DataTypeUInt16>(type) &&
!dynamic_cast<DataTypeUInt32>(type) &&
!dynamic_cast<DataTypeUInt64>(type))
throw Exception("Cannot format " + type->getName() + " as bitmask string", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
return new DataTypeString;