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

*: fix panic for create view using prepare #10651

Merged
merged 5 commits into from
Jun 4, 2019
Merged

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented May 30, 2019

What problem does this PR solve?

Create view using prepare will panic.

What is changed and how it works?

Previously, when we build the create view statement, the Fields of select statement will be rewritten with only name info, so the Expr will be nil when we try to execute the prepare statement, which will cause panic. This PR adds a new field in CreateViewStmt to record the select schema.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • Need to cherry-pick to the release branch

@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #10651 into master will decrease coverage by 0.0067%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##             master    #10651        +/-   ##
===============================================
- Coverage   78.3547%   78.348%   -0.0068%     
===============================================
  Files           414       414                
  Lines         87719     87701        -18     
===============================================
- Hits          68732     68712        -20     
- Misses        13845     13848         +3     
+ Partials       5142      5141         -1

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 Jun 3, 2019
@alivxxx
Copy link
Contributor Author

alivxxx commented Jun 4, 2019

/run-all-tests

@alivxxx
Copy link
Contributor Author

alivxxx commented Jun 4, 2019

/rebuild

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

@alivxxx alivxxx added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 4, 2019
@alivxxx alivxxx merged commit ce91d25 into pingcap:master Jun 4, 2019
@alivxxx alivxxx deleted the create-view branch June 4, 2019 04:55
alivxxx added a commit to alivxxx/tidb that referenced this pull request Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner 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.

3 participants