[fix](doc) week/weekofyear: backport zh-only examples to en; fix zh typo using 2023 twice#3817
Open
boluor wants to merge 1 commit into
Open
[fix](doc) week/weekofyear: backport zh-only examples to en; fix zh typo using 2023 twice#3817boluor wants to merge 1 commit into
boluor wants to merge 1 commit into
Conversation
…x zh typo using 2023 twice
Three changes across two date-time function pages:
EN week.md (+1 example): mode 7 — weeks start on Monday and week 1 is
the week containing the first Monday. Because the first Monday of
2023 is Jan 2, `WEEK('2023-01-01', 7)` returns 52 (last week of 2022).
ZH already had this example.
EN weekofyear.md (+3 examples): a 2022-01-02 cross-year case (the
week 2021-12-27 to 2022-01-02 has only 2 days in 2022, so it falls
in the last week of 2021); a 2023-12-25 case (the final week of
2023); and a pre-modern-date case showing the function does not
validate any minimum year. ZH already documented these.
ZH weekofyear.md typo fix: the cross-year example's prose described
the 2021-12-27..2022-01-02 week, but the SQL was
`WEEKOFYEAR('2023-01-02')` and returned 1 — that is the wrong week
for the prose, and it duplicates the previous example. Change the
SQL and alias to `'2022-01-02'` / `week_20220102` so the example
actually demonstrates what the comment says (returns 52).
Every added example was run against Apache Doris 4.1.1; the result
blocks are the verbatim mysql client output.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three changes across two date-time function pages.
EN `week.md` (+1 example)
`mode 7` — weeks start on Monday and week 1 is the week containing the first Monday. Because the first Monday of 2023 is January 2, `WEEK('2023-01-01', 7)` returns 52 (last week of 2022). ZH already had this example.
EN `weekofyear.md` (+3 examples)
ZH already had analogues of these.
ZH `weekofyear.md` typo fix
The cross-year example's prose described the 2021-12-27..2022-01-02 week, but the SQL was `WEEKOFYEAR('2023-01-02')` and returned 1 — wrong week for the prose, and a duplicate of the example just above. Change the SQL and alias to `'2022-01-02'` / `week_20220102` so the example actually demonstrates what the comment says (returns 52).
Verification
```
mysql> SELECT WEEK('2023-01-01', 7); -- 52
mysql> SELECT WEEKOFYEAR('2022-01-02'); -- 52
mysql> SELECT WEEKOFYEAR('2023-12-25'); -- 52
mysql> SELECT weekofyear('1023-01-04'); -- 1
```
Test plan
🤖 Generated with Claude Code