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

executor: fix the bug: can not join if join keys are type bigint and type bit #19032

Merged
merged 2 commits into from
Aug 14, 2020
Merged

executor: fix the bug: can not join if join keys are type bigint and type bit #19032

merged 2 commits into from
Aug 14, 2020

Conversation

Enochack
Copy link

@Enochack Enochack commented Aug 6, 2020

What problem does this PR solve?

Issue Number: close #11896

Problem Summary:

What is changed and how it works?

Proposal: xxx

What's Changed:

Only if integers have no unsigned flag and are negative, treat them as signed integers. Otherwise, just treat them as unsigned numbers so that the comparison between an integer and a bit set will be as expected.

How it Works:

tidb [test]> drop table if exists t;
Query OK, 0 rows affected (0.02 sec)

tidb [test]> drop table if exists t1;
Query OK, 0 rows affected (0.01 sec)

tidb [test]> create table t(c1 bigint);
Query OK, 0 rows affected (0.01 sec)

tidb [test]> create table t1(c1 bit(64));
Query OK, 0 rows affected (0.00 sec)

tidb [test]> insert into t value(1);
Query OK, 1 row affected (0.00 sec)

tidb [test]> insert into t1 value(1);
Query OK, 1 row affected (0.00 sec)

tidb [test]> select * from t, t1 where t.c1 = t1.c1;
+------+--------------------+
| c1   | c1                 |
+------+--------------------+
|    1 | 0x0000000000000001 |
+------+--------------------+
1 row in set (0.00 sec)

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Integration test
  • Manual test (add detailed scripts or steps below)

Release note

@ti-srebot ti-srebot added the contribution This PR is from a community contributor. label Aug 6, 2020
@Enochack Enochack changed the title executor: fix the bug: can not join if join keys are type bigint and type bit (#11896) executor: fix the bug: can not join if join keys are type bigint and type bit Aug 6, 2020
@codecov
Copy link

codecov bot commented Aug 6, 2020

Codecov Report

Merging #19032 into master will increase coverage by 0.3346%.
The diff coverage is 100.0000%.

@@               Coverage Diff                @@
##             master     #19032        +/-   ##
================================================
+ Coverage   79.0715%   79.4062%   +0.3346%     
================================================
  Files           549        546         -3     
  Lines        149218     147938      -1280     
================================================
- Hits         117989     117472       -517     
+ Misses        21700      20984       -716     
+ Partials       9529       9482        -47     

@Enochack Enochack marked this pull request as ready for review August 6, 2020 05:08
@Enochack Enochack requested a review from a team as a code owner August 6, 2020 05:08
@Enochack Enochack requested review from SunRunAway and removed request for a team August 6, 2020 05:08
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

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 14, 2020
@SunRunAway SunRunAway requested a review from lzmhhh123 August 14, 2020 08:35
@SunRunAway
Copy link
Contributor

Hi, @ThySinner
Thank you for your contribution, please help resolve the conflicting files.

Copy link
Contributor

@lzmhhh123 lzmhhh123 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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 14, 2020
@lzmhhh123
Copy link
Contributor

/merge

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

/run-all-tests

@ti-srebot ti-srebot merged commit 5184a0d into pingcap:master Aug 14, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Aug 14, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-3.0 in PR #19213

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Aug 14, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-3.1 in PR #19214

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Aug 14, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #19215

@Enochack Enochack deleted the issue-11896 branch August 17, 2020 12:25
ti-srebot added a commit that referenced this pull request Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/executor contribution This PR is from a community contributor. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not join if join keys are type bigint and type bit(64)
4 participants