Repository: duckdb/duckdb (language: python)

Issue:
Issue #3430: Temporal Infinity Values
* Add temporal infinity values.
* Parse temporal infinity values.
* Adjust valid time boundaries to exclude infinities.
* Adding to and subtracting from temporal infinites should produce the same infinity.
* Date part extraction from infinities is NULL.
* Add ICU support for infinities.
* Update temporal functions to handle infinities.
* Disable infinities as range/generate_series bounds


Discussion / hints:
> Thanks for the PR! Looks good to me. Perhaps we want to add these to the `test_all_types` function so we can ensure these are correctly translated on all different client connectors?

Yeah, that will be fun. Might need some help with ODBC expecteds.
Looks like there was a merge conflict introduced by #3613, could you have a look at fixing that?
Regrettably some more merge conflicts have appeared. Could you have another look? Thanks
Thanks!

Fix patch:
diff --git a/src/include/duckdb/common/types/interval.hpp b/src/include/duckdb/common/types/interval.hpp
index d8a9672b0c63..85a90666c698 100644
--- a/src/include/duckdb/common/types/interval.hpp
+++ b/src/include/duckdb/common/types/interval.hpp
@@ -166,18 +166,20 @@ class Interval {
 	}
 };
 void interval_t::Normalize(int64_t &months, int64_t &days, int64_t &micros) const {
-	auto input = *this;
-	int64_t extra_months_d = input.days / Interval::DAYS_PER_MONTH;
-	int64_t extra_months_micros = input.micros / Interval::MICROS_PER_MONTH;
-	input.days -= UnsafeNumericCast<int32_t>(extra_months_d * Interval::DAYS_PER_MONTH);
-	input.micros -= extra_months_micros * Interval::MICROS_PER_MONTH;
+	auto &input = *this;
 
-	int64_t extra_days_micros = input.micros / Interval::MICROS_PER_DAY;
-	input.micros -= extra_days_micros * Interval::MICROS_PER_DAY;
-
-	months = input.months + extra_months_d + extra_months_micros;
-	days = input.days + extra_days_micros;
+	//  Carry left
 	micros = input.micros;
+	int64_t carry_days = micros / Interval::MICROS_PER_DAY;
+	micros -= carry_days * Interval::MICROS_PER_DAY;
+
+	days = input.days;
+	days += carry_days;
+	int64_t carry_months = days / Interval::DAYS_PER_MONTH;
+	days -= carry_months * Interval::DAYS_PER_MONTH;
+
+	months = input.months;
+	months += carry_months;
 }
 
 } // namespace duckdb


Test patch:
diff --git a/test/sql/types/interval/test_interval_comparison.test b/test/sql/types/interval/test_interval_comparison.test
index ace8d875d374..83a70972cd11 100644
--- a/test/sql/types/interval/test_interval_comparison.test
+++ b/test/sql/types/interval/test_interval_comparison.test
@@ -46,3 +46,8 @@ SELECT INTERVAL '1' YEAR = INTERVAL '12' MONTH
 ----
 1
 
+# Double carry left
+query I
+select interval '28 days 432000 seconds' = interval '1 month 3 days';
+----
+True