Document DATE/TIME/TIMESTAMP literal prefixes.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 617
- Forks
- 724
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 223
Description
Change Request
Please answer the following questions before submitting your issue. Thanks!
-
Describe what you find is inappropriate or missing in the existing docs.
There is no mention about DATE/TIME and TIMESTAMP literal, which can be written asDATE'2024-11-28',TIME'14:22:39'andTIMESTAMP'2024-11-28 14:22:11'in the literal values section. -
Describe your suggestion or addition.
Implementation wise it differs slightly if only using a string, and let the parser/function/data type do implicit conversion from string to date/time/timestamp. Normally the result is the same, but there are stricter checks for DATE/TIME and TIMESTAMP explicit literals.
Also note that TIMESTAMP literal is first interpreted as in current@@time_zoneunless explicitly setting time_zone offset (see tidb#57845) and then set as DATETIME datatype, which can be good to know when working with implicit data type conversion during comparison between different literals and column types. -
Provide some reference materials (such as documents and websites) if you could.
https://docs.pingcap.com/tidb/stable/literal-values
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
Review the literal values section at docs.pingcap.com/tidb/stable/literal-values and the behavior referenced in tidb#57845. Document DATE, TIME, and TIMESTAMP literal-prefix examples, including the stricter explicit-literal checks and TIMESTAMP handling with the current time zone. Done means the literal values documentation explains these forms and their conversion behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100