[#8231] Negative YearToMonth() intervals are not correctly normalised

This commit is contained in:
lukaseder 2019-01-21 10:25:36 +01:00
parent 4fd86b411e
commit add94df523

View File

@ -105,7 +105,7 @@ public final class YearToMonth extends Number implements Interval, Comparable<Ye
// Perform normalisation. Specifically, Postgres may return intervals
// such as 0-13
if (months >= 12) {
if (Math.abs(months) >= 12) {
years += (months / 12);
months %= 12;
}