tidb
tidb copied to clipboard
Can not show index for the partitioned table
Please answer these questions before submitting your issue. Thanks!
- What did you do? If possible, provide a recipe for reproducing the error.
mysql> set @@tidb_enable_table_partition = 1;
Query OK, 0 rows affected (0.00 sec)
mysql> create table partition_drop_idx (
-> c1 int, c2 int, c3 int
-> )
-> partition by range( c1 ) (
-> partition p0 values less than (1990),
-> partition p1 values less than (1995),
-> partition p2 values less than (2000),
-> partition p3 values less than (2005),
-> partition p4 values less than (2010),
-> partition p5 values less than (2015)
-> );
Query OK, 0 rows affected (0.12 sec)
mysql> alter table partition_drop_idx add index idx1 (c1);
Query OK, 0 rows affected (0.04 sec)
mysql> show index from partition_drop_idx;
- What did you expect to see?
mysql> show index from partition_drop_idx;
+--------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+--------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| partition_drop_idx | 1 | idx1 | 1 | c1 | A | 0 | NULL | NULL | YES | BTREE | | |
+--------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
1 row in set (0.00 sec)
- What did you see instead?
mysql> show index from partition_drop_idx;
Query OK, 0 rows affected (0.04 sec)
- What version of TiDB are you using (
tidb-server -Vor runselect tidb_version();on TiDB)?
- master