**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))').
```

else if constexpr (right_is_decimal)
            {
                if (col_right_const)
                    return ResultType{1};
                return 1 / DecimalUtils::convertTo<ResultType>(right.getScaleMultiplier(), 0);
            }
            else
                return 1;
        }();
        
        if (col_left_const && col_right_const)
        {
            const NativeResultType const_a = helperGetOrConvert<T0, ResultDataType>(col_left_const, left);
            const NativeResultType const_b = helperGetOrConvert<T1, ResultDataType>(col_right_const, right);
            const ResultType res = check_decimal_overflow
                ? OpImplCheck::template process<left_is_decimal, right_is_decimal>(const_a, const_b, scale_a, scale_b)
                : OpImpl::template process<left_is_decimal, right_is_decimal>(const_a, const_b, scale_a, scale_b);
            if constexpr (result_is_decimal)
                return ResultDataType(type.getPrecision(), type.getScale()).createColumnConst(
                    col_left_const->size(), toField(res, type.getScale()));
            else
                 return ResultDataType().createColumnConst(col_left_const->size(), toField(res));
        }
        if constexpr (result_is_decimal)
            col_res = ColVecResult::create(0, type.getScale());
        else
            col_res = ColVecResult::create(0);
        auto & vec_res = col_res->getData();
        vec_res.resize(col_left_size);
        if (col_left && col_right)