| 1 |
# |
| 2 |
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine |
| 3 |
# |
| 4 |
CREATE TABLE t1 (i INT) ENGINE=MyISAM PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));; |
| 5 |
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
| 6 |
ALTER TABLE t1 DROP PARTITION p1; |
| 7 |
SELECT * FROM t1; |
| 8 |
i |
| 9 |
DROP TABLE t1; |
| 10 |
# |
| 11 |
# MDEV-13788 Server crash when issuing bad SQL partition syntax |
| 12 |
# |
| 13 |
CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE)); |
| 14 |
SHOW CREATE TABLE t1; |
| 15 |
Table Create Table |
| 16 |
t1 CREATE TABLE `t1` ( |
| 17 |
`id` int(11) DEFAULT NULL, |
| 18 |
`d` date DEFAULT NULL |
| 19 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 20 |
PARTITION BY RANGE COLUMNS(`d`) |
| 21 |
(PARTITION `p1` VALUES LESS THAN (MAXVALUE) ENGINE = MyISAM) |
| 22 |
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO |
| 23 |
( |
| 24 |
PARTITION p2, /* Notice no values */ |
| 25 |
PARTITION p3 VALUES LESS THAN (MAXVALUE) |
| 26 |
); |
| 27 |
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition |
| 28 |
DROP TABLE t1; |
| 29 |
CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3)); |
| 30 |
SHOW CREATE TABLE t1; |
| 31 |
Table Create Table |
| 32 |
t1 CREATE TABLE `t1` ( |
| 33 |
`id` int(11) DEFAULT NULL, |
| 34 |
`d` date DEFAULT NULL |
| 35 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 36 |
PARTITION BY LIST (`id`) |
| 37 |
(PARTITION `p1` VALUES IN (1,2,3) ENGINE = MyISAM) |
| 38 |
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO |
| 39 |
( |
| 40 |
PARTITION p2, /* Notice no values */ |
| 41 |
PARTITION p3 VALUES IN (4,5,6) |
| 42 |
); |
| 43 |
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition |
| 44 |
DROP TABLE t1; |
| 45 |
# |
| 46 |
# MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION |
| 47 |
# |
| 48 |
create table t1 (i int) engine=MyISAM partition by range(i) (partition p0 values less than (10)); |
| 49 |
lock table t1 write; |
| 50 |
alter table t1 add partition (partition p0 values less than (20)); |
| 51 |
ERROR HY000: Duplicate partition name p0 |
| 52 |
alter table t1 add partition (partition p1 values less than (20)) /* comment */; |
| 53 |
drop table t1; |
| 54 |
# |
| 55 |
# MDEV-27065 Partitioning tables with custom data directories moves data back to default directory |
| 56 |
# |
| 57 |
ALTER TABLE t1 PARTITION BY RANGE(id)( |
| 58 |
PARTITION p0 VALUES LESS THAN (1000), |
| 59 |
PARTITION p1 VALUES LESS THAN MAXVALUE |
| 60 |
); |
| 61 |
Warnings: |
| 62 |
Warning 1618 <DATA DIRECTORY> table option of old schema is ignored |
| 63 |
DROP TABLE t1; |
| 64 |
ALTER TABLE t2 PARTITION BY RANGE(id)( |
| 65 |
PARTITION p0 VALUES LESS THAN (1000), |
| 66 |
PARTITION p1 VALUES LESS THAN MAXVALUE |
| 67 |
); |
| 68 |
Warnings: |
| 69 |
Warning 1618 <INDEX DIRECTORY> table option of old schema is ignored |
| 70 |
DROP TABLE t2; |
| 71 |
# |
| 72 |
# MDEV-26127 Assertion `err != DB_DUPLICATE_KEY' failed or InnoDB: Failing assertion: id != 0 on ALTER ... REBUILD PARTITION |
| 73 |
# |
| 74 |
CREATE TABLE t1 (c INT) ENGINE=MyISAM PARTITION BY KEY(c) PARTITIONS 4;; |
| 75 |
LOCK TABLES t1 WRITE, t1 AS a READ; |
| 76 |
ALTER TABLE t1 REBUILD PARTITION p0; |
| 77 |
DROP TABLE t1; |
| 78 |
create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1 |
| 79 |
partition by key(c1) ( |
| 80 |
partition p01 data directory = 'MYSQL_TMP_DIR' |
| 81 |
index directory = 'MYSQL_TMP_DIR', |
| 82 |
partition p02 data directory = 'MYSQL_TMP_DIR' |
| 83 |
index directory = 'MYSQL_TMP_DIR'); |
| 84 |
insert into t1 values (1, 1, repeat('a', 100)); |
| 85 |
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1; |
| 86 |
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1; |
| 87 |
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1; |
| 88 |
alter online table t1 delay_key_write=0; |
| 89 |
alter online table t1 delay_key_write=1; |
| 90 |
drop table t1; |
| 91 |
# |
| 92 |
# MDEV-25102 UNIQUE USING HASH error after ALTER ... DISABLE KEYS |
| 93 |
# |
| 94 |
create table t1 (i1 int primary key, i2 int, d1 date, key(i2)) |
| 95 |
partition by hash(i1) partitions 3; |
| 96 |
insert into t1 values(0, 1, '2010-10-10'); |
| 97 |
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1'; |
| 98 |
index_name comment |
| 99 |
PRIMARY |
| 100 |
i2 |
| 101 |
alter table t1 disable keys; |
| 102 |
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1'; |
| 103 |
index_name comment |
| 104 |
PRIMARY |
| 105 |
i2 disabled |
| 106 |
alter table t1 add partition (partition p4); |
| 107 |
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1'; |
| 108 |
index_name comment |
| 109 |
PRIMARY |
| 110 |
i2 disabled |
| 111 |
drop table t1; |
| 112 |
# End of 10.11 tests |