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

chunk: make mysql.TypeNull be judged as fixedLen #15512

Merged
merged 4 commits into from
Mar 26, 2020
Merged

chunk: make mysql.TypeNull be judged as fixedLen #15512

merged 4 commits into from
Mar 26, 2020

Conversation

lysu
Copy link
Contributor

@lysu lysu commented Mar 20, 2020

What problem does this PR solve?

Issue Number: close #6252

Problem Summary:

What is changed and how it works?

fix:

MySQL [test]> create table t2(a int);
Query OK, 0 rows affected (0.013 sec)
MySQL [test]> create table t1(a int);
Query OK, 0 rows affected (0.011 sec)
MySQL [test]> insert into t1(a) select 1;
Query OK, 1 row affected (0.004 sec)
Records: 1 Duplicates: 0 Warnings: 0
MySQL [test]> select b.n from t1 left join (select a as a, null as n from t2) b on b.a = t1.a order by t1.a;
ERROR 1105 (HY000): runtime error: index out of range [1] with length 1

What's Changed:

try let TypeNull as fixedLen column in the chunk

How it Works:

try let TypeNull as fixedLen column in the chunk

Related changes

  • Need to cherry-pick to the release branch: same problem in 2.1/3.0

Check List

Tests

WIP

  • Unit test
  • Integration test

Side effects

  • n/a

Release note

fix panic when sort/topn above left join with null column in right child


This change is Reviewable

@lysu lysu added type/bugfix This PR fixes a bug. sig/execution SIG execution labels Mar 20, 2020
@lysu
Copy link
Contributor Author

lysu commented Mar 20, 2020

bug caused by

chk.AppendPartialRowByColIdxs(lWide, j.defaultInner, j.rUsed)

source chunk j.defaultInner is fixedLen null column, but destination chunk chk is varLen null column.

@lysu lysu changed the title chunk: make TypeNull be fixedLen type chunk: make mysql.TypeNull be judged as fixedLen Mar 20, 2020
@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #15512 into master will decrease coverage by 0.0685%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master     #15512        +/-   ##
================================================
- Coverage   80.5692%   80.5006%   -0.0686%     
================================================
  Files           504        502         -2     
  Lines        135203     134348       -855     
================================================
- Hits         108932     108151       -781     
+ Misses        17774      17741        -33     
+ Partials       8497       8456        -41

@lysu
Copy link
Contributor Author

lysu commented Mar 20, 2020

/run-all-tests

@lysu
Copy link
Contributor Author

lysu commented Mar 20, 2020

/run-unit-test

@lysu lysu marked this pull request as ready for review March 20, 2020 05:11
@lysu lysu requested a review from a team as a code owner March 20, 2020 05:11
@ghost ghost requested review from qw4990 and XuHuaiyu and removed request for a team March 20, 2020 05:11
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 Mar 24, 2020
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 needs-cherry-pick-3.0 status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 26, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 26, 2020

Your auto merge job has been accepted, waiting for 15628, 15635, 15711

@sre-bot
Copy link
Contributor

sre-bot commented Mar 26, 2020

/run-all-tests

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

sre-bot commented Mar 26, 2020

cherry pick to release-3.0 in PR #15738

@sre-bot
Copy link
Contributor

sre-bot commented Mar 26, 2020

cherry pick to release-3.1 in PR #15739

@sre-bot
Copy link
Contributor

sre-bot commented Mar 26, 2020

cherry pick to release-4.0 in PR #15740

@lysu lysu deleted the dev-try-null-fixed-len branch March 31, 2020 14:22
@lysu
Copy link
Contributor Author

lysu commented Mar 31, 2020

/run-cherry-picker

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

sre-bot commented Mar 31, 2020

cherry pick to release-2.1 in PR #15930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution 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.

query failed with "runtime error: index out of range"
4 participants