```
qoega-dev.sas.yp-c.yandex.net :) SELECT toDate('2000-01-01') < toDateTime('2000-01-01 00:00:01', 'Europe/Moscow');

SELECT toDate('2000-01-01') < toDateTime('2000-01-01 00:00:01', 'Europe/Moscow')

Query id: baf63ad5-1893-401c-9728-63bd5c295df1

┌─less(toDate('2000-01-01'), toDateTime('2000-01-01 00:00:01', 'Europe/Moscow'))─┐
│                                                                              0 │
└────────────────────────────────────────────────────────────────────────────────┘

1 rows in set. Elapsed: 0.011 sec.

qoega-dev.sas.yp-c.yandex.net :) SELECT toDate('2000-01-01') < toDateTime('2000-01-01 00:00:01');

SELECT toDate('2000-01-01') < toDateTime('2000-01-01 00:00:01')

Query id: c2136446-a3a0-4567-a94e-68f40dc1f158

┌─less(toDate('2000-01-01'), toDateTime('2000-01-01 00:00:01'))─┐
│                                                             1 │
└───────────────────────────────────────────────────────────────┘

1 rows in set. Elapsed: 0.011 sec.
```
UInt32 max_scale = 0;
            for (const auto & type : types)
            {
                UInt32 scale = getDecimalScale(*type, 0);
                if (scale > max_scale)
                    max_scale = scale;
            }
            UInt32 min_precision = max_scale + leastDecimalPrecisionFor(max_int);
            
            if (max_scale == 0)
            {
                if (max_int == TypeIndex::Int32)
                    min_precision = DataTypeDecimal<Decimal32>::maxPrecision();
                else if (max_int == TypeIndex::Int64)
                    min_precision = DataTypeDecimal<Decimal64>::maxPrecision();
            }
            if (min_precision > DataTypeDecimal<Decimal128>::maxPrecision())
                throw Exception(getExceptionMessagePrefix(types) + " because the least supertype is Decimal("
                                + toString(min_precision) + ',' + toString(max_scale) + ')',
                                ErrorCodes::NO_COMMON_TYPE);
            if (have_decimal128 || min_precision > DataTypeDecimal<Decimal64>::maxPrecision())
                return std::make_shared<DataTypeDecimal<Decimal128>>(DataTypeDecimal<Decimal128>::maxPrecision(), max_scale);
            if (have_decimal64 || min_precision > DataTypeDecimal<Decimal32>::maxPrecision())
                return std::make_shared<DataTypeDecimal<Decimal64>>(DataTypeDecimal<Decimal64>::maxPrecision(), max_scale);
            return std::make_shared<DataTypeDecimal<Decimal32>>(DataTypeDecimal<Decimal32>::maxPrecision(), max_scale);
        }
    }
    
    {
        bool all_numbers = true;