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

fix(query): alter modify col comment need modify when type not modify #15217

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Apr 11, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

create table t1(id varchar, id2 varchar);
Query OK, 0 rows affected (0.060 sec)

MySQL [(none)]> alter table t1 modify id varchar comment 'ss';
Query OK, 0 rows affected (0.246 sec)

MySQL [(none)]> alter table t1 modify id varchar comment 'ss', id2 varchar comment 's3';
Query OK, 0 rows affected (0.079 sec)

After alter:

show create table t1;
+-------+-----------------------------------------------------------------------+
| Table | Create Table                                                          |
+-------+-----------------------------------------------------------------------+
| t1    | CREATE TABLE t1 (
  id VARCHAR NULL,
  id2 VARCHAR NULL
) ENGINE=FUSE |
+-------+-----------------------------------------------------------------------+

Because in
https://github.com/datafuselabs/databend/blob/3aeb2d0290ac004adda4a8e13306b50e33798d4f/src/query/service/src/interpreters/interpreter_table_modify_column.rs#L245

So if new type is same, the schema will always eq with old schema.

So if column type is not modify, the comment will be ignored.

Tests

  • Logic Test

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

This change is Reviewable

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Apr 11, 2024
@BohuTANG BohuTANG merged commit a2bb0b5 into databendlabs:main Apr 11, 2024
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: alter table need support modify column comment
4 participants