summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts/r/partition_alter_maria.result
blob: 7d923570cfe4f4ea6b01e573161c82f612da8ebe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
create table t1 (
pk bigint not null auto_increment,
dt datetime default null,
unique (pk, dt)
) engine=aria row_format=dynamic
partition by range  columns(dt) (
partition `p20171231` values less than ('2017-12-31'),
partition `p20181231` values less than ('2018-12-31')
);
insert into t1 values (1,'2017-09-28 15:12:00');
select * from t1;
pk	dt
1	2017-09-28 15:12:00
alter table t1 drop partition p20181231;
select * from t1;
pk	dt
1	2017-09-28 15:12:00
drop table t1;
create table t1 (a int) engine=Aria transactional=1 partition by hash(a) partitions 2;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 TRANSACTIONAL=1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 2 */
drop table t1;
#
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
#
CREATE TABLE t1 (i INT) ENGINE=Aria PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1),  PARTITION p1 VALUES IN (2));;
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DROP PARTITION p1;
SELECT * FROM t1;
i
DROP TABLE t1;
#
# MDEV-13788 Server crash when issuing bad SQL partition syntax
#
CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` int(11) DEFAULT NULL,
  `d` date DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE  COLUMNS(d)
(PARTITION p1 VALUES LESS THAN (MAXVALUE) ENGINE = Aria) */
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES LESS THAN (MAXVALUE)
);
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
DROP TABLE t1;
CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` int(11) DEFAULT NULL,
  `d` date DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (id)
(PARTITION p1 VALUES IN (1,2,3) ENGINE = Aria) */
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;