Fix error

This commit is contained in:
Alexey Milovidov 2022-10-22 07:38:22 +02:00
parent cb611e698a
commit 7fc3cd7fb0

View File

@ -898,6 +898,10 @@ class FunctionBinaryArithmetic : public IFunction
if (isDateOrDate32(arguments[1].type) || isDateTime(arguments[1].type) || isDateTime64(arguments[1].type)) if (isDateOrDate32(arguments[1].type) || isDateTime(arguments[1].type) || isDateTime64(arguments[1].type))
std::swap(new_arguments[0], new_arguments[1]); std::swap(new_arguments[0], new_arguments[1]);
/// Change interval argument type to its representation
if (WhichDataType(new_arguments[1].type).isInterval())
new_arguments[1].type = std::make_shared<DataTypeNumber<DataTypeInterval::FieldType>>();
auto function = function_builder->build(new_arguments); auto function = function_builder->build(new_arguments);
return function->execute(new_arguments, result_type, input_rows_count); return function->execute(new_arguments, result_type, input_rows_count);
} }