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 session time in show processlist #7765

Merged
merged 2 commits into from
Sep 21, 2018
Merged

executor: fix session time in show processlist #7765

merged 2 commits into from
Sep 21, 2018

Conversation

imtbkcat
Copy link

@imtbkcat imtbkcat commented Sep 21, 2018

What problem does this PR solve?

Fix time show in show processlist.

What is changed and how it works?

In original code, if the client is in sleep state, process info is always "". So the time is always 0
like this:

+------+------+-----------+------+---------+------+-------+------------------+------+
| Id   | User | Host      | db   | Command | Time | State | Info             | Mem  |
+------+------+-----------+------+---------+------+-------+------------------+------+
|    1 | root | 127.0.0.1 | test | Sleep   |    0 | 2     |                  |    0 |
|    2 | root | 127.0.0.1 |      | Query   |    0 | 2     | show processlist |    0 |
+------+------+-----------+------+---------+------+-------+------------------+------+

After fixed:

+------+------+-----------+------+---------+------+-------+------------------+------+
| Id   | User | Host      | db   | Command | Time | State | Info             | Mem  |
+------+------+-----------+------+---------+------+-------+------------------+------+
|    1 | root | 127.0.0.1 |      | Query   |   90 | 2     |                  |    0 |
|    2 | root | 127.0.0.1 |      | Query   |    0 | 2     | show processlist |    0 |
+------+------+-----------+------+---------+------+-------+------------------+------+
2 rows in set (0.00 sec)

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

@jackysp
Copy link
Member

jackysp commented Sep 21, 2018

/run-all-tests

@imtbkcat
Copy link
Author

/run-all-tests

@imtbkcat
Copy link
Author

/run-all-tests

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 21, 2018
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT1 Indicates that a PR has LGTM 1. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants