Skip to content

ddl: fix incorrect origin default bit value in ColumnInfo#12168

Merged
tangenta merged 10 commits intopingcap:masterfrom
tangenta:fix-origin-default-bit-col
Sep 30, 2019
Merged

ddl: fix incorrect origin default bit value in ColumnInfo#12168
tangenta merged 10 commits intopingcap:masterfrom
tangenta:fix-origin-default-bit-col

Conversation

@tangenta
Copy link
Contributor

@tangenta tangenta commented Sep 12, 2019

What problem does this PR solve?

create table t (a int);
insert into t set a=1;
alter table `t` add column c bit(16) NULL default b'1100110111001';
update t set c = b'11100000000111';
(1690, u"BIT value is out of range in '(16)'")

select tidb_version();
+-------------------------------------------------------------------+
| tidb_version()                                                    |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-alpha-163-g5352e7c65                      |
| Git Commit Hash: 5352e7c65c3c200bef65d6897840ffa322b0650e         |
| Git Branch: master                                                |
| UTC Build Time: 2019-09-02 02:35:45                               |
| GoVersion: go version go1.12.9 darwin/amd64                       |
| Race Enabled: false                                               |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false                                    |
+-------------------------------------------------------------------+

What is changed and how it works?

Add a conversion in the getter function of ColumnInfo.OriginDefaultValue.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Fix incorrect origin default bit value in ColumnInfo.

@codecov
Copy link

codecov bot commented Sep 12, 2019

Codecov Report

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

@@             Coverage Diff             @@
##             master     #12168   +/-   ##
===========================================
  Coverage   79.8248%   79.8248%           
===========================================
  Files           460        460           
  Lines        102215     102215           
===========================================
  Hits          81593      81593           
  Misses        14742      14742           
  Partials       5880       5880

@AilinKid
Copy link
Contributor

Rest LGTM.

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@AilinKid AilinKid added the status/LGT2 Indicates that a PR has LGTM 2. label Sep 17, 2019
@tangenta tangenta force-pushed the fix-origin-default-bit-col branch from 6cd3906 to 7b1d93e Compare September 17, 2019 09:17
@zz-jason
Copy link
Member

@tangenta Do we need to cherry pick this commit to release 3.1?

@tangenta tangenta requested a review from lonng September 29, 2019 06:17
Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

LGTM

@lonng lonng added status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Sep 30, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 30, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Sep 30, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Sep 30, 2019

@tangenta merge failed.

@tangenta
Copy link
Contributor Author

/run-unit-test

@tangenta tangenta merged commit 933f4a5 into pingcap:master Sep 30, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 30, 2019

cherry pick to release-2.1 failed

@sre-bot
Copy link
Contributor

sre-bot commented Sep 30, 2019

cherry pick to release-3.0 in PR #12489

@sre-bot
Copy link
Contributor

sre-bot commented Sep 30, 2019

cherry pick to release-3.1 in PR #12490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants