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

executor: fix show global variables return session variables also #19341

Merged
merged 14 commits into from
Nov 2, 2020

Conversation

erwadba
Copy link
Contributor

@erwadba erwadba commented Aug 20, 2020

What problem does this PR solve?

Issue Number: close #18517

Problem Summary: To fix show global variables statement return session variables.

What is changed and how it works?

What's Changed:
Rewrite the function fetchShowVariables() to distinguish global var from session var.
How it Works:

Related changes

n/a

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-993-g18b4e2b1a-dirty
Edition: Community
Git Commit Hash: 18b4e2b1a106d19db590da4af741e22ed08a5bf1
Git Branch: showvar
UTC Build Time: 2020-08-20 08:16:31
GoVersion: go1.13.8
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.04 sec)

mysql>  show global Variables like "tidb_mem_quota_topn";
Empty set (0.15 sec)

mysql> show  Variables like "tidb_mem_quota_topn";
+---------------------+-------------+
| Variable_name       | Value       |
+---------------------+-------------+
| tidb_mem_quota_topn | 34359738368 |
+---------------------+-------------+
1 row in set (0.01 sec)

mysql>

Side effects

n/a

Release note

  • fix show global variables return session variables also

@erwadba erwadba requested a review from a team as a code owner August 20, 2020 10:59
@erwadba erwadba requested review from fzhedu and removed request for a team August 20, 2020 10:59
@ti-srebot ti-srebot added the contribution This PR is from a community contributor. label Aug 20, 2020
@github-actions github-actions bot added the sig/execution SIG execution label Aug 20, 2020
@erwadba
Copy link
Contributor Author

erwadba commented Aug 21, 2020

@fzhedu PTAL

@erwadba
Copy link
Contributor Author

erwadba commented Aug 26, 2020

@ti-srebot /run-all-test

@ti-srebot
Copy link
Contributor

/run-all-test

@erwadba
Copy link
Contributor Author

erwadba commented Aug 26, 2020

@ti-srebot /run-all-tests

@ti-srebot
Copy link
Contributor

/run-all-tests

 Your branch is up to date with 'origin/showvar'.

 Changes to be committed:
	modified:   executor/show_test.go
@erwadba
Copy link
Contributor Author

erwadba commented Aug 26, 2020

@ti-srebot /rebuild

@erwadba
Copy link
Contributor Author

erwadba commented Aug 26, 2020

@ti-srebot /run-all-tests

@ti-srebot
Copy link
Contributor

/run-all-tests

@erwadba
Copy link
Contributor Author

erwadba commented Aug 26, 2020

@ti-srebot /run-common-test

@ti-srebot
Copy link
Contributor

/run-common-test

@erwadba
Copy link
Contributor Author

erwadba commented Aug 26, 2020

@ti-srebot /run-all-tests

@erwadba erwadba changed the title fix show variables fix show global variables return session variables also Aug 26, 2020
@erwadba
Copy link
Contributor Author

erwadba commented Aug 26, 2020

@qw4990 PTAL

@zz-jason zz-jason changed the title fix show global variables return session variables also executor: fix show global variables return session variables also Aug 26, 2020
executor/show.go Outdated Show resolved Hide resolved
@erwadba
Copy link
Contributor Author

erwadba commented Aug 27, 2020

@ti-srebot /run-all-tests

@qw4990
Copy link
Contributor

qw4990 commented Nov 2, 2020

@erwadba Please pick the issue again.

@erwadba
Copy link
Contributor Author

erwadba commented Nov 2, 2020

/pick-up

@ti-challenge-bot
Copy link

Pick up success.

Details

Tip :
You need to ensure that the description of the issue follows the following template:

```
## Score

- ${score}

## Mentor

- ${mentor}
```

Warning:
Pick up success, but the issue miss mentor or score information.
cc: @erwadba

@qw4990
Copy link
Contributor

qw4990 commented Nov 2, 2020

/pick-up

Please comment /pick-up in this issue(#18517).

@erwadba
Copy link
Contributor Author

erwadba commented Nov 2, 2020

picked

@qw4990
Copy link
Contributor

qw4990 commented Nov 2, 2020

/reward 300

@ti-challenge-bot
Copy link

Reward success.

@qw4990 qw4990 merged commit cc7a383 into pingcap:master Nov 2, 2020
@ti-challenge-bot
Copy link

@erwadba, Congratulations, you get 300 in this PR, and your total score is 300 in high-performance challenge program.

@qw4990
Copy link
Contributor

qw4990 commented Nov 2, 2020

It's merged. Thanks for your contribution :D @erwadba

@erwadba erwadba deleted the showvar branch November 2, 2020 09:03
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Nov 2, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #20764

@ti-challenge-bot
Copy link

@erwadba You did not submit PR within 7 days, so give up automatically.

@ti-challenge-bot ti-challenge-bot bot removed the picked label Nov 9, 2020
ti-srebot pushed a commit that referenced this pull request Nov 17, 2020
bb7133 added a commit to bb7133/tidb that referenced this pull request May 27, 2021
bb7133 added a commit to bb7133/tidb that referenced this pull request Jul 14, 2021
bb7133 added a commit to bb7133/tidb that referenced this pull request Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge-program contribution This PR is from a community contributor. sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

show global variables statement returns session variables also
7 participants