Support TIMESTAMP WITH TIMEZONE and without Y2K38 limit
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The issue names no files, tests, or entry points, so begin by locating TiDB's existing TIMESTAMP and DATETIME type handling and related tests. Done would require a defined, tested type supporting timezone-aware storage and presentation without the Y2K38 limit, including a clear compatibility and migration decision.
Written by the indexing model from the issue text.
Description
Feature Request
Is your feature request related to a problem? Please describe:
This is forked from https://github.com/pingcap/tidb/issues/20348
Describe the feature you'd like:
MySQL has both TIMESTAMP and DATETIME datatypes, which have different behaviors regarding how to handle timezones. I prefer TIMESTAMP, but it has a limitation that the range of values is limited to 32-bit (i.e. it will not be able to handle dates past 2038).
The SQL standard has a type TIMESTAMP WITH TIMEZONE. My request is to create a new data type which:
- Has timestamp like semantics (converts to UTC for storage)
- Remembers the timezone that was set on storage (can be presented back on read)
- Does not have a Y2K38 limitation.
Describe alternatives you've considered:
The alternative proposal would be to also fix TIMESTAMP to not have a Y2K38 limit, but this may cause compatibility issues with MySQL such as migrations back (although it could be protected via a flag).
Teachability, Documentation, Adoption, Migration Strategy:
It is fairly easy to teach because it is part of the SQL standard. Eventually TIMESTAMP will need to be improved, deprecated, fixed etc. As we get closer to Y2K38 storing as TIMESTAMP will become a similar issue to storing currency in FLOAT columns.
- Dominant language
- Go
- Stars
- 40.6k
- Forks
- 6.2k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 154
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.
More from pingcap/tidb
-
component/test severity/minor type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
contribution first-time-contributor
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
component/privilege severity/minor type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
component/session component/test severity/minor type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100