**How to reproduce**
```
SELECT
    intervalLengthSum(10, 5) AS res,
    toInt64(res) AS cast,
    toTypeName(res) AS type

Query id: bc8307c2-a520-4499-959e-bb00e0bdf055

┌──────────────────res─┬─cast─┬─type───┐
│ 18446744073709551611 │   -5 │ UInt64 │
└──────────────────────┴──────┴────────┘
```
**Expected behavior**
intervals with negative sum will be converted to zero.
{
private:
    template <typename TResult>
    TResult getIntervalLengthSum(Data & data) const
    {
        if (data.segments.empty())
            return 0;
        data.sort();
        TResult res = 0;
        typename Data::Segment cur_segment = data.segments[0];
        for (size_t i = 1, sz = data.segments.size(); i < sz; ++i)
        {
            
            if (cur_segment.second < data.segments[i].first)
            {
                res += cur_segment.second - cur_segment.first;
                cur_segment = data.segments[i];
            }
            else
                cur_segment.second = std::max(cur_segment.second, data.segments[i].second);
        }
        res += cur_segment.second - cur_segment.first;
        return res;
    }
public:
    String getName() const override { return "intervalLengthSum"; }