mirror of
https://github.com/MariaDB/server.git
synced 2025-04-08 08:15:33 +02:00

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).
74 lines
2.6 KiB
Text
74 lines
2.6 KiB
Text
#
|
|
# General bugs with ALTER TABLE and partitions that doesn't have to be run
|
|
# on all engines
|
|
#
|
|
|
|
--source include/have_partition.inc
|
|
|
|
--echo #
|
|
--echo # MDEV-22649 SIGSEGV in ha_partition::create_partitioning_metadata on ALTER
|
|
--echo #
|
|
|
|
set @save_alter_algorithm= @@session.alter_algorithm;
|
|
SET SESSION alter_algorithm=4;
|
|
CREATE TABLE t1(a INT) engine=myisam PARTITION BY RANGE(a) SUBPARTITION BY KEY(a) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0,SUBPARTITION s1), PARTITION p1 VALUES LESS THAN (20) (SUBPARTITION s2,SUBPARTITION s3));
|
|
show create table t1;
|
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
|
ALTER TABLE t1 ADD COLUMN c INT;
|
|
DROP table if exists t1;
|
|
set @@session.alter_algorithm= @save_alter_algorithm;
|
|
|
|
|
|
--echo #
|
|
--echo # MDEV-22804 SIGSEGV in ha_partition::create_partitioning_metadata |
|
|
--echo # ERROR 1507 (HY000): Error in list of partitions to DROP
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (a INT) PARTITION BY RANGE(a) SUBPARTITION BY HASH(a) (PARTITION p VALUES LESS THAN (5) (SUBPARTITION sp, SUBPARTITION sp1), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION sp2, SUBPARTITION sp3));
|
|
ALTER TABLE t1 DROP PARTITION p;
|
|
DROP TABLE if exists t1;
|
|
|
|
--echo #
|
|
--echo # MDEV-23357 Server crashes in Sql_cmd_alter_table_exchange_partition::exchange_partition
|
|
--echo #
|
|
CREATE TABLE t1 (i INT);
|
|
CREATE VIEW v1 as SELECT * FROM t1;
|
|
CREATE TABLE t2 (i INT);
|
|
--error ER_CHECK_NO_SUCH_TABLE
|
|
ALTER TABLE v1 EXCHANGE PARTITION p2 WITH TABLE t2 ;
|
|
DROP VIEW v1;
|
|
DROP TABLE t1, t2;
|
|
|
|
--echo #
|
|
--echo # MDEV-25102 UNIQUE USING HASH error after ALTER ... DISABLE KEYS
|
|
--echo #
|
|
create table t1 (i1 int primary key, i2 int, d1 date, key(i2))
|
|
partition by hash(i1) partitions 3;
|
|
insert into t1 values(0, 1, '2010-10-10');
|
|
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
|
|
alter table t1 disable keys;
|
|
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
|
|
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
|