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

add hint nth_plan for plan test. #893

Merged
merged 2 commits into from
Jun 10, 2020
Merged

Conversation

danmay319
Copy link
Contributor

@danmay319 danmay319 commented Jun 9, 2020

What problem does this PR solve?

to pingcap/tidb#17580

What is changed and how it works?

  • add a sql hint nth_plan(x) to parser.
  • add a explain format verbose described above.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note

@danmay319 danmay319 requested review from zz-jason and kennytm June 9, 2020 11:53
@codecov
Copy link

codecov bot commented Jun 9, 2020

Codecov Report

Merging #893 into master will increase coverage by 0.01%.
The diff coverage is 97.36%.

@@            Coverage Diff             @@
##           master     #893      +/-   ##
==========================================
+ Coverage   78.30%   78.31%   +0.01%     
==========================================
  Files          40       40              
  Lines       14716    14723       +7     
==========================================
+ Hits        11524    11531       +7     
  Misses       2507     2507              
  Partials      685      685              

@danmay319
Copy link
Contributor Author

/rebuild

$$ = &ast.TableOptimizerHint{
HintName: model.NewCIStr($1),
QBName: model.NewCIStr($3),
HintData: int64($4),
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens with NTH_PLAN(18446744073709551615) ?

Copy link
Contributor Author

@danmay319 danmay319 Jun 9, 2020

Choose a reason for hiding this comment

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

@kennytm The planner in TiDB will check the number x given by the hint. An error will be given if x<-1 or x>100.

Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

LGTM

@kennytm kennytm added the status/LGT1 LGT1 label Jun 9, 2020
@danmay319 danmay319 requested a review from eurekaka June 10, 2020 01:10
Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@eurekaka eurekaka added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Jun 10, 2020
@eurekaka eurekaka merged commit d78fecc into pingcap:master Jun 10, 2020
tiancaiamao pushed a commit to tiancaiamao/parser that referenced this pull request Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants