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

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

Merged
merged 7 commits into from
Oct 10, 2019

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Sep 30, 2019

cherry-pick #12168 to release-3.0


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.

@sre-bot
Copy link
Contributor Author

sre-bot commented Sep 30, 2019

/run-all-tests

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

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Sep 30, 2019
@sre-bot
Copy link
Contributor Author

sre-bot commented Sep 30, 2019

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Sep 30, 2019

@sre-bot merge failed.

@zimulala zimulala added the status/LGT2 Indicates that a PR has LGTM 2. label Oct 3, 2019
@ngaut ngaut merged commit 0aa2fd4 into pingcap:release-3.0 Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants