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

static void NO_INLINE NO_SANITIZE_UNDEFINED vectorConstant(const A * __restrict a_pos, B b, ResultType * __restrict c_pos, size_t size)
    {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
        
        if (unlikely(is_signed_v<B> && b == -1))
        {
            for (size_t i = 0; i < size; ++i)
                c_pos[i] = -make_unsigned_t<A>(a_pos[i]);   
            return;
        }
        
        if (unlikely(b > std::numeric_limits<A>::max()
            || (std::is_signed_v<A> && std::is_signed_v<B> && b < std::numeric_limits<A>::lowest())))
        {
            for (size_t i = 0; i < size; ++i)
                c_pos[i] = 0;
            return;
        }
#pragma GCC diagnostic pop
        if (unlikely(static_cast<A>(b) == 0))
            throw Exception("Division by zero", ErrorCodes::ILLEGAL_DIVISION);
        divideImpl(a_pos, b, c_pos, size);
    }
};
/** Specializations are specified for dividing numbers of the type UInt64, UInt32, Int64, Int32 by the numbers of the same sign.