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: store correct plan hint in statements_summary when log level is 'debug' (#22219) #22293

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Jan 8, 2021

cherry-pick #22219 to release-4.0
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr 22293

After apply modifications, you can push your change to this PR via:

git push [email protected]:ti-srebot/tidb.git pr/22293:ti-srebot:release-4.0-fe9d3161fa7a

What problem does this PR solve?

Issue Number: close #22203

Problem Summary:

Baseline capture does not work as expected.

What is changed and how it works?

What's Changed:

Make sure planHint is correctly set in statements_summary when the log level is debug or the tidb_slow_log_threshold is set to 0.

How it Works:

getEncodedPlan may be called in LogSlowQuery which would only generate encoded plan(i.e, with no plan hint), we should make sure the consequent getEncodedPlan call in SummaryStmt can generate plan hint then.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Manual test: set log level to debug, or tidb_slow_log_threshold to 0 and execute the queries in the issue, binding is successfully captured.

Side effects

N/A

Release note

  • Make baseline capture work when log level is 'debug'

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@eurekaka you're already a collaborator in bot's repo.

@eurekaka
Copy link
Contributor

eurekaka commented Jan 8, 2021

/run-tics-test
/run-sqllogic-test-2

Copy link
Contributor

@qw4990 qw4990 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 Jan 8, 2021
Copy link
Contributor

@Reminiscent Reminiscent 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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jan 8, 2021
@qw4990 qw4990 merged commit f3fcb93 into pingcap:release-4.0 Jan 8, 2021
@eurekaka eurekaka deleted the release-4.0-fe9d3161fa7a branch January 8, 2021 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/sql-plan-management sig/execution SIG execution sig/planner SIG: Planner status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants