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 primary key in one statement #119

Open
Tracked by #1 ...
tangenta opened this issue Jun 16, 2022 · 0 comments
Open
Tracked by #1 ...

Support drop and add primary key in one statement #119

tangenta opened this issue Jun 16, 2022 · 0 comments

Comments

@tangenta
Copy link
Owner

tangenta commented Jun 16, 2022

The following case is useful in reorganizing primary without the risk of duplicated primary key:

CREATE TABLE t1 (id int primary key, c1 int not null);
ALTER TABLE t1
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (id, c1);

Expected:

Query OK, 0 rows affected (0.01 sec)

But got:

mysql> ALTER TABLE t1
    ->   DROP PRIMARY KEY,
    ->   ADD PRIMARY KEY (id, c1);
ERROR 8200 (HY000): Unsupported drop primary key when the table's pkIsHandle is true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant