-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
dropping column with index covered isn't fully compatible with mysql #3364
Comments
@qinix For above 4, please show specific version information by executing
|
|
@qinix https://pingcap.com/doc-mysql-compatibility-zh We don't support dropping column with index covered now. You may drop the index first, and then drop the column. See https://github.com/pingcap/tidb/blob/master/ddl/ddl_api.go#L888 |
Here's a test case that illustrates this behavior:
Output:
|
confirmed it still unsupported: TiDB(root@127.0.0.1:test) > create table t(a bigint, b bigint, index idx(a, b));
Query OK, 0 rows affected (0.09 sec)
TiDB(root@127.0.0.1:test) > alter table t drop column a;
ERROR 8200 (HY000): can't drop column a with index covered now tidb version: TiDB(root@127.0.0.1:test) > select * from information_schema.cluster_info;
+------+----------------------+----------------------+--------------+------------------------------------------+---------------------------+---------------------+
| TYPE | INSTANCE | STATUS_ADDRESS | VERSION | GIT_HASH | START_TIME | UPTIME |
+------+----------------------+----------------------+--------------+------------------------------------------+---------------------------+---------------------+
| tidb | 192.168.56.103:4000 | 192.168.56.103:10080 | 4.0.0-beta.2 | b2922a70987e0b3a9b5e1392375af156162de346 | 2020-07-20T20:43:39+08:00 | 23h11m36.347805s |
| pd | 192.168.56.103:2379 | 192.168.56.103:2379 | 4.1.0-alpha | d9bd722fd81413c46d1d63b6d03e7b9e4e3543ec | 2020-07-20T20:38:08+08:00 | 23h17m7.347809528s |
| tikv | 192.168.56.103:20160 | 192.168.56.103:20180 | 4.1.0-alpha | 22a94c81211d805c5938b0812482fa63e6696558 | 2020-07-20T20:43:28+08:00 | 23h11m47.347811286s |
+------+----------------------+----------------------+--------------+------------------------------------------+---------------------------+---------------------+
3 rows in set (0.01 sec) |
Try to drop a column using
ALTER TABLE xxx DROP xx_id
.According to MySQL's manual
https://dev.mysql.com/doc/refman/5.7/en/alter-table.html
it says
tidb-server -V
)?Mentor(s)
You can join #sig-ddl on slack in your spare time to discuss and get help with mentors or others.
Recommended Skills
Learning Materials
MySQL's document for syntax reference.
TiDB DDL architecture.
According to the way index should be handled with, this feature can be sub-divided into 2 tasks:
The text was updated successfully, but these errors were encountered: