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

plan: fix a bug in index join #7150

Merged
merged 10 commits into from
Jul 30, 2018
Merged

plan: fix a bug in index join #7150

merged 10 commits into from
Jul 30, 2018

Conversation

winoros
Copy link
Member

@winoros winoros commented Jul 25, 2018

What have you changed? (mandatory)

wrongly usage of golang's copy

What is the type of the changes? (mandatory)

  • Bug fix

How has this PR been tested? (mandatory)

newly added explain test.

@winoros winoros added type/bugfix This PR fixes a bug. sig/planner SIG: Planner labels Jul 25, 2018
zz-jason
zz-jason previously approved these changes Jul 25, 2018
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

@XuHuaiyu
Copy link
Contributor

ci failed @winoros

@zz-jason
Copy link
Member

/run-all-tests

alivxxx
alivxxx previously approved these changes Jul 25, 2018
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

@@ -60,12 +61,26 @@ func (expr *Constant) format(dt types.Datum) string {
}

// ExplainExpressionList generates explain information for a list of expressions.
func ExplainExpressionList(exprs []Expression) []byte {
func ExplainExpressionList(exprs []Expression, needSort bool) []byte {
Copy link
Contributor

Choose a reason for hiding this comment

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

add a comment for needSort

@winoros
Copy link
Member Author

winoros commented Jul 26, 2018

@XuHuaiyu PTAL

XuHuaiyu
XuHuaiyu previously approved these changes Jul 26, 2018
Copy link
Contributor

@XuHuaiyu XuHuaiyu 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 previously approved these changes Jul 26, 2018
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

@@ -60,12 +61,28 @@ func (expr *Constant) format(dt types.Datum) string {
}

// ExplainExpressionList generates explain information for a list of expressions.
func ExplainExpressionList(exprs []Expression) []byte {
// needSort will be true if the exprs should keep its order. In some scenarios, the expr's order may not be valid
Copy link
Member

Choose a reason for hiding this comment

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

why the order of the exprs may not be valid?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's map access when extract same part from DNF. So the order after this cannot be valid.

Copy link
Member

Choose a reason for hiding this comment

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

Uh, I think stable is a better word. By the way, this function only used when we explain a sql, and the performance doesn't matter, I think we can force to sort the exprs to simplify the function signature, and this function can be renamed to SortAndExplainExpressionList.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok

@winoros winoros dismissed stale reviews from zimulala and XuHuaiyu via 124d80c July 27, 2018 05:34
zz-jason
zz-jason previously approved these changes Jul 27, 2018
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

@winoros winoros merged commit e907bfc into pingcap:master Jul 30, 2018
@winoros winoros deleted the copy-bug branch July 30, 2018 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants