Adding new column causes duplicate PK error
Bug #1445589 reported by
monty solomon
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Invalid
|
Undecided
|
Unassigned | |||
5.6 |
Triaged
|
Wishlist
|
Unassigned | |||
5.7 |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
When trying to add a column to an InnoDB table the server reports an error about a duplicate PK.
Changed in percona-server: | |
status: | Incomplete → New |
tags: | added: upstream |
To post a comment you must log in.
mysql> alter table campaignLastTouched add column negativeLastSen dOrDropTimestam p int default null, lock=none;
ERROR 1062 (23000): Duplicate entry '72502503' for key 'PRIMARY'
mysql> select * from campaignLastTouched where db_id=72502503;
Empty set (0.00 sec)
mysql> show create table campaignLastTou ched\G ******* ******* ****** 1. row ******* ******* ******* ****** uched` ( stamp` bigint(20) NOT NULL, campaignId- appid` (`portalId` ,`campaignId` ,`appId` ), ,`negativeTimes tamp`,` campaignId` ,`appId` ) 72525403 DEFAULT CHARSET=utf8
*******
Table: campaignLastTouched
Create Table: CREATE TABLE `campaignLastTo
`db_id` bigint(20) NOT NULL AUTO_INCREMENT,
`portalId` int(10) unsigned NOT NULL,
`campaignId` bigint(20) NOT NULL,
`negativeTime
`appId` int(11) NOT NULL,
PRIMARY KEY (`db_id`),
UNIQUE KEY `portalId-
KEY `covering` (`portalId`
) ENGINE=InnoDB AUTO_INCREMENT=
1 row in set (0.00 sec)
mysql Ver 14.14 Distrib 5.6.22-71.0, for Linux (x86_64) using EditLine wrapper
Server version: 5.6.22-71.0-log Percona Server (GPL), Release 71.0, Revision 726
Linux 2.6.32- 431.el6. x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
CentOS release 6.5 (Final)