mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
moved all partition create table error tests to one test for easier maintenance
This commit is contained in:
@ -123,170 +123,6 @@ partition by range (a)
|
||||
(partition x1 values less than (1));
|
||||
|
||||
drop table t1;
|
||||
#
|
||||
# Partition by range, no partition => error
|
||||
#
|
||||
--error 1441
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a);
|
||||
|
||||
#
|
||||
# Partition by range, invalid field in function
|
||||
#
|
||||
--error 1054
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a+d)
|
||||
partitions 2
|
||||
(partition x1 values less than (4) tablespace ts1,
|
||||
partition x2 values less than (8) tablespace ts2);
|
||||
|
||||
#
|
||||
# Partition by range, inconsistent partition function and constants
|
||||
#
|
||||
--error 1443
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a)
|
||||
partitions 2
|
||||
(partition x1 values less than (4.0) tablespace ts1,
|
||||
partition x2 values less than (8) tablespace ts2);
|
||||
|
||||
#
|
||||
# Partition by range, constant partition function not allowed
|
||||
#
|
||||
--error 1435
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (3+4)
|
||||
partitions 2
|
||||
(partition x1 values less than (4) tablespace ts1,
|
||||
partition x2 values less than (8) tablespace ts2);
|
||||
|
||||
#
|
||||
# Partition by range, no values less than definition
|
||||
#
|
||||
--error 1429
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a)
|
||||
partitions 2
|
||||
(partition x1 values less than (4),
|
||||
partition x2);
|
||||
|
||||
#
|
||||
# Partition by range, no values in definition allowed
|
||||
#
|
||||
--error 1430
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4),
|
||||
partition x2);
|
||||
|
||||
#
|
||||
# Partition by range, values in error
|
||||
#
|
||||
--error 1430
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4),
|
||||
partition x2 values less than (5));
|
||||
|
||||
#
|
||||
# Partition by range, missing parenthesis
|
||||
#
|
||||
--error 1064
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values less than 4,
|
||||
partition x2 values less than (5));
|
||||
|
||||
#
|
||||
# Partition by range, maxvalue in wrong place
|
||||
#
|
||||
--error 1064
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a)
|
||||
partitions 2
|
||||
(partition x1 values less than maxvalue,
|
||||
partition x2 values less than (5));
|
||||
|
||||
#
|
||||
# Partition by range, maxvalue in several places
|
||||
#
|
||||
--error 1064
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a)
|
||||
partitions 2
|
||||
(partition x1 values less than maxvalue,
|
||||
partition x2 values less than maxvalue);
|
||||
|
||||
#
|
||||
# Partition by range, not increasing ranges
|
||||
#
|
||||
--error 1442
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (a)
|
||||
partitions 2
|
||||
(partition x1 values less than (4),
|
||||
partition x2 values less than (3));
|
||||
|
||||
#
|
||||
# Partition by range, wrong result type of partition function
|
||||
#
|
||||
--error 1440
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by range (sin(a))
|
||||
partitions 2
|
||||
(partition x1 values less than (4),
|
||||
partition x2 values less than (5));
|
||||
|
||||
#
|
||||
# Subpartition by hash, two partitions and two subpartitions
|
||||
@ -519,42 +355,3 @@ subpartition by hash (a+b)
|
||||
SELECT * from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Subpartition with range => error
|
||||
#
|
||||
--error 1429
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key (a,b))
|
||||
partition by range (a+b)
|
||||
subpartition by key (a)
|
||||
( partition x1
|
||||
( subpartition x11 engine myisam,
|
||||
subpartition x12 engine myisam),
|
||||
partition x2
|
||||
( subpartition x21 engine myisam,
|
||||
subpartition x22 engine myisam)
|
||||
);
|
||||
|
||||
#
|
||||
# Subpartition with range => error
|
||||
#
|
||||
--error 1064
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key (a,b))
|
||||
partition by key (a)
|
||||
subpartition by range (a+b)
|
||||
( partition x1
|
||||
( subpartition x11 engine myisam values less than (0),
|
||||
subpartition x12 engine myisam values less than (1)),
|
||||
partition x2
|
||||
( subpartition x21 engine myisam values less than (0),
|
||||
subpartition x22 engine myisam values less than (1))
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user