micronaut-projects / micronaut-projects/micronaut-data
Reading Postgresql pre-gregorian dates as LocalDates results in mismatching values
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 482
- Forks
- 229
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 32
Description
### Expected Behavior
Dates before 15 October 1582 are converted to LocalDates preserving the value
### Actual Behaviour
Dates before 15 October 1582 are read back with a difference of +6 days.
Conversion seems to happen on
https://github.com/micronaut-projects/micronaut-data/blob/59e5d4c638b1f14f426448f7a733919704e97eac/data-runtime/src/main/java/io/micronaut/data/runtime/convert/DataConversionServiceFactory.java#L668
Date and Instant epoch millis are handled differently before the Julian to Gregorian Calendar switch on 15th October 1582
### Steps To Reproduce
_No response_
### Environment Information
_No response_
### Example Application
_No response_
### Version
4.12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at data-runtime/src/main/java/io/micronaut/data/runtime/convert/DataConversionServiceFactory.java around line 668, where the issue identifies the conversion. Trace how PostgreSQL dates before 15 October 1582 become LocalDates, then add regression coverage showing that pre-Gregorian values are read back unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100