22.12

```sql
SELECT
    toIPv6OrDefault('::ffff:10.10.10.10') AS ipv6,
    cutIPv6(ipv6, 10, 1)

┌─ipv6───────────────┬─cutIPv6(toIPv6OrDefault('::ffff:10.10.10.10'), 10, 1)─┐
│ ::ffff:10.10.10.10 │ ::ffff:10.10.10.0                                     │
└────────────────────┴───────────────────────────────────────────────────────┘
```

22.13.1.1476

```sql
SELECT
    toIPv6OrDefault('::ffff:10.10.10.10') AS ipv6,
    cutIPv6(ipv6, 10, 1)
Code: 43. DB::Exception: Illegal type IPv6 of argument 1 of function cutIPv6, expected FixedString(16): While processing toIPv6OrDefault('::ffff:10.10.10.10') AS ipv6, cutIPv6(ipv6, 10, 1). (ILLEGAL_TYPE_OF_ARGUMENT)
```

https://github.com/ClickHouse/ClickHouse/pull/45018
std::tie(vec_res_lower_range[i], vec_res_upper_range[i]) = applyCIDRMask(ip, cidr);
        }
        return ColumnTuple::create(Columns{std::move(col_res_lower_range), std::move(col_res_upper_range)});
    }
public:
    static constexpr auto name = "IPv4CIDRToRange";
    static FunctionPtr create(ContextPtr) { return std::make_shared<FunctionIPv4CIDRToRange>(); }
    String getName() const override { return name; }
    size_t getNumberOfArguments() const override { return 2; }
    bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & ) const override { return false; }
    DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override
    {
        WhichDataType arg_type(arguments[0]);
        if (!(arg_type.isIPv4() || arg_type.isUInt8() || arg_type.isUInt16() || arg_type.isUInt32()))
            throw Exception(
                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
                "Illegal type {} of first argument of function {}, expected IPv4 or UInt8 or UInt16 or UInt32",
                arguments[0]->getName(), getName()
            );
        const DataTypePtr & second_argument = arguments[1];
        if (!isUInt8(second_argument))
            throw Exception(
                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
                "Illegal type {} of second argument of function {}, expected UInt8",
                second_argument->getName(), getName()
            );
        DataTypePtr element = DataTypeFactory::instance().get("IPv4");
        return std::make_shared<DataTypeTuple>(DataTypes{element, element});
    }
    bool useDefaultImplementationForConstants() const override { return true; }