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 problem with modifying bit column #12019

Closed
wants to merge 2 commits into from

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Sep 4, 2019

What problem does this PR solve?

Unexpected error:

create table t (a bit(1));
alter table t modify column a bit(20);
(1105, 'unsupported modify column unsigned false not match origin true')

Similarly,

create table t (a year);
alter table t modify column a year;
(1105, 'unsupported modify column unsigned false not match origin true')

When creating a bit column, the flag in the fieldType is set to Unsigned. However, when modifying it, the Unsigned flag of the new column is forgotten to be set, leading to the error above.

What is changed and how it works?

  • Extract the logic of setting flags as setFlagByFieldType.
  • Add setFlagByFiledType() to getModifiableColumnJob.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Fix problem with modifying bit column

@tangenta
Copy link
Contributor Author

tangenta commented Sep 4, 2019

/run-all-tests

Copy link
Contributor

@winkyao winkyao 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

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@tangenta
Copy link
Contributor Author

tangenta commented Sep 4, 2019

This PR conflicts with #12008.

@tangenta tangenta closed this Sep 4, 2019
@you06 you06 added the sig/sql-infra SIG: SQL Infra label Mar 4, 2020
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 type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants