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

Duplicate entry on ALTER TABLE ADD COLUMN

    XMLWordPrintable

    Details

      Description

      actual_recording | CREATE TABLE `actual_recording` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `asset_manifest_id` int(10) unsigned DEFAULT NULL COMMENT 'Default to null now, but plan is to be not null when new version of transcoding platform has taken over',
        `asset_video_id` int(10) unsigned DEFAULT NULL COMMENT 'Default to null now, but plan is to be not null when new version of transcoding platform has taken over',
        `user_id` int(10) unsigned NOT NULL,
        `profile_id` int(10) unsigned NOT NULL,
        `channel_id` int(10) unsigned NOT NULL,
        `bookmark_id` int(10) unsigned DEFAULT NULL,
        `broadcast_id` int(10) unsigned NOT NULL,
        `episode_id` int(10) unsigned NOT NULL,
        `program_id` int(10) unsigned NOT NULL,
        `vbegin` int(10) unsigned NOT NULL,
        `vend` int(10) unsigned NOT NULL,
        `is_partial` tinyint(1) NOT NULL DEFAULT '0',
        `is_watched` tinyint(1) NOT NULL DEFAULT '0',
        `scheduled_at` datetime NOT NULL,
        `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
        `deleted_at` datetime DEFAULT NULL,
        `deleted_reason` varchar(2000) DEFAULT NULL,
        `asset_manifest_file_object_id` varchar(40) DEFAULT '',
        `asset_file_file_object_id` varchar(40) DEFAULT '',
        PRIMARY KEY (`id`),
        UNIQUE KEY `are_profile_channel_episode` (`profile_id`,`channel_id`,`episode_id`),
        UNIQUE KEY `ar_broadcast_profile_id` (`broadcast_id`,`user_id`,`profile_id`,`scheduled_at`),
        KEY `ar_asset_manifest_file_object_id` (`asset_manifest_file_object_id`),
        KEY `ar_asset_file_file_object_id` (`asset_file_file_object_id`),
        KEY `are_user_id_fk` (`user_id`),
        KEY `are_episode_id_fk` (`episode_id`),
        KEY `are_bookmark_id_fk` (`bookmark_id`),
        KEY `asset_manifest_ibfk` (`asset_manifest_id`),
        KEY `asset_video_ibfk` (`asset_video_id`),
        KEY `ar_profile_id` (`profile_id`),
        KEY `are_channel_id_fk` (`channel_id`),
        KEY `are_program_id_fk` (`program_id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=10858855 DEFAULT CHARSET=utf8 COMMENT='profile asset recordings' |
       
       
      MariaDB [backend]> ALTER TABLE actual_recording ADD COLUMN IF NOT EXISTS broadcast_start_at datetime NULL;
      ERROR 1062 (23000): Duplicate entry '3207644-49-1335273' for key 'are_profile_channel_episode'
      

      Resolv a problem in add ALGORITHM=COPY

      MariaDB [backend]> ALTER TABLE actual_recording ADD COLUMN IF NOT EXISTS broadcast_end_at datetime NULL, ALGORITHM=COPY;
      Query OK, 8858320 rows affected (7 min 1.54 sec)
      Records: 8858320  Duplicates: 0  Warnings: 0
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              mysolo Thierry Laurier
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: