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

planner: make a copy of column before modifying its InOperand #19472

Merged
merged 3 commits into from
Aug 26, 2020

Conversation

eurekaka
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #19423

Problem Summary:

Incorrect of anti-semi-join query caused by incorrect OtherConditions of the LogicalJoin plan.

What is changed and how it works?

What's Changed:

After #13406, LogicalProjection would not allocate new Column for column -> column projection, so if we directly modify InOperand of a Column, it may effect the filters in the subquery. Make a copy of this column before modifying this field.

How it Works:

The filters in the subquery would stay untouched, so they can correctly be put into EqualConditions / OtherConditions later.

Related changes

Check List

Tests

  • Unit test

Side effects

N/A

Release note

  • Fix incorrect result of anti-semi-join query

@eurekaka eurekaka added type/bugfix This PR fixes a bug. sig/planner SIG: Planner needs-cherry-pick-4.0 labels Aug 26, 2020
@eurekaka eurekaka requested review from a team as code owners August 26, 2020 07:54
@eurekaka eurekaka requested review from qw4990, SunRunAway, winoros and XuHuaiyu and removed request for a team, qw4990 and SunRunAway August 26, 2020 07:54
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

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 26, 2020
@eurekaka
Copy link
Contributor Author

/run-unit-test

1 similar comment
@eurekaka
Copy link
Contributor Author

/run-unit-test

Copy link
Member

@winoros winoros 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 removed the status/LGT1 Indicates that a PR has LGTM 1. label Aug 26, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 26, 2020
@winoros
Copy link
Member

winoros commented Aug 26, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 26, 2020
@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 19440

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@eurekaka merge failed.

@eurekaka
Copy link
Contributor Author

/run-all-tests

@XuHuaiyu
Copy link
Contributor

/run-unit-test

@eurekaka eurekaka merged commit cc661e0 into pingcap:master Aug 26, 2020
@eurekaka eurekaka deleted the anti-join branch August 26, 2020 08:43
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Aug 26, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #19477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect result of an anti-semi-join query
4 participants