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: make join work when keys are bigint and bit (#19032) #19213

Merged
merged 4 commits into from
Sep 17, 2020

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Aug 14, 2020

cherry-pick #19032 to release-3.0


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

  • fix the bug: can not join if join keys are type bigint and type bit

@ti-srebot
Copy link
Contributor Author

/run-all-tests

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.

@lzmhhh123 would you like to help to resolve the conflict and fix the CI?

@ti-srebot
Copy link
Contributor Author

@ti-srebot, please update your pull request.

@sre-bot
Copy link
Contributor

sre-bot commented Sep 11, 2020

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 the status/LGT1 Indicates that a PR has LGTM 1. label Sep 11, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Sep 11, 2020

@lzmhhh123
Copy link
Contributor

/rebuild

@XuHuaiyu
Copy link
Contributor

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 Sep 17, 2020
@XuHuaiyu
Copy link
Contributor

/run-all-tests

@XuHuaiyu XuHuaiyu changed the title executor: fix the bug: can not join if join keys are type bigint and type bit (#19032) executor: make join work when keys are bigint and bit (#19032) Sep 17, 2020
@XuHuaiyu XuHuaiyu merged commit 282f852 into pingcap:release-3.0 Sep 17, 2020
@XuHuaiyu XuHuaiyu deleted the release-3.0-5184a0d70609 branch September 17, 2020 03:15
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. sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/3.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants