diff --git a/src/Functions/FunctionBinaryArithmetic.h b/src/Functions/FunctionBinaryArithmetic.h index c699da4eaf6..bf3b33d13ff 100644 --- a/src/Functions/FunctionBinaryArithmetic.h +++ b/src/Functions/FunctionBinaryArithmetic.h @@ -1919,25 +1919,6 @@ ColumnPtr executeStringInteger(const ColumnsWithTypeAndName & arguments, const A return executeAggregateAddition(arguments, result_type, input_rows_count); } - /// Special case - one or both arguments are IPv4 - if (isIPv4(arguments[0].type) || isIPv4(arguments[1].type)) - { - ColumnsWithTypeAndName new_arguments { - { - isIPv4(arguments[0].type) ? castColumn(arguments[0], std::make_shared()) : arguments[0].column, - isIPv4(arguments[0].type) ? std::make_shared() : arguments[0].type, - arguments[0].name, - }, - { - isIPv4(arguments[1].type) ? castColumn(arguments[1], std::make_shared()) : arguments[1].column, - isIPv4(arguments[1].type) ? std::make_shared() : arguments[1].type, - arguments[1].name - } - }; - - return executeImpl(new_arguments, result_type, input_rows_count); - } - /// Special case when the function is plus or minus, one of arguments is Date/DateTime and another is Interval. if (auto function_builder = getFunctionForIntervalArithmetic(arguments[0].type, arguments[1].type, context)) { @@ -1991,6 +1972,25 @@ ColumnPtr executeStringInteger(const ColumnsWithTypeAndName & arguments, const A return wrapInNullable(res, arguments, result_type, input_rows_count); } + /// Special case - one or both arguments are IPv4 + if (isIPv4(arguments[0].type) || isIPv4(arguments[1].type)) + { + ColumnsWithTypeAndName new_arguments { + { + isIPv4(arguments[0].type) ? castColumn(arguments[0], std::make_shared()) : arguments[0].column, + isIPv4(arguments[0].type) ? std::make_shared() : arguments[0].type, + arguments[0].name, + }, + { + isIPv4(arguments[1].type) ? castColumn(arguments[1], std::make_shared()) : arguments[1].column, + isIPv4(arguments[1].type) ? std::make_shared() : arguments[1].type, + arguments[1].name + } + }; + + return executeImpl2(new_arguments, result_type, input_rows_count, right_nullmap); + } + const auto * const left_generic = left_argument.type.get(); const auto * const right_generic = right_argument.type.get(); ColumnPtr res;