MySQL Forums
Forum List  »  General

Primary Key Bug with Multiples of Same Column
Posted by: John Glista
Date: May 06, 2021 12:11PM

Hello, we are running MySQL 5.7 and experiencing a strange problem. We have a table with an auto-incremented primary key column named "id". However, somehow this primary key has "accumulated" several key columns, all of which are the auto-increment "id" column. It seems as though every time we drop the primary key and re-create it, it simply adds another instance of the id field to the composite of the primary key. We cannot figure out how to reset this so that the primary key only has a single instance of the id column. This appears to be some sort of bug within MySQL. Here is a dump of the current DDL for the table:

create table if not exists package_tracking
(
tracking_id varchar(50) not null,
status_description varchar(256) null,
customer_order_number varchar(50) null,
distribution_order_number varchar(50) null,
service_description varchar(256) null,
actual_delivery_timestamp timestamp null,
actual_pickup_date timestamp null,
actual_ship_date date null,
actual_tender_date date null,
delivery_attempts int(5) null,
delivery_city varchar(100) null,
delivery_state varchar(50) null,
delivery_zip varchar(50) null,
delivery_country varchar(50) null,
event_timestamp timestamp null,
id int auto_increment,
primary key (id, id, id, id, id, id, id, id, id)
);

Has anyone seen this behavior before? And how can we "reset" this table so that the primary key only has a single instance of id?

Options: ReplyQuote


Subject
Written By
Posted
Primary Key Bug with Multiples of Same Column
May 06, 2021 12:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.