summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition_column.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/partition_column.test')
-rw-r--r--mysql-test/t/partition_column.test65
1 files changed, 53 insertions, 12 deletions
diff --git a/mysql-test/t/partition_column.test b/mysql-test/t/partition_column.test
index a0e944ceb09..d1d2d666a39 100644
--- a/mysql-test/t/partition_column.test
+++ b/mysql-test/t/partition_column.test
@@ -9,6 +9,59 @@ drop table if exists t1;
--enable_warnings
#
+# Bug#51347: assertion with show create table + partition by columns
+# on decimal column
+#
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (a DECIMAL)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0));
+
+--error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
+CREATE TABLE t1 (a BLOB)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN ("X"));
+
+--error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
+CREATE TABLE t1 (a TEXT)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN ("X"));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (a FLOAT)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0.0));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (a DOUBLE)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0.0));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (d TIMESTAMP)
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01'),
+ PARTITION p1 VALUES LESS THAN ('2040-01-01'));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (d BIT(1))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN (0),
+ PARTITION p1 VALUES LESS THAN (1));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (d ENUM("YES","NO"))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ("NO"),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (d SET("Car","MC"))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ("MC"),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+
+#
# BUG#49180, Possible to define empty intervals for column list partitioning
#
--error ER_RANGE_NOT_INCREASING_ERROR
@@ -285,18 +338,6 @@ partition by range columns(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('2040-01-01'));
---error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
-create table t1 (d timestamp)
-partition by range columns(d)
-( partition p0 values less than ('2000-01-01'),
- partition p1 values less than ('2040-01-01'));
-
---error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
-create table t1 (d bit(1))
-partition by range columns(d)
-( partition p0 values less than (0),
- partition p1 values less than (1));
-
create table t1 (a int, b int)
partition by range columns(a,b)
(partition p0 values less than (maxvalue, 10));