**Describe the bug**
There is a lot of similar reports (https://github.com/ClickHouse/ClickHouse/issues/7509) but they mostly related to https://github.com/ClickHouse/ClickHouse/issues/12587 and If/case statements.

**How to reproduce**
Clickhouse version 21.5
```
SELECT
    1 / CAST(NULL, 'Nullable(UInt32)') AS int,
    1 / CAST(NULL, 'Nullable(UInt32)') AS float

Query id: 8f68936f-3ff9-4637-bc63-c19fc71a58ed

┌──int─┬─float─┐
│ ᴺᵁᴸᴸ │  ᴺᵁᴸᴸ │
└──────┴───────┘

SELECT 1 / CAST(NULL, 'Nullable(Decimal(7, 2))')

Query id: ed010d6a-4924-4af3-a200-701deeb9d2f4


0 rows in set. Elapsed: 0.002 sec.

Received exception from server (version 21.5.1):
Code: 153. DB::Exception: Received from localhost:9000. DB::Exception: Division by zero: While processing 1 / CAST(NULL, 'Nullable(Decimal(7, 2))').
```

requires(!is_decimal<A> && !is_decimal<B>)
    {
        if constexpr (is_division && is_decimal_b)
            return applyScaledDiv<is_decimal_a>(a, b, scale_a);
        else if constexpr (is_plus_minus_compare)
        {
            if (scale_a != 1)
                return applyScaled<true>(a, b, scale_a);
            if (scale_b != 1)
                return applyScaled<false>(a, b, scale_b);
        }
        return apply(a, b);
    }
private:
    static constexpr bool is_plus_minus =   IsOperation<Operation>::plus ||
                                            IsOperation<Operation>::minus;
    static constexpr bool is_multiply =     IsOperation<Operation>::multiply;
    static constexpr bool is_float_division = IsOperation<Operation>::div_floating;
    static constexpr bool is_int_division = IsOperation<Operation>::div_int ||
                                            IsOperation<Operation>::div_int_or_zero;
    static constexpr bool is_division = is_float_division || is_int_division;
    static constexpr bool is_compare =      IsOperation<Operation>::least ||
                                            IsOperation<Operation>::greatest;
    static constexpr bool is_plus_minus_compare = is_plus_minus || is_compare;
    static constexpr bool can_overflow = is_plus_minus || is_multiply;
    using Op = std::conditional_t<is_float_division,
        DivideIntegralImpl<NativeResultType, NativeResultType>, 
        Operation<NativeResultType, NativeResultType>>;
    template <OpCase op_case, OpCase target, class E>
    static auto unwrap(const E& elem, size_t i)