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

ALTER TABLE .. ADD PRIMARY KEY IF NOT EXISTS -> ERROR 1068 (42000): Multiple primary key defined

    XMLWordPrintable

Details

    • 10.0.22

    Description

      MariaDB [test]> CREATE TABLE `market_deductions` (
          ->   `event_id` bigint(20) unsigned NOT NULL DEFAULT '0',
          ->   `market_id` bigint(20) unsigned NOT NULL DEFAULT '0',
          ->   PRIMARY KEY (`event_id`,`market_id`)
          -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
      Query OK, 0 rows affected (0.01 sec)
       
      MariaDB [test]>  ALTER TABLE market_deductions ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
      ERROR 1068 (42000): Multiple primary key defined

      Seems IF NOT EXISTS is not really checked.

      Haven't checked if 10.0.22 has fixed this as part of MDEV-8212

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              danblack Daniel Black
              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.