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: validate value for global time_zone sys variable #8876

Merged
merged 2 commits into from
Dec 29, 2018

Conversation

eurekaka
Copy link
Contributor

@eurekaka eurekaka commented Dec 29, 2018

What problem does this PR solve?

Before this PR:

mysql> set global time_zone = 'timezone';
Query OK, 0 rows affected (0.01 sec)

mysql> \q
Bye
[root@localhost ~/go/src/github.com/pingcap/tidb]$ mysql -u root -P4000 -h127.0.0.1 -D test
ERROR 1298 (HY000): Unknown or incorrect time zone: 'timezone'

What is changed and how it works?

Validate value for global time_zone system variable before setting it.
After this PR:

mysql> set global time_zone = 'timezone';
ERROR 1298 (HY000): Unknown or incorrect time zone: 'timezone'

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

N/A

Related changes

  • Need to cherry-pick to the release branch

This change is Reviewable

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason
Copy link
Member

zz-jason commented Dec 29, 2018

@XuHuaiyu, @qw4990 PTAL

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

@XuHuaiyu
Copy link
Contributor

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/session 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.

4 participants