[MDEV-24690] Dropping primary key column from versioned table always fails with 1072 Created: 2021-01-26  Updated: 2021-04-01  Resolved: 2021-03-31

Status: Closed
Project: MariaDB Server
Component/s: Versioned Tables
Affects Version/s: 10.5.8, 10.3, 10.4, 10.5
Fix Version/s: 10.3.29, 10.4.19, 10.5.10

Type: Bug Priority: Major
Reporter: Remy Fox Assignee: Aleksey Midenkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-25327 Unexpected ER_DUP_ENTRY upon dropping... Closed
Relates
relates to MDEV-11114 Cannot drop column referenced by CHEC... Closed
relates to MDEV-13613 Dropping column from table that is pa... Closed

 Description   

Example code:

CREATE TABLE abc (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (b)) WITH SYSTEM VERSIONING;

We now have a table with one primary key. Dropping column 'a' is no problem, but dropping column 'b' always fails with error code 1072.

SET SESSION system_versioning_alter_history=KEEP; 
ALTER TABLE abc DROP COLUMN b;



 Comments   
Comment by Sergei Golubchik [ 2021-01-26 ]

here the row_end column is invisible, SHOW CREATE TABLE does not show it as a part of the primary key. So it should not cause the error.

Comment by Nikita Malyavin [ 2021-03-26 ]

oktopush

Generated at Thu Feb 08 09:31:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.