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

Index on a HEAP table retains DESC attribute despite being hash

Details

    Description

      preview-10.8-MDEV-13756-desc-indexes 49b38c82a

      MariaDB [test]> create or replace table t (a int, key(a desc)) engine=Memory;
      Query OK, 0 rows affected (0.040 sec)
       
      MariaDB [test]> show create table t;
      +-------+------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                               |
      +-------+------------------------------------------------------------------------------------------------------------+
      | t     | CREATE TABLE `t` (
        `a` int(11) DEFAULT NULL,
        KEY `a` (`a` DESC)
      ) ENGINE=MEMORY DEFAULT CHARSET=latin1 |
      +-------+------------------------------------------------------------------------------------------------------------+
      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     |          1 | a        |            1 | a           | NULL      |           0 |     NULL | NULL   | YES  | HASH       |         |               | NO      |
      +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
      1 row in set (0.001 sec)
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            Description {code:sql}
            MariaDB [test]> create or replace table t (a int, key(a desc)) engine=Memory;
            Query OK, 0 rows affected (0.040 sec)

            MariaDB [test]> show create table t;
            +-------+------------------------------------------------------------------------------------------------------------+
            | Table | Create Table |
            +-------+------------------------------------------------------------------------------------------------------------+
            | t | CREATE TABLE `t` (
              `a` int(11) DEFAULT NULL,
              KEY `a` (`a` DESC)
            ) ENGINE=MEMORY DEFAULT CHARSET=latin1 |
            +-------+------------------------------------------------------------------------------------------------------------+
            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 | 1 | a | 1 | a | NULL | 0 | NULL | NULL | YES | HASH | | | NO |
            +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
            1 row in set (0.001 sec)
            {code}

            {code:sql|title=preview-10.8-MDEV-13756-desc-indexes 49b38c82a}
            MariaDB [test]> create or replace table t (a int, key(a desc)) engine=Memory;
            Query OK, 0 rows affected (0.040 sec)

            MariaDB [test]> show create table t;
            +-------+------------------------------------------------------------------------------------------------------------+
            | Table | Create Table |
            +-------+------------------------------------------------------------------------------------------------------------+
            | t | CREATE TABLE `t` (
              `a` int(11) DEFAULT NULL,
              KEY `a` (`a` DESC)
            ) ENGINE=MEMORY DEFAULT CHARSET=latin1 |
            +-------+------------------------------------------------------------------------------------------------------------+
            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 | 1 | a | 1 | a | NULL | 0 | NULL | NULL | YES | HASH | | | NO |
            +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
            1 row in set (0.001 sec)
            {code}

            serg Sergei Golubchik made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] In Testing [ 10301 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.8.1 [ 26815 ]
            Fix Version/s 10.8 [ 26121 ]
            Resolution Fixed [ 1 ]
            Status In Testing [ 10301 ] Closed [ 6 ]

            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.