[MDEV-28942] Online alter does not support ORDER BY Created: 2022-06-24  Updated: 2023-04-02  Resolved: 2022-06-29

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-16329 Engine-independent online ALTER TABLE Closed
relates to MDEV-28808 Test MDEV-16329 (ALTER ONLINE TABLE) ... Stalled

 Description   

create table t (f int);
alter online table t order by f;
 
# Cleanup
drop table t;

bb-10.10-MDEV-16329 cb1f08bd

mysqltest: At line 2: query 'alter online table t order by f' failed: ER_ALTER_OPERATION_NOT_SUPPORTED_REASON (1846): LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED

If it's expected, it needs to be documented, I didn't find it so far.



 Comments   
Comment by Sergei Golubchik [ 2022-06-29 ]

This is, of course, intentional. Online ALTER works by remembering all changes done to the original table while it's being converted and applying them later in a catch-up step. The total row ordering cannot be guaranteed in this case.

Generated at Thu Feb 08 10:04:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.