Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session: add default_week_format to builtinGlobalVariable #21511

Merged
merged 3 commits into from
Dec 10, 2020

Conversation

kennytm
Copy link
Contributor

@kennytm kennytm commented Dec 6, 2020

What problem does this PR solve?

Issue Number: close #21510

Problem Summary: WEEK() did not recognize @@GLOBAL.default_week_format until it has been explicitly read.

What is changed and how it works?

What's Changed:

Add default_week_format to the list of builtinGlobalVariable so it is initialized when the session starts.

How it Works:

Related changes

  • Need to cherry-pick to the release branch
    • 4.0, 3.0

Check List

Tests

Side effects

Release note

  • the single-argument WEEK() call now recognize the global @@default_week_format even when the session one is not set explicitly.

@kennytm
Copy link
Contributor Author

kennytm commented Dec 6, 2020

/label component/session , needs-cherry-pick-3.0 , needs-cherry-pick-4.0 , sig/DDL , status/PTAL , type/bug-fix

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 9, 2020
Copy link
Contributor

@xiongjiwei xiongjiwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 9, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 9, 2020
@xiongjiwei
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 9, 2020
@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 21588
  • 21495
  • 19787
  • 21531
  • 21565
  • 21587
  • 21575

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@kennytm merge failed.

@kennytm
Copy link
Contributor Author

kennytm commented Dec 10, 2020

(Race in TestClusterIndexCBOPointGet, #21620)

@kennytm
Copy link
Contributor Author

kennytm commented Dec 10, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@kennytm merge failed.

@kennytm
Copy link
Contributor Author

kennytm commented Dec 10, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 9c3e106 into pingcap:master Dec 10, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Dec 10, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-3.0 in PR #21622

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Dec 10, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #21623

@kennytm kennytm deleted the fix-21510 branch December 21, 2020 08:58
ti-srebot added a commit that referenced this pull request Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/session sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@@global.default_week_format was not immediately loaded on new session, causing week() to use the wrong mode
4 participants