tidb icon indicating copy to clipboard operation
tidb copied to clipboard

Can not show index for the partitioned table

Open ciscoxll opened this issue 8 years ago • 0 comments

Please answer these questions before submitting your issue. Thanks!

  1. 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;
  1. 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)
  1. What did you see instead?
mysql> show index from  partition_drop_idx;
Query OK, 0 rows affected (0.04 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
  • master

ciscoxll avatar Aug 10 '18 02:08 ciscoxll