Skip to content

Fix historical SQL timestamp conversion - #6

Open
Evolvion wants to merge 1 commit into
mainfrom
fix/historical-date-conversion
Open

Fix historical SQL timestamp conversion#6
Evolvion wants to merge 1 commit into
mainfrom
fix/historical-date-conversion

Conversation

@Evolvion

@Evolvion Evolvion commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Valid timestamps such as 0001-01-01 could be converted to year zero through legacy Java calendar handling, then rejected by midPoint's XML date parser.

Fix and rationale

  • Pre-1900 calendar fields are preserved as UTC on reads, writes, and filters. Historical timezone offsets are deliberately ignored; this limitation is documented in code.
  • 1900 was selected as a practical cutoff, not a technical requirement. The fix is kept small for uncommon historical dates, without a calendar/timezone redesign.
  • Conversion from 1900 onward, including 9999, is left unchanged. Date-only and timezone-aware mappings are also unchanged.

Testing

  • 484 default tests were run successfully with mvn -o -B test.
  • Boundary dates, XML validity, round-trips, and filter parameters are covered, with conversion checks in UTC and Europe/Bratislava.
  • Oracle parameter binding and Prism conversion were checked separately.

Preserve pre-1900 timestamp calendar fields as UTC to prevent valid year-0001 values from becoming XML-invalid year zero. Apply the same field-based policy to writes and filter parameters while retaining existing conversion for newer timestamps.

Document the deliberate historical-timezone limitation and add regression coverage for UTC and Europe/Bratislava, boundary dates, XML validity, round-trips, and filter binding.
@Evolvion
Evolvion requested a review from tonydamage September 11, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant