mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Added checks for no NULL values in VALUES LESS THAN, added tests for no MAXVALUE in VALUES IN
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by range column_list (a,b)
|
||||
(partition p0 values less than (NULL, maxvalue));
|
||||
ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
|
||||
create table t1 (a int, b int)
|
||||
partition by list column_list(a,b)
|
||||
( partition p0 values in ((maxvalue, 0)));
|
||||
Got one of the listed errors
|
||||
create table t1 (a int, b int)
|
||||
partition by key (a,a);
|
||||
ERROR HY000: Duplicate partition field name a
|
||||
create table t1 (a int, b int)
|
||||
@@ -144,17 +152,17 @@ create table t1 (a int, b char(10), c varchar(25), d datetime)
|
||||
partition by range column_list(a,b,c,d)
|
||||
subpartition by hash (to_seconds(d))
|
||||
subpartitions 4
|
||||
( partition p0 values less than (1, NULL, MAXVALUE, NULL),
|
||||
( partition p0 values less than (1, 0, MAXVALUE, 0),
|
||||
partition p1 values less than (1, 'a', MAXVALUE, TO_DAYS('1999-01-01')),
|
||||
partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
|
||||
partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
RANGE COLUMN_LIST a,b,c,d 1,NULL,MAXVALUE,NULL
|
||||
RANGE COLUMN_LIST a,b,c,d 1,NULL,MAXVALUE,NULL
|
||||
RANGE COLUMN_LIST a,b,c,d 1,NULL,MAXVALUE,NULL
|
||||
RANGE COLUMN_LIST a,b,c,d 1,NULL,MAXVALUE,NULL
|
||||
RANGE COLUMN_LIST a,b,c,d 1,0,MAXVALUE,0
|
||||
RANGE COLUMN_LIST a,b,c,d 1,0,MAXVALUE,0
|
||||
RANGE COLUMN_LIST a,b,c,d 1,0,MAXVALUE,0
|
||||
RANGE COLUMN_LIST a,b,c,d 1,0,MAXVALUE,0
|
||||
RANGE COLUMN_LIST a,b,c,d 1,'a',MAXVALUE,730120
|
||||
RANGE COLUMN_LIST a,b,c,d 1,'a',MAXVALUE,730120
|
||||
RANGE COLUMN_LIST a,b,c,d 1,'a',MAXVALUE,730120
|
||||
@@ -233,7 +241,7 @@ partition p1 values less than ('2040-01-01'));
|
||||
ERROR HY000: Partition column values of incorrect type
|
||||
create table t1 (a int, b int)
|
||||
partition by range column_list(a,b)
|
||||
(partition p0 values less than (null, 10));
|
||||
(partition p0 values less than (maxvalue, 10));
|
||||
drop table t1;
|
||||
create table t1 (d date)
|
||||
partition by range column_list(d)
|
||||
@@ -268,7 +276,7 @@ drop table t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by list column_list(a,b)
|
||||
(partition p0 values in ((maxvalue,maxvalue)));
|
||||
ERROR 42000: Cannot use MAXVALUE as value in List partitioning near 'maxvalue,maxvalue)))' at line 3
|
||||
ERROR 42000: Cannot use MAXVALUE as value in VALUES IN near 'maxvalue,maxvalue)))' at line 3
|
||||
create table t1 (a int, b int)
|
||||
partition by range column_list(a,b)
|
||||
(partition p0 values less than (maxvalue,maxvalue));
|
||||
@@ -309,11 +317,11 @@ partition by range column_list(a,b)
|
||||
ERROR HY000: Inconsistency in usage of column lists for partitioning
|
||||
create table t1 (a int, b int)
|
||||
partition by range column_list(a,b)
|
||||
(partition p0 values less than (1, NULL),
|
||||
(partition p0 values less than (1, 0),
|
||||
partition p1 values less than (2, maxvalue),
|
||||
partition p2 values less than (3, 3),
|
||||
partition p3 values less than (10, NULL));
|
||||
insert into t1 values (10,0);
|
||||
partition p3 values less than (10, maxvalue));
|
||||
insert into t1 values (11,0);
|
||||
ERROR HY000: Table has no partition for value from column_list
|
||||
insert into t1 values (0,1),(1,1),(2,1),(3,1),(3,4),(4,9),(9,1);
|
||||
select * from t1;
|
||||
|
@@ -8,6 +8,16 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
--error ER_NULL_IN_VALUES_LESS_THAN
|
||||
create table t1 (a int, b int)
|
||||
partition by range column_list (a,b)
|
||||
(partition p0 values less than (NULL, maxvalue));
|
||||
|
||||
--error ER_MAXVALUE_IN_VALUES_IN, ER_PARSE_ERROR
|
||||
create table t1 (a int, b int)
|
||||
partition by list column_list(a,b)
|
||||
( partition p0 values in ((maxvalue, 0)));
|
||||
|
||||
#
|
||||
# BUG#47837, Crash when two same fields in column list processing
|
||||
#
|
||||
@@ -115,7 +125,7 @@ create table t1 (a int, b char(10), c varchar(25), d datetime)
|
||||
partition by range column_list(a,b,c,d)
|
||||
subpartition by hash (to_seconds(d))
|
||||
subpartitions 4
|
||||
( partition p0 values less than (1, NULL, MAXVALUE, NULL),
|
||||
( partition p0 values less than (1, 0, MAXVALUE, 0),
|
||||
partition p1 values less than (1, 'a', MAXVALUE, TO_DAYS('1999-01-01')),
|
||||
partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
|
||||
partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
|
||||
@@ -168,7 +178,7 @@ partition by range column_list(d)
|
||||
|
||||
create table t1 (a int, b int)
|
||||
partition by range column_list(a,b)
|
||||
(partition p0 values less than (null, 10));
|
||||
(partition p0 values less than (maxvalue, 10));
|
||||
drop table t1;
|
||||
|
||||
create table t1 (d date)
|
||||
@@ -250,13 +260,13 @@ partition by range column_list(a,b)
|
||||
|
||||
create table t1 (a int, b int)
|
||||
partition by range column_list(a,b)
|
||||
(partition p0 values less than (1, NULL),
|
||||
(partition p0 values less than (1, 0),
|
||||
partition p1 values less than (2, maxvalue),
|
||||
partition p2 values less than (3, 3),
|
||||
partition p3 values less than (10, NULL));
|
||||
partition p3 values less than (10, maxvalue));
|
||||
|
||||
-- error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
||||
insert into t1 values (10,0);
|
||||
insert into t1 values (11,0);
|
||||
insert into t1 values (0,1),(1,1),(2,1),(3,1),(3,4),(4,9),(9,1);
|
||||
select * from t1;
|
||||
|
||||
|
Reference in New Issue
Block a user