Skip to content

model: fix null origin default value for bit column#983

Merged
tangenta merged 1 commit intopingcap:masterfrom
tangenta:fix-default-bit-col
Aug 27, 2020
Merged

model: fix null origin default value for bit column#983
tangenta merged 1 commit intopingcap:masterfrom
tangenta:fix-default-bit-col

Conversation

@tangenta
Copy link
Contributor

@tangenta tangenta commented Aug 26, 2020

What problem does this PR solve?

In PR pingcap/tidb#18036,

drop table if exists t;
create table t (a bit);
insert into t values (null);
select count(*) from t where a is null;

Expected:

+----------+
| count(*) |
+----------+
| 1        |
+----------+

But got:

+----------+
| count(*) |
+----------+
| 0        |
+----------+

If the origin default value in the BIT column is null, it should not be converted to a string.

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test

Code changes

N/A

Side effects

N/A

Related changes

  • Need to cherry-pick to the release branch

@tangenta tangenta requested a review from wjhuang2016 August 26, 2020 07:29
Copy link
Contributor

@kennytm kennytm 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 LGT1 label Aug 26, 2020
Copy link
Contributor

@crazycs520 crazycs520 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 removed the status/LGT1 LGT1 label Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants