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

ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment

    XMLWordPrintable

Details

    Description

      This script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1(a INT, b INT);
      CREATE INDEX i1 ON t1(a) COMMENT 'comment1';  
      ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2';
      SHOW CREATE TABLE t1;

      returns

      +-------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                                                           |
      +-------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `a` int(11) DEFAULT NULL,
        `b` int(11) DEFAULT NULL,
        KEY `i1` (`a`) COMMENT 'comment1'
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+--------------------------------------------------------------------------------------------------------------------------------------------------------+

      Notice, the new comment 'comment2' was ignored. The bug happens when the name and the column list of the new index is exactly the same with the old index.

      The expected behaviour would be to replace the comment to 'comment2'.

      The problem does not repeat in MariaDB-5.5.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.