|
| 1 | +--- |
| 2 | +id: dst-named-zone-string-parse-lmt |
| 3 | +level: task |
| 4 | +title: "DST: datetime string parse doesn't resolve named-zone historical/LMT offset" |
| 5 | +short_code: "GQLITE-T-0344" |
| 6 | +created_at: 2026-06-01T00:00:00.000000+00:00 |
| 7 | +updated_at: 2026-06-01T00:00:00.000000+00:00 |
| 8 | +parent: |
| 9 | +blocked_by: [] |
| 10 | +archived: false |
| 11 | +tags: |
| 12 | + - "#task" |
| 13 | + - "#phase/backlog" |
| 14 | + - "#bug" |
| 15 | +exit_criteria_met: false |
| 16 | +initiative_id: NULL |
| 17 | +--- |
| 18 | + |
| 19 | +# DST: datetime string parse doesn't resolve named-zone historical/LMT offset |
| 20 | + |
| 21 | +## Type |
| 22 | +- [x] Bug |
| 23 | + |
| 24 | +## Priority |
| 25 | +- [ ] P3 - Low (needs an embedded IANA tz database; largest/most data-heavy) |
| 26 | + |
| 27 | +## Objective |
| 28 | +Parsing a datetime string that carries a named zone must insert the resolved |
| 29 | +numeric offset (including pre-standardization Local Mean Time) before the |
| 30 | +`[Region]` suffix. Closes **Temporal2 [6]** (2 examples) and is the umbrella |
| 31 | +"embed IANA tzdata" work the other two DST bugs depend on. |
| 32 | + |
| 33 | +## Impact Assessment |
| 34 | +- **Affected:** `gql_normalize_datetime_func` in `src/backend/runtime/udf_helpers.c`. |
| 35 | +- **Reproduction / Expected vs Actual:** |
| 36 | + - `datetime('2015-07-21T21:40:32.142[Europe/London]')` |
| 37 | + expected `2015-07-21T21:40:32.142+01:00[Europe/London]`, |
| 38 | + actual `2015-07-21T21:40:32.142[Europe/London]` (no resolved offset inserted). |
| 39 | + - `datetime('1818-07-21T21:40:32.142[Europe/Stockholm]')` |
| 40 | + expected `1818-07-21T21:40:32.142+00:53:28[Europe/Stockholm]` — **Local Mean |
| 41 | + Time** (Stockholm's longitude-based offset before standardized zones in 1879). |
| 42 | + |
| 43 | +## Root cause |
| 44 | +1. The datetime string normalizer keeps the `[Region]` bracket but never computes |
| 45 | + and inserts the offset for the value's date. |
| 46 | +2. `+00:53:28` cannot be produced by ANY rule — it is historical LMT data. This is |
| 47 | + the hard floor: full Temporal DST conformance requires embedding the real IANA |
| 48 | + tz database (transition instants + historical/LMT offset records). A rule-based |
| 49 | + approximation (see [[GQLITE-T-0343]]) cannot reach these cases. |
| 50 | + |
| 51 | +## Suggested approach |
| 52 | +- Embed a compact subset of IANA tzdata for the zones the TCK exercises |
| 53 | + (Europe/Stockholm, Europe/London, Europe/Paris, Europe/Berlin, America/New_York, |
| 54 | + America/Los_Angeles, Pacific/Honolulu, America/Anchorage, Asia/Tokyo, |
| 55 | + Asia/Shanghai, Australia/Sydney, Pacific/Auckland, Australia/Eucla, ...), |
| 56 | + including historical transitions and pre-standard LMT, OR vendor a tz library. |
| 57 | +- Replace `named_tz_offset` + the transition logic with lookups against it; this |
| 58 | + then unblocks [[GQLITE-T-0342]] (across-transition elapsed) and |
| 59 | + [[GQLITE-T-0343]] (offset-by-date). |
| 60 | + |
| 61 | +## Acceptance Criteria |
| 62 | +- [ ] Temporal2 [6] examples pass (incl. the 1818 LMT case) |
| 63 | +- [ ] Rigorous full pass-set diff zero regressions; unit 944/944; functional clean |
| 64 | + |
| 65 | +## Notes |
| 66 | +This is the foundational DST item; [[GQLITE-T-0342]] and [[GQLITE-T-0343]] likely |
| 67 | +collapse into it once real tzdata is available. Context: [[GQLITE-T-0341]], |
| 68 | +[[GQLITE-I-0049]]. |
0 commit comments