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: Fix the 'Unknown column' error when select from view in another database #15621

Merged
merged 4 commits into from
Mar 30, 2020

Conversation

longfangsong
Copy link
Contributor

@longfangsong longfangsong commented Mar 24, 2020

What problem does this PR solve?

fix #15611

Issue Number: close #15611

What is changed and how it works?

What's Changed:

Changing this line to DBName: dbName

Just as @XuHuaiyu mentioned.

Related changes

NA

Release note

NA

Unit test is already added.

@longfangsong longfangsong requested a review from a team as a code owner March 24, 2020 05:06
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Mar 24, 2020
@ghost ghost requested review from francis0407 and lzmhhh123 March 24, 2020 05:06
@CLAassistant
Copy link

CLAassistant commented Mar 24, 2020

CLA assistant check
All committers have signed the CLA.

@ghost ghost removed their request for review March 24, 2020 05:06
@longfangsong longfangsong changed the title try fix #15611 [WIP] try fix #15611 Mar 24, 2020
@zz-jason
Copy link
Member

Hi @longfangsong, thanks for your contribution, please add a UT for this bugfix.

@codecov
Copy link

codecov bot commented Mar 24, 2020

Codecov Report

Merging #15621 into master will decrease coverage by 0.1353%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##            master     #15621        +/-   ##
===============================================
- Coverage   80.551%   80.4156%   -0.1354%     
===============================================
  Files          504        503         -1     
  Lines       135349     134475       -874     
===============================================
- Hits        109025     108139       -886     
+ Misses       17860      17837        -23     
- Partials      8464       8499        +35

@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Mar 24, 2020
@longfangsong
Copy link
Contributor Author

Hi @longfangsong, thanks for your contribution, please add a UT for this bugfix.

I'm sorry that I'm new in tidb developing, so I'm not sure whether I put the test in the right place.

If I'm wrong, could you please tell me where should I put it in.

@@ -2927,7 +2927,7 @@ func (b *PlanBuilder) buildProjUponView(ctx context.Context, dbName model.CIStr,
OrigTblName: name.OrigTblName,
ColName: columnInfo[i].Name,
OrigColName: origColName,
DBName: name.DBName,
DBName: dbName,
Copy link
Member

Choose a reason for hiding this comment

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

@XuHuaiyu Do you have any advise about how to test this bugfix?

@zz-jason
Copy link
Member

Hi @longfangsong, thanks for your contribution, please add a UT for this bugfix.

I'm sorry that I'm new in tidb developing, so I'm not sure whether I put the test in the right place.

If I'm wrong, could you please tell me where should I put it in.

Don't worry, we'll help you. 😄

@XuHuaiyu
Copy link
Contributor

@longfangsong
The test function looks good to me. ^_^
Can we remove the [WIP] in the title now?
And, please modify the title to a more meaningful sentence about what you do in this PR.

@XuHuaiyu XuHuaiyu added sig/planner SIG: Planner needs-cherry-pick-3.0 type/bugfix This PR fixes a bug. and removed sig/sql-infra SIG: SQL Infra labels Mar 24, 2020
@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Mar 24, 2020
@longfangsong longfangsong changed the title [WIP] try fix #15611 Fix the 'Unknown column' error when select from view in another database Mar 24, 2020
@longfangsong longfangsong changed the title Fix the 'Unknown column' error when select from view in another database planner: Fix the 'Unknown column' error when select from view in another database Mar 24, 2020
@zz-jason zz-jason requested review from XuHuaiyu and removed request for francis0407 and lzmhhh123 March 30, 2020 03:09
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

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 the status/LGT1 Indicates that a PR has LGTM 1. label Mar 30, 2020
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

@XuHuaiyu XuHuaiyu added the status/can-merge Indicates a PR has been approved by a committer. label Mar 30, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 30, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Mar 30, 2020

@longfangsong merge failed.

@XuHuaiyu
Copy link
Contributor

/run-sqllogic-test

@XuHuaiyu XuHuaiyu added status/LGT2 Indicates that a PR has LGTM 2. and removed sig/sql-infra SIG: SQL Infra status/LGT1 Indicates that a PR has LGTM 1. labels Mar 30, 2020
@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Mar 30, 2020
@zz-jason
Copy link
Member

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Mar 30, 2020

Your auto merge job has been accepted, waiting for 15836, 15856, 15817, 15851, 15849, 15709

@zz-jason zz-jason merged commit d0ca931 into pingcap:master Mar 30, 2020
sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Mar 30, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Mar 30, 2020

cherry pick to release-3.0 in PR #15866

sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Mar 30, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Mar 30, 2020

cherry pick to release-3.1 in PR #15867

@sre-bot
Copy link
Contributor

sre-bot commented Mar 30, 2020

cherry pick to release-4.0 in PR #15868

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. sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra 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.

UCP: unexpected error happened when select dbName.viewName.col from another database
5 participants