Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35324

Different index type shown in SHOW INDEX vs SHOW CREATE TABLE

    XMLWordPrintable

Details

    Description

      Reproducible only on the vector branch, even though it doesn't involve vector.

      MariaDB [test]> create or replace table t (b blob, unique(b)) engine=InnoDB;
      Query OK, 0 rows affected (0.057 sec)
       
      MariaDB [test]> show create table t;
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                                                        |
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
      | t     | CREATE TABLE `t` (
        `b` blob DEFAULT NULL,
        UNIQUE KEY `b` (`b`) USING HASH
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.001 sec)
       
      MariaDB [test]> show index in t;
      +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
      | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
      +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
      | t     |          0 | b        |            1 | b           | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               | NO      |
      +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
      1 row in set (0.001 sec)
      

      So, it's HASH in SHOW CREATE, but BTREE in SHOW INDEX and in INFORMATION_SCHEMA.STATISTICS. It used to be HASH everywhere.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.