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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 10.2.29
    • Fix Version/s: N/A
    • Labels:
      None
    • Environment:
      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

              Assignee:
              Unassigned
              Reporter:
              rockstar85 Amar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: