1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-34813 A simple implementation of ha_partition::compare_key_parts

It is not clear that the three Compare_key enums form a hierarchy like
alter algorithms do. So on the safe side (in case MDEV-22168 gets
implemented without looking at this code) we should return NotEqual if
partition engines do not return the same enum value. There's a static
merge function that merges these enums, but it is used to merge the
Compare_keys of different key parts (horizontally), rather than
different partitions (vertically).
This commit is contained in:
Yuchen Pei
2025-01-03 17:40:05 +11:00
parent 0301ef38b4
commit 068d061454
4 changed files with 56 additions and 0 deletions

View File

@@ -59,4 +59,18 @@ index_name comment
PRIMARY
i2 disabled
drop table t1;
#
# MDEV-34813 ALGORITHM=INSTANT does not work for partitioned tables on indexed column
#
CREATE TABLE `t1` (
`f1` datetime ,
`f2` VARCHAR(2) ,
`f3` VARCHAR(200) ,
`f4` VARCHAR(100) ,
INDEX `i3` (`f4`) )
PARTITION BY RANGE COLUMNS(`f2`)
(PARTITION `p_01` VALUES LESS THAN ('02') ENGINE = InnoDB,
PARTITION `p_31` VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB);
ALTER online TABLE t1 MODIFY COLUMN `f4` VARCHAR(500) , ALGORITHM=INSTANT, LOCK=NONE;
drop table t1;
# End of 10.5 tests

View File

@@ -52,4 +52,23 @@ alter table t1 add partition (partition p4);
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
drop table t1;
--echo #
--echo # MDEV-34813 ALGORITHM=INSTANT does not work for partitioned tables on indexed column
--echo #
--source include/have_innodb.inc
CREATE TABLE `t1` (
`f1` datetime ,
`f2` VARCHAR(2) ,
`f3` VARCHAR(200) ,
`f4` VARCHAR(100) ,
INDEX `i3` (`f4`) )
PARTITION BY RANGE COLUMNS(`f2`)
(PARTITION `p_01` VALUES LESS THAN ('02') ENGINE = InnoDB,
PARTITION `p_31` VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB);
ALTER online TABLE t1 MODIFY COLUMN `f4` VARCHAR(500) , ALGORITHM=INSTANT, LOCK=NONE;
drop table t1;
--echo # End of 10.5 tests