summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition_error.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/partition_error.test')
-rw-r--r--mysql-test/t/partition_error.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index 659f0b8cef4..d0e3f355292 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -9,6 +9,24 @@ drop table if exists t1;
--enable_warnings
#
+# Bug 20397: Partitions: Crash when using non-existing engine
+#
+create table t1 (a int)
+engine = x
+partition by key (a);
+show create table t1;
+drop table t1;
+
+create table t1 (a int)
+engine = innodb
+partition by list (a)
+(partition p0 values in (0));
+
+alter table t1 engine = x;
+show create table t1;
+drop table t1;
+
+#
# Partition by key stand-alone error
#
--error 1064
@@ -89,6 +107,8 @@ partitions 3
(partition x1 tablespace ts1,
partition x2 tablespace ts2,
partition x3 tablespace ts3);
+
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Partition by hash, invalid field in function
#
@@ -184,6 +204,7 @@ partition by hash (a)
partitions 2
(partition x1 values less than (4),
partition x2 values less than (5));
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Partition by hash, values in error
@@ -198,6 +219,7 @@ partition by hash (a)
partitions 2
(partition x1 values in (4),
partition x2 values in (5));
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Partition by hash, values in error
@@ -212,6 +234,7 @@ partition by hash (a)
partitions 2
(partition x1 values in (4,6),
partition x2 values in (5,7));
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by key, no partitions defined, single field
@@ -224,6 +247,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (b);
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by key, no partitions defined, list of fields
@@ -236,6 +260,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (a, b);
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by hash, no partitions defined
@@ -248,6 +273,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by key, no partitions defined, single field
@@ -260,6 +286,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (b);
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by key, no partitions defined, list of fields
@@ -272,6 +299,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (a, b);
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by hash, no partitions defined
@@ -284,6 +312,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -310,6 +339,7 @@ partition by key (a)
subpartition by hash (sin(a+b))
(partition x1 (subpartition x11, subpartition x12),
partition x2 (subpartition x21, subpartition x22));
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -338,6 +368,7 @@ partition by range (a)
subpartition by key (a,d)
(partition x1 values less than (1) (subpartition x11, subpartition x12),
partition x2 values less than (2) (subpartition x21, subpartition x22));
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -375,6 +406,7 @@ b int not null,
c int not null,
primary key(a,b))
partition by range (a);
+select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
#
# Partition by range, invalid field in function
@@ -748,6 +780,10 @@ CREATE TABLE t1(a int)
insert into t1 values (10);
drop table t1;
+--error ER_PARTITION_CONST_DOMAIN_ERROR
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (-1));
#
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
#
@@ -775,3 +811,5 @@ partition by range (a + (select count(*) from t1))
-- error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));
+
+