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
{
private:
    static inline std::pair<UInt32, UInt32> applyCIDRMask(UInt32 src, UInt8 bits_to_keep)
    {
        if (bits_to_keep >= 8 * sizeof(UInt32))
            return { src, src };
        if (bits_to_keep == 0)
            return { static_cast<UInt32>(0), static_cast<UInt32>(-1) };
        UInt32 mask = static_cast<UInt32>(-1) << (8 * sizeof(UInt32) - bits_to_keep);
        UInt32 lower = src & mask;
        UInt32 upper = lower | ~mask;
        return { lower, upper };
    }
    template <typename ArgType>
    ColumnPtr executeTyped(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t input_rows_count) const