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

Support drop and add column with same name in one statement #38568

Open
Tracked by #14766
Mini256 opened this issue Oct 20, 2022 · 3 comments
Open
Tracked by #14766

Support drop and add column with same name in one statement #38568

Mini256 opened this issue Oct 20, 2022 · 3 comments
Labels
type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@Mini256
Copy link
Member

Mini256 commented Oct 20, 2022

Feature request

1. Minimal reproduce step (Required)

CREATE TABLE `Test` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `col0` BIGINT NULL,
    `col1` BIGINT NULL,
    `col2` BIGINT NULL,
    `col3` BIGINT NULL,
    `col4` BIGINT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

ALTER TABLE `Test` DROP COLUMN `col0`,
    ADD COLUMN `col0` DECIMAL(15, 6) NULL,
    DROP COLUMN `col1`,
    ADD COLUMN `col1` DATE NULL,
    DROP COLUMN `col2`,
    ADD COLUMN `col2` DATETIME(0) NULL,
    DROP COLUMN `col3`,
    ADD COLUMN `col3` JSON NULL,
    DROP COLUMN `col4`,
    ADD COLUMN `col4` TIMESTAMP(0) NULL;

2. What did you expect to see? (Required)

Should be work well like MySQL.

3. What did you see instead (Required)

ERROR 1060 (42S21): Duplicate column name 'col0'

4. What is your TiDB version? (Required)

mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v6.3.0
Edition: Community
Git Commit Hash: ecd67531f1721d3e49eb15a202ac7c0ae02291ec
Git Branch: heads/refs/tags/v6.3.0
UTC Build Time: 2022-09-23 14:21:08
GoVersion: go1.19.1
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
1 row in set (0.00 sec)
@Mini256 Mini256 added the type/bug The issue is confirmed as a bug. label Oct 20, 2022
@Mini256
Copy link
Member Author

Mini256 commented Oct 20, 2022

cc: @tangenta

/remove-type bug
/type feature

@ti-chi-bot
Copy link
Member

@Mini256: The label(s) type/feature cannot be applied, because the repository doesn't have them.

In response to this:

cc: @tangenta

/remove-type bug
/type feature

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot removed the type/bug The issue is confirmed as a bug. label Oct 20, 2022
@Mini256
Copy link
Member Author

Mini256 commented Oct 20, 2022

/type feature-request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants