mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fixed error found by M.Filimonov [#CLICKHOUSE-2].
This commit is contained in:
parent
62bccc4eef
commit
75f9ff1717
@ -21,7 +21,7 @@ static std::string extractTimeZoneNameFromColumn(const IColumn & column)
|
||||
std::string extractTimeZoneNameFromFunctionArguments(const ColumnsWithTypeAndName & arguments, size_t time_zone_arg_num, size_t datetime_arg_num)
|
||||
{
|
||||
/// Explicit time zone may be passed in last argument.
|
||||
if (arguments.size() == time_zone_arg_num + 1)
|
||||
if (arguments.size() == time_zone_arg_num + 1 && arguments[time_zone_arg_num].column)
|
||||
{
|
||||
return extractTimeZoneNameFromColumn(*arguments[time_zone_arg_num].column);
|
||||
}
|
||||
|
@ -837,13 +837,13 @@ public:
|
||||
void getReturnTypeAndPrerequisitesImpl(
|
||||
const ColumnsWithTypeAndName & arguments, DataTypePtr & out_return_type, ExpressionActions::Actions & /*out_prerequisites*/) override
|
||||
{
|
||||
auto index_col = checkAndGetColumnConst<ColumnUInt8>(&*arguments[1].column);
|
||||
auto index_col = checkAndGetColumnConst<ColumnUInt8>(arguments[1].column.get());
|
||||
if (!index_col)
|
||||
throw Exception("Second argument to " + getName() + " must be a constant UInt8", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||
|
||||
size_t index = index_col->getValue<UInt8>();
|
||||
|
||||
const DataTypeTuple * tuple = checkAndGetDataType<DataTypeTuple>(&*arguments[0].type);
|
||||
const DataTypeTuple * tuple = checkAndGetDataType<DataTypeTuple>(arguments[0].type.get());
|
||||
if (!tuple)
|
||||
throw Exception("First argument for function " + getName() + " must be tuple.", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user