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

expression: fix panic while call Column.VecEvalInt #13401

Merged
merged 5 commits into from
Nov 12, 2019
Merged

expression: fix panic while call Column.VecEvalInt #13401

merged 5 commits into from
Nov 12, 2019

Conversation

lonng
Copy link
Contributor

@lonng lonng commented Nov 12, 2019

Signed-off-by: Lonng heng@lonng.org

What problem does this PR solve?

expression: fix panic while call Column.VecEvalInt

What is changed and how it works?

The Column.VecEvalInt treats the chunk.Chunk as an int64 container, but the original chunk.Chunk may have a different field type.

Check List

Tests

Release note.

  • No need.

Signed-off-by: Lonng <heng@lonng.org>
@lonng lonng requested a review from a team as a code owner November 12, 2019 10:27
@ghost ghost requested review from qw4990 and SunRunAway and removed request for a team November 12, 2019 10:27
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

LGTM

@qw4990 qw4990 added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 12, 2019
Signed-off-by: Lonng <heng@lonng.org>
@@ -172,7 +172,7 @@ func (s *testEvaluatorSuite) TestColHybird(c *C) {
c.Assert(err, IsNil)
input.AppendBytes(0, num)
}
result, err := newBuffer(types.ETInt, 1024)
result, err := newBuffer(types.ETString, 1024)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add an annotation to explain why use VecEvalInt but type is ETString here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should keep this regular test and add a new specific case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The case can be triggered if the result chunk.Chunk has a different field type with Int.

Copy link
Contributor

Choose a reason for hiding this comment

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

I get it, but it is not intuitive for the first-time code reader.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comments addressed

@codecov
Copy link

codecov bot commented Nov 12, 2019

Codecov Report

Merging #13401 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13401   +/-   ##
===========================================
  Coverage   80.2116%   80.2116%           
===========================================
  Files           471        471           
  Lines        113324     113324           
===========================================
  Hits          90899      90899           
  Misses        15369      15369           
  Partials       7056       7056

@zyxbest
Copy link
Contributor

zyxbest commented Nov 12, 2019

/run-integration-copr-test copr-test=pr/22

Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

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

LGTM

@SunRunAway
Copy link
Contributor

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 12, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 12, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 12, 2019

@lonng merge failed.

@lonng
Copy link
Contributor Author

lonng commented Nov 12, 2019

/run-integration-ddl-test

@lonng lonng merged commit e1517fb into pingcap:master Nov 12, 2019
@lonng lonng deleted the fix-panic branch November 12, 2019 12:55
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants