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

未關閉
#2,968 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@123123213weqw 已經在處理了。

開始於 2026年11月3日。

  • #3007 來自 @123123213weqw —— 未關閉

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
c, postgresql
領域
databases

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
C
星號
1.1k
分支
232
平均合併
2 天 3 小時
30 天內合併 PR
8

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

IvorySQL/IvorySQL 的其他 Issue

查看 IvorySQL/IvorySQL 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。