ALTER TABLE ... ALGORITHM=INPLACE fails for table which is no longer encrypted

Description

This but is the root cause of https://perconadev.atlassian.net/browse/PXC-4277

Steps to reproduce:

create database test;
use test;

CREATE TABLESPACE tab_enc ADD DATAFILE 'tab_enc.ibd' ENCRYPTION='Y';
CREATE TABLE t1 (i INT primary key) ENCRYPTION='Y' TABLESPACE=tab_enc;
ALTER TABLESPACE tab_enc ENCRYPTION 'N';
ALTER TABLE t1 RENAME COLUMN i TO i_rename, ALGORITHM=INPLACE;

Current result:

The last query fails with error 1846. ALGORITHM=INPLACE is not supported. Reason: Cannot alter encryption attribute by in place algorithm.. Try ALGORITHM=COPY

Expected result:

It is expected that the query will succeed. Prior ALTER TABLESPACE .. ENCRYPTION=N rebuilt the table, so it is no longer encrypted.

Then ALTER TABLE … RENAME COLUMN does not affect encryption attribute of it.

The bug is not present in upstream.

Environment

None

Activity

Show:
Done

Details

Assignee

Reporter

Needs Review

Yes

Needs QA

Yes

Sprint

Affects versions

Priority

Smart Checklist

Created January 18, 2024 at 11:16 AM
Updated April 8, 2024 at 12:20 PM
Resolved April 8, 2024 at 12:20 PM