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

*: support "drop global binding" #10193

Merged

Conversation

iamzhoug37
Copy link
Contributor

What problem does this PR solve?

associated iusse: #8935
feature: support drop global binding
use case:
create table t(i int, s varchar(20))
create index index_t on t(i,s)
create global binding for select * from t using select * from t use index for join(index_t)

If we want to drop the global binding of select * from t, we just execute drop global binding for select * from t

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test

Code changes
N/A

Related changes
N/A

@codecov
Copy link

codecov bot commented Apr 19, 2019

Codecov Report

Merging #10193 into master will increase coverage by 0.0125%.
The diff coverage is 80%.

@@               Coverage Diff                @@
##             master     #10193        +/-   ##
================================================
+ Coverage   77.9221%   77.9347%   +0.0126%     
================================================
  Files           407        407                
  Lines         82911      83049       +138     
================================================
+ Hits          64606      64724       +118     
- Misses        13512      13524        +12     
- Partials       4793       4801         +8

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 zz-jason added contribution This PR is from a community contributor. status/LGT1 Indicates that a PR has LGTM 1. labels Apr 19, 2019
@zz-jason zz-jason changed the title SQL plan management: support drop global binding *: support "drop global binding" Apr 19, 2019
@zz-jason
Copy link
Member

/run-all-tests

bindinfo/bind_test.go Outdated Show resolved Hide resolved

for i := len(metas) - 1; i >= 0; i-- {
if meta.isSame(meta) {
metas = append(metas[:i], metas[i+1:]...)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the slice reallocates, the metas will be different from c[hash]? And so with the removeStaleBindMetas.

Copy link
Contributor

Choose a reason for hiding this comment

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

Never mind, remove won't reallocate.

Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx alivxxx added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 19, 2019
@alivxxx
Copy link
Contributor

alivxxx commented Apr 19, 2019

/run-all-tests

@alivxxx alivxxx merged commit ef04594 into pingcap:master Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. status/LGT2 Indicates that a PR has LGTM 2. type/new-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants