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

bug: ALTER TABLE prompt information is incorrect #1142

Closed
2 of 3 tasks
davidshiz opened this issue Dec 16, 2022 · 2 comments · Fixed by #1183
Closed
2 of 3 tasks

bug: ALTER TABLE prompt information is incorrect #1142

davidshiz opened this issue Dec 16, 2022 · 2 comments · Fixed by #1183
Assignees
Labels
A-bug Something isn't working

Comments

@davidshiz
Copy link
Collaborator

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

mysql> CREATE TABLE st2 (
    ->     task_id INT NOT NULL,
    ->     subject VARCHAR(45) NULL,
    ->     start_date DATE NULL,
    ->     end_date DATE NULL,
    ->     description VARCHAR(200) NULL,
    ->     PRIMARY KEY (task_id)
    -> );
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER TABLE st2 ADD COLUMN col_name3 int auto_increment;
ERROR 6 (HY000): Unable to inplace alter table

Expected behavior

mysql> CREATE TABLE st2 (
    ->     task_id INT NOT NULL,
    ->     subject VARCHAR(45) NULL,
    ->     start_date DATE NULL,
    ->     end_date DATE NULL,
    ->     description VARCHAR(200) NULL,
    ->     PRIMARY KEY (task_id)
    -> );
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER TABLE st2 ADD COLUMN col_name3 int auto_increment;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

How To Reproduce

CREATE TABLE st2 (
    task_id INT NOT NULL,
    subject VARCHAR(45) NULL,
    start_date DATE NULL,
    end_date DATE NULL,
    description VARCHAR(200) NULL,
    PRIMARY KEY (task_id)
); 
ALTER TABLE st2 ADD COLUMN col_name3 int auto_increment;

Environment

root@ub01:/stonedb57/install# /stonedb57/install/bin/mysqld --version
/stonedb57/install/bin/mysqld  Ver 5.7.36-StoneDB for Linux on x86_64 (build-)
build information as follow:
        Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
        Branch name: stonedb-5.7-dev
        Last commit ID: e395f89e1
        Last commit time: Date:   Tue Dec 6 01:04:24 2022 +0800
        Build time: Date: Tue Dec  6 16:03:58 CST 2022
root@ub01:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@davidshiz davidshiz added the A-bug Something isn't working label Dec 16, 2022
@davidshiz
Copy link
Collaborator Author

similar to #1140

@DandreChen
Copy link
Collaborator

The exception handling has problems

DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 3, 2023
…oneatom#1142)

Add test cases for ALTER TABLE when exception occurs by inplace algorithm
DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 3, 2023
)

Print the specific information of known exceptions to better understand the cause of the problem
DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 5, 2023
…oneatom#1142)

Add test cases for ALTER TABLE when exception occurs by inplace algorithm
DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 5, 2023
)

Print the specific information of known exceptions to better understand the cause of the problem
@mergify mergify bot closed this as completed in #1183 Jan 5, 2023
mergify bot pushed a commit that referenced this issue Jan 5, 2023
)

Add test cases for ALTER TABLE when exception occurs by inplace algorithm
mergify bot pushed a commit that referenced this issue Jan 5, 2023
Print the specific information of known exceptions to better understand the cause of the problem
konghaiya pushed a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
…oneatom#1142)

Add test cases for ALTER TABLE when exception occurs by inplace algorithm
konghaiya pushed a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
)

Print the specific information of known exceptions to better understand the cause of the problem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants