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

Incorrect error message when trying to delete column which is part of unique key constraint

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.2.29
    • N/A
    • None
    • CentOS release 6.8 (Final)
      Mariadb 10.2.29

    Description

      MariaDB [mydb]> create table emp( name varchar(11), id int(11));
      MariaDB [mydb]> ALTER TABLE emp
      -> ADD CONSTRAINT websites_unique UNIQUE (id,name);
      Query OK, 0 rows affected (0.01 sec)
      Records: 0 Duplicates: 0 Warnings: 0

      MariaDB [mydb]> desc emp;
      -------------------------------------+

      Field Type Null Key Default Extra

      -------------------------------------+

      name varchar(11) YES   NULL  
      id int(11) YES MUL NULL  

      -------------------------------------+
      2 rows in set (0.00 sec)

      MariaDB [mydb]> alter table emp drop column id;
      *ERROR 1072 (42000): Key column 'id' doesn't exist in table
      *MariaDB [mydb]>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rockstar85 Amar
              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.