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

ALTER TABLE DROP CONSTRAINT does not work for unique constraints

    XMLWordPrintable

Details

    Description

      The syntax is supported in MariaDB 10.2.1 (https://mariadb.com/kb/en/library/alter-table/#drop-constraint), but it doesn't work for unique constraints:

      create table t (
        a int,
        b int,
        
        constraint x unique (a),
        constraint y check (b = 1)
      );
       
      -- Does not work:
      alter table t drop constraint x;
       
      -- These work:
      alter table t drop key x;
      alter table t drop constraint y;
      

      Note, this looks like a duplicate of MDEV-10038, but at the time of MDEV-10038, the syntax wasn't yet supported by MariaDB. Now it is. Feel free to close this as a duplicate of the other (and reopen the other), if you think that's the better approach.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              lukas.eder Lukas Eder
              Votes:
              1 Vote for this issue
              Watchers:
              5 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.