oradate values before year one format as implausible modern dates (e.g. 1 BC Jan 15 renders as 2026-01-15)

Offen
#2,968 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
c, postgresql
Bereich
databases

Rechercherichtung

Start by tracing the oradate_out and timestamp_to_char paths mentioned in the issue, then compare their handling of internal year 0 with plain timestamp formatting. Check the Oracle compatible NLS format behavior and the reported oradate input failure. Done when pre-year-one oradate values render with the expected year and month, with regression coverage for the reproduction.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Environment

IvorySQL 5.6 (official deb) + ivorysql_ora built from master (2c5e8dd), ivorysql.compatible_mode = oracle

Reproduction

SELECT to_char(timestamp '0001-01-15 BC', 'SYYYY-MM-DD');   -- -0001-01-15  (plain timestamp: correct)
SELECT to_char(add_months(oradate '2024-01-15', -24288), 'SYYYY-MM-DD');
-- 2026-01-15   (should be -0001-01-15: the month arithmetic yields internal year 0 = 1 BC)

add_months reaching internal year 0 (1 BC) is verifiable by ordering: the result compares greater than 2 BC Dec 15 and less than 1 BC Feb 15 as expected, so the internal value is right — only the rendering via the oradate path is wrong (plain timestamp rendering of the same value is fine). Displayed garbage varies by one month when stepping across the boundary (e.g. internal 2 BC Dec 15 renders as 2025-12-15), i.e. the year appears to be taken from a different representation stage.

Scope

Rendering/conversion of pre-year-one values through oradate_out/timestamp_to_char with NLS formats (and possibly the oradate input side — oradate '0001-01-15 bc' fails to parse with the default NLS picture while plain timestamp input parses). Worth a focused investigation; surfaced while testing #2955's fix.

Vorherrschende Sprache
C
Sterne
1.1k
Forks
232
Ø Merge
1 T. 20 Std.
Gemergte PRs (30 T.)
7

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus IvorySQL/IvorySQL

Alle Issues in IvorySQL/IvorySQL

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.