1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-28576 RENAME COLUMN with NOCOPY algorithm leads to corrupt partitioned table

When f.ex. table is partitioned by HASH(a) and we rename column `a' to
`b' partitioning filter stays unchanged: HASH(a). That's the wrong
behavior.

The patch updates partitioning filter in accordance to the new columns
names. That includes partition/subpartition expression and
partition/subpartition field list.
This commit is contained in:
Aleksey Midenkov
2022-10-05 17:46:51 +03:00
parent 4eb8c35b36
commit 0779e2cb10
3 changed files with 69 additions and 0 deletions

View File

@ -185,4 +185,15 @@ select * from t1 partition(p1);
delete from t1;
drop table t1;
--echo #
--echo # MDEV-28576 RENAME COLUMN with NOCOPY algorithm leads to corrupt partitioned table
--echo #
create table t (a int, b int) partition by list (b) (partition p1 values in (1, 2));
insert into t values (0, 1), (2, 2);
alter table t change b f int, change a b int, algorithm=nocopy;
check table t;
delete from t order by b limit 1;
# cleanup
drop table t;
--echo # End of 10.3 tests