Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
caa4fffa
Commit
caa4fffa
authored
Oct 29, 2009
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed COLUMN_LIST to COLUMNS after arch review
parent
53dc58d8
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
139 additions
and
141 deletions
+139
-141
mysql-test/r/partition_column.result
mysql-test/r/partition_column.result
+81
-81
mysql-test/r/partition_column_prune.result
mysql-test/r/partition_column_prune.result
+3
-3
mysql-test/r/partition_innodb.result
mysql-test/r/partition_innodb.result
+3
-3
mysql-test/r/partition_range.result
mysql-test/r/partition_range.result
+2
-2
mysql-test/t/partition_column.test
mysql-test/t/partition_column.test
+37
-37
mysql-test/t/partition_column_prune.test
mysql-test/t/partition_column_prune.test
+3
-3
mysql-test/t/partition_innodb.test
mysql-test/t/partition_innodb.test
+3
-3
mysql-test/t/partition_range.test
mysql-test/t/partition_range.test
+2
-2
sql/lex.h
sql/lex.h
+0
-1
sql/opt_range.cc
sql/opt_range.cc
+1
-1
sql/sql_partition.cc
sql/sql_partition.cc
+3
-3
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-2
No files found.
mysql-test/r/partition_column.result
View file @
caa4fffa
drop table if exists t1;
create table t1 (a varchar(1500), b varchar(1570))
partition by list column
_list
(a,b)
partition by list column
s
(a,b)
( partition p0 values in (('a','b')));
ERROR HY000: The total length of the partitioning fields is too large
create table t1 (a varchar(1023) character set utf8 collate utf8_spanish2_ci)
partition by range column
_list
(a)
partition by range column
s
(a)
( partition p0 values less than ('CZ'),
partition p1 values less than ('CH'),
partition p2 values less than ('D'));
...
...
@@ -16,16 +16,16 @@ cg
drop table t1;
set @@sql_mode=allow_invalid_dates;
create table t1 (a char, b char, c date)
partition by range column
_list
(a,b,c)
partition by range column
s
(a,b,c)
( partition p0 values less than (0,0,to_days('3000-11-31')));
ERROR HY000: Partition column values of incorrect type
create table t1 (a char, b char, c date)
partition by range column
_list
(a,b,c)
partition by range column
s
(a,b,c)
( partition p0 values less than (0,0,'3000-11-31'));
ERROR HY000: Partition column values of incorrect type
set @@sql_mode='';
create table t1 (a varchar(2) character set ucs2)
partition by list column
_list
(a)
partition by list column
s
(a)
(partition p0 values in (0x2020),
partition p1 values in (''));
show create table t1;
...
...
@@ -33,14 +33,14 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMN
_LIST
(a)
/*!50100 PARTITION BY LIST COLUMN
S
(a)
(PARTITION p0 VALUES IN (_ucs2' ') ENGINE = MyISAM,
PARTITION p1 VALUES IN (_ucs2'') ENGINE = MyISAM) */
insert into t1 values ('');
insert into t1 values (_ucs2 0x2020);
drop table t1;
create table t1 (a int, b char(10), c varchar(25), d datetime)
partition by range column
_list
(a,b,c,d)
partition by range column
s
(a,b,c,d)
subpartition by hash (to_seconds(d))
subpartitions 4
( partition p0 values less than (1, 0, MAXVALUE, '1900-01-01'),
...
...
@@ -50,22 +50,22 @@ 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,'0',MAXVALUE,'1900-01-01'
RANGE COLUMN
_LIST
a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
RANGE COLUMN
_LIST
a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
RANGE COLUMN
_LIST
a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
RANGE COLUMN
_LIST
a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMN
_LIST
a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMN
_LIST
a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMN
_LIST
a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMN
_LIST
a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMN
_LIST
a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMN
_LIST
a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMN
_LIST
a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMN
_LIST
a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMN
_LIST
a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMN
_LIST
a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMN
_LIST
a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMN
S
a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
RANGE COLUMN
S
a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
RANGE COLUMN
S
a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
RANGE COLUMN
S
a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
RANGE COLUMN
S
a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMN
S
a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMN
S
a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMN
S
a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMN
S
a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMN
S
a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMN
S
a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMN
S
a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMN
S
a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMN
S
a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMN
S
a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMN
S
a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
@@ -74,7 +74,7 @@ t1 CREATE TABLE `t1` (
`c` varchar(25) DEFAULT NULL,
`d` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE COLUMN
_LIST
(a,b,c,d)
/*!50100 PARTITION BY RANGE COLUMN
S
(a,b,c,d)
SUBPARTITION BY HASH (to_seconds(d))
SUBPARTITIONS 4
(PARTITION p0 VALUES LESS THAN (1,_latin1'0',MAXVALUE,'1900-01-01') ENGINE = MyISAM,
...
...
@@ -83,15 +83,15 @@ SUBPARTITIONS 4
PARTITION p3 VALUES LESS THAN (1,MAXVALUE,MAXVALUE,MAXVALUE) ENGINE = MyISAM) */
drop table t1;
create table t1 (a int, b int)
partition by range column
_list
(a,b)
partition by range column
s
(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 by list column
s
(a,b)
( partition p0 values in ((maxvalue, 0)));
Got one of the listed errors
create table t1 (a int, b int)
partition by list column
_list
(a,b)
partition by list column
s
(a,b)
( partition p0 values in ((0,0)));
alter table t1 add partition
(partition p1 values in (maxvalue, maxvalue));
...
...
@@ -101,7 +101,7 @@ 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)
partition by list column
_list
(a,a)
partition by list column
s
(a,a)
( partition p values in ((1,1)));
ERROR HY000: Duplicate partition field name 'a'
create table t1 (a int signed)
...
...
@@ -123,7 +123,7 @@ a
0
drop table t1;
create table t1 (a int signed)
partition by list column
_list
(a)
partition by list column
s
(a)
( partition p0 values in (1, 3, 5, 7, 9, NULL),
partition p1 values in (2, 4, 6, 8, 0));
insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8);
...
...
@@ -141,23 +141,23 @@ a
0
drop table t1;
create table t1 (a int, b int)
partition by list column
_list
(a,b)
partition by list column
s
(a,b)
( partition p0 values in ((1, NULL), (2, NULL), (NULL, NULL)),
partition p1 values in ((1,1), (2,2)),
partition p2 values in ((3, NULL), (NULL, 1)));
select partition_method, partition_expression, partition_description
from information_schema.partitions where table_name = "t1";
partition_method partition_expression partition_description
LIST COLUMN
_LIST
a,b (1,NULL),(2,NULL),(NULL,NULL)
LIST COLUMN
_LIST
a,b (1,1),(2,2)
LIST COLUMN
_LIST
a,b (3,NULL),(NULL,1)
LIST COLUMN
S
a,b (1,NULL),(2,NULL),(NULL,NULL)
LIST COLUMN
S
a,b (1,1),(2,2)
LIST COLUMN
S
a,b (3,NULL),(NULL,1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMN
_LIST
(a,b)
/*!50100 PARTITION BY LIST COLUMN
S
(a,b)
(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
...
...
@@ -191,7 +191,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMN
_LIST
(a,b)
/*!50100 PARTITION BY LIST COLUMN
S
(a,b)
(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
...
...
@@ -227,25 +227,25 @@ insert into t1 values (5);
ERROR HY000: Table has no partition for value 5
drop table t1;
create table t1 (a int)
partition by list column
_list
(a)
partition by list column
s
(a)
( partition p0 values in (2, 1),
partition p1 values in ((4), (NULL), (3)));
ERROR 42000: Row expressions in VALUES IN only allowed for multi-field column partitioning near '))' at line 4
create table t1 (a int)
partition by list column
_list
(a)
partition by list column
s
(a)
( partition p0 values in (2, 1),
partition p1 values in (4, NULL, 3));
select partition_method, partition_expression, partition_description
from information_schema.partitions where table_name = "t1";
partition_method partition_expression partition_description
LIST COLUMN
_LIST
a 2,1
LIST COLUMN
_LIST
a 4,NULL,3
LIST COLUMN
S
a 2,1
LIST COLUMN
S
a 4,NULL,3
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMN
_LIST
(a)
/*!50100 PARTITION BY LIST COLUMN
S
(a)
(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
insert into t1 values (1);
...
...
@@ -260,12 +260,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMN
_LIST
(a)
/*!50100 PARTITION BY LIST COLUMN
S
(a)
(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
drop table t1;
create table t1 (a int, b char(10), c varchar(5), d int)
partition by range column
_list
(a,b,c)
partition by range column
s
(a,b,c)
subpartition by key (c,d)
subpartitions 3
( partition p0 values less than (1,'abc','abc'),
...
...
@@ -275,18 +275,18 @@ partition p3 values less than (4,'abc','abc'));
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 1,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 1,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 1,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 2,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 2,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 2,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 3,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 3,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 3,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 4,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 4,'abc','abc'
RANGE COLUMN
_LIST
a,b,c 4,'abc','abc'
RANGE COLUMN
S
a,b,c 1,'abc','abc'
RANGE COLUMN
S
a,b,c 1,'abc','abc'
RANGE COLUMN
S
a,b,c 1,'abc','abc'
RANGE COLUMN
S
a,b,c 2,'abc','abc'
RANGE COLUMN
S
a,b,c 2,'abc','abc'
RANGE COLUMN
S
a,b,c 2,'abc','abc'
RANGE COLUMN
S
a,b,c 3,'abc','abc'
RANGE COLUMN
S
a,b,c 3,'abc','abc'
RANGE COLUMN
S
a,b,c 3,'abc','abc'
RANGE COLUMN
S
a,b,c 4,'abc','abc'
RANGE COLUMN
S
a,b,c 4,'abc','abc'
RANGE COLUMN
S
a,b,c 4,'abc','abc'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
@@ -295,7 +295,7 @@ t1 CREATE TABLE `t1` (
`c` varchar(5) DEFAULT NULL,
`d` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE COLUMN
_LIST
(a,b,c)
/*!50100 PARTITION BY RANGE COLUMN
S
(a,b,c)
SUBPARTITION BY KEY (c,d)
SUBPARTITIONS 3
(PARTITION p0 VALUES LESS THAN (1,_latin1'abc',_latin1'abc') ENGINE = MyISAM,
...
...
@@ -313,14 +313,14 @@ a b c d
1 b c 1
drop table t1;
create table t1 (a int, b varchar(2), c int)
partition by range column
_list
(a, b, c)
partition by range column
s
(a, b, c)
(partition p0 values less than (1, 'A', 1),
partition p1 values less than (1, 'B', 1));
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 1,'A',1
RANGE COLUMN
_LIST
a,b,c 1,'B',1
RANGE COLUMN
S
a,b,c 1,'A',1
RANGE COLUMN
S
a,b,c 1,'B',1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
@@ -328,7 +328,7 @@ t1 CREATE TABLE `t1` (
`b` varchar(2) DEFAULT NULL,
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE COLUMN
_LIST
(a,b,c)
/*!50100 PARTITION BY RANGE COLUMN
S
(a,b,c)
(PARTITION p0 VALUES LESS THAN (1,_latin1'A',1) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (1,_latin1'B',1) ENGINE = MyISAM) */
insert into t1 values (1, 'A', 1);
...
...
@@ -340,7 +340,7 @@ a b c
1 A 1
drop table t1;
create table t1 (a char, b char, c char)
partition by list column
_list
(a)
partition by list column
s
(a)
( partition p0 values in ('a'));
insert into t1 (a) values ('a');
select * from t1 where a = 'a';
...
...
@@ -348,41 +348,41 @@ a b c
a NULL NULL
drop table t1;
create table t1 (d time)
partition by range column
_list
(d)
partition by range column
s
(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('2040-01-01'));
ERROR HY000: Partition column values of incorrect type
create table t1 (d timestamp)
partition by range column
_list
(d)
partition by range column
s
(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('2040-01-01'));
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
create table t1 (d bit(1))
partition by range column
_list
(d)
partition by range column
s
(d)
( partition p0 values less than (0),
partition p1 values less than (1));
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
create table t1 (a int, b int)
partition by range column
_list
(a,b)
partition by range column
s
(a,b)
(partition p0 values less than (maxvalue, 10));
drop table t1;
create table t1 (d date)
partition by range column
_list
(d)
partition by range column
s
(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('2009-01-01'));
drop table t1;
create table t1 (d date)
partition by range column
_list
(d)
partition by range column
s
(d)
( partition p0 values less than ('1999-01-01'),
partition p1 values less than ('2000-01-01'));
drop table t1;
create table t1 (d date)
partition by range column
_list
(d)
partition by range column
s
(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('3000-01-01'));
drop table t1;
create table t1 (a int, b int)
partition by range column
_list
(a,b)
partition by range column
s
(a,b)
(partition p2 values less than (99,99),
partition p1 values less than (99,999));
insert into t1 values (99,998);
...
...
@@ -397,22 +397,22 @@ data_type
int
drop table t1;
create table t1 (a int, b int)
partition by list column
_list
(a,b)
partition by list column
s
(a,b)
(partition p0 values in ((maxvalue,maxvalue)));
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 by range column
s
(a,b)
(partition p0 values less than (maxvalue,maxvalue));
drop table t1;
create table t1 (a int)
partition by list column
_list
(a)
partition by list column
s
(a)
(partition p0 values in (0));
select partition_method from information_schema.partitions where table_name='t1';
partition_method
LIST COLUMN
_LIST
LIST COLUMN
S
drop table t1;
create table t1 (a char(6))
partition by range column
_list
(a)
partition by range column
s
(a)
(partition p0 values less than ('H23456'),
partition p1 values less than ('M23456'));
insert into t1 values ('F23456');
...
...
@@ -421,25 +421,25 @@ a
F23456
drop table t1;
create table t1 (a char(6))
partition by range column
_list
(a)
partition by range column
s
(a)
(partition p0 values less than (H23456),
partition p1 values less than (M23456));
ERROR 42S22: Unknown column 'H23456' in 'field list'
create table t1 (a char(6))
partition by range column
_list
(a)
partition by range column
s
(a)
(partition p0 values less than (23456),
partition p1 values less than (23456));
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
create table t1 (a int, b int)
partition by range column
_list
(a,b)
partition by range column
s
(a,b)
(partition p0 values less than (10));
ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3
create table t1 (a int, b int)
partition by range column
_list
(a,b)
partition by range column
s
(a,b)
(partition p0 values less than (1,1,1);
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 by range column
s
(a,b)
(partition p0 values less than (1, 0),
partition p1 values less than (2, maxvalue),
partition p2 values less than (3, 3),
...
...
@@ -457,7 +457,7 @@ a b
4 9
9 1
alter table t1
partition by range column
_list
(b,a)
partition by range column
s
(b,a)
(partition p0 values less than (1,2),
partition p1 values less than (3,3),
partition p2 values less than (9,5));
...
...
@@ -509,7 +509,7 @@ a b
9 1
drop table t1;
create table t1 (a int, b int)
partition by list column
_list
(a,b)
partition by list column
s
(a,b)
subpartition by hash (b)
subpartitions 2
(partition p0 values in ((0,0), (1,1)),
...
...
@@ -517,7 +517,7 @@ partition p1 values in ((1000,1000)));
insert into t1 values (1000,1000);
drop table t1;
create table t1 (a char, b char, c char)
partition by range column
_list
(a,b,c)
partition by range column
s
(a,b,c)
( partition p0 values less than ('a','b','c'));
alter table t1 add partition
(partition p1 values less than ('b','c','d'));
...
...
mysql-test/r/partition_column_prune.result
View file @
caa4fffa
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
create table t1 (a char, b char, c char)
partition by range column
_list
(a,b,c)
partition by range column
s
(a,b,c)
( partition p0 values less than ('a','b','c'));
insert into t1 values ('a', NULL, 'd');
explain partitions select * from t1 where a = 'a' AND c = 'd';
...
...
@@ -10,7 +10,7 @@ select * from t1 where a = 'a' AND c = 'd';
a b c
a NULL d
drop table t1;
create table t1 (a int not null) partition by range column
_list
(a) (
create table t1 (a int not null) partition by range column
s
(a) (
partition p0 values less than (10),
partition p1 values less than (20),
partition p2 values less than (30),
...
...
@@ -40,7 +40,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 4 Using where
drop table t1, t2;
create table t1 (a int not null, b int not null )
partition by range column
_list
(a,b) (
partition by range column
s
(a,b) (
partition p01 values less than (2,10),
partition p02 values less than (2,20),
partition p03 values less than (2,30),
...
...
mysql-test/r/partition_innodb.result
View file @
caa4fffa
drop table if exists t1;
create table t1 (a varchar(5))
engine=memory
partition by range column
_list
(a)
partition by range column
s
(a)
( partition p0 values less than ('m'),
partition p1 values less than ('za'));
insert into t1 values ('j');
...
...
@@ -9,7 +9,7 @@ update t1 set a = 'z' where (a >= 'j');
drop table t1;
create table t1 (a varchar(5))
engine=myisam
partition by range column
_list
(a)
partition by range column
s
(a)
( partition p0 values less than ('m'),
partition p1 values less than ('za'));
insert into t1 values ('j');
...
...
@@ -17,7 +17,7 @@ update t1 set a = 'z' where (a >= 'j');
drop table t1;
create table t1 (a varchar(5))
engine=innodb
partition by range column
_list
(a)
partition by range column
s
(a)
( partition p0 values less than ('m'),
partition p1 values less than ('za'));
insert into t1 values ('j');
...
...
mysql-test/r/partition_range.result
View file @
caa4fffa
...
...
@@ -77,7 +77,7 @@ a
2004-01-01 11:59:29
drop table t1;
create table t1 (a int, b char(20))
partition by range column
_list
(a,b)
partition by range column
s
(a,b)
(partition p0 values less than (1));
ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3
create table t1 (a int, b char(20))
...
...
@@ -89,7 +89,7 @@ partition by range(a)
(partition p0 values less than (1,"b"));
ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
create table t1 (a int, b char(20))
partition by range column
_list
(b)
partition by range column
s
(b)
(partition p0 values less than ("b"));
drop table t1;
create table t1 (a int)
...
...
mysql-test/t/partition_column.test
View file @
caa4fffa
...
...
@@ -13,11 +13,11 @@ drop table if exists t1;
#
--
error
ER_PARTITION_FIELDS_TOO_LONG
create
table
t1
(
a
varchar
(
1500
),
b
varchar
(
1570
))
partition
by
list
column
_list
(
a
,
b
)
partition
by
list
column
s
(
a
,
b
)
(
partition
p0
values
in
((
'a'
,
'b'
)));
create
table
t1
(
a
varchar
(
1023
)
character
set
utf8
collate
utf8_spanish2_ci
)
partition
by
range
column
_list
(
a
)
partition
by
range
column
s
(
a
)
(
partition
p0
values
less
than
(
'CZ'
),
partition
p1
values
less
than
(
'CH'
),
partition
p2
values
less
than
(
'D'
));
...
...
@@ -31,12 +31,12 @@ drop table t1;
set
@@
sql_mode
=
allow_invalid_dates
;
--
error
ER_WRONG_TYPE_COLUMN_VALUE_ERROR
create
table
t1
(
a
char
,
b
char
,
c
date
)
partition
by
range
column
_list
(
a
,
b
,
c
)
partition
by
range
column
s
(
a
,
b
,
c
)
(
partition
p0
values
less
than
(
0
,
0
,
to_days
(
'3000-11-31'
)));
--
error
ER_WRONG_TYPE_COLUMN_VALUE_ERROR
create
table
t1
(
a
char
,
b
char
,
c
date
)
partition
by
range
column
_list
(
a
,
b
,
c
)
partition
by
range
column
s
(
a
,
b
,
c
)
(
partition
p0
values
less
than
(
0
,
0
,
'3000-11-31'
));
set
@@
sql_mode
=
''
;
...
...
@@ -44,7 +44,7 @@ set @@sql_mode='';
# BUG#48163, Dagger in UCS2 not working as partition value
#
create
table
t1
(
a
varchar
(
2
)
character
set
ucs2
)
partition
by
list
column
_list
(
a
)
partition
by
list
column
s
(
a
)
(
partition
p0
values
in
(
0x2020
),
partition
p1
values
in
(
''
));
show
create
table
t1
;
...
...
@@ -53,7 +53,7 @@ insert into t1 values (_ucs2 0x2020);
drop
table
t1
;
create
table
t1
(
a
int
,
b
char
(
10
),
c
varchar
(
25
),
d
datetime
)
partition
by
range
column
_list
(
a
,
b
,
c
,
d
)
partition
by
range
column
s
(
a
,
b
,
c
,
d
)
subpartition
by
hash
(
to_seconds
(
d
))
subpartitions
4
(
partition
p0
values
less
than
(
1
,
0
,
MAXVALUE
,
'1900-01-01'
),
...
...
@@ -67,16 +67,16 @@ drop table t1;
--
error
ER_NULL_IN_VALUES_LESS_THAN
create
table
t1
(
a
int
,
b
int
)
partition
by
range
column
_list
(
a
,
b
)
partition
by
range
column
s
(
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
by
list
column
s
(
a
,
b
)
(
partition
p0
values
in
((
maxvalue
,
0
)));
create
table
t1
(
a
int
,
b
int
)
partition
by
list
column
_list
(
a
,
b
)
partition
by
list
column
s
(
a
,
b
)
(
partition
p0
values
in
((
0
,
0
)));
--
error
ER_MAXVALUE_IN_VALUES_IN
,
ER_PARSE_ERROR
alter
table
t1
add
partition
...
...
@@ -90,7 +90,7 @@ create table t1 (a int, b int)
partition
by
key
(
a
,
a
);
--
error
ER_SAME_NAME_PARTITION_FIELD
create
table
t1
(
a
int
,
b
int
)
partition
by
list
column
_list
(
a
,
a
)
partition
by
list
column
s
(
a
,
a
)
(
partition
p
values
in
((
1
,
1
)));
#
...
...
@@ -108,7 +108,7 @@ select * from t1 where a <= 1;
drop
table
t1
;
create
table
t1
(
a
int
signed
)
partition
by
list
column
_list
(
a
)
partition
by
list
column
s
(
a
)
(
partition
p0
values
in
(
1
,
3
,
5
,
7
,
9
,
NULL
),
partition
p1
values
in
(
2
,
4
,
6
,
8
,
0
));
insert
into
t1
values
(
NULL
),(
0
),(
1
),(
2
),(
2
),(
4
),(
4
),(
4
),(
8
),(
8
);
...
...
@@ -119,7 +119,7 @@ select * from t1 where a <= 1;
drop
table
t1
;
create
table
t1
(
a
int
,
b
int
)
partition
by
list
column
_list
(
a
,
b
)
partition
by
list
column
s
(
a
,
b
)
(
partition
p0
values
in
((
1
,
NULL
),
(
2
,
NULL
),
(
NULL
,
NULL
)),
partition
p1
values
in
((
1
,
1
),
(
2
,
2
)),
partition
p2
values
in
((
3
,
NULL
),
(
NULL
,
1
)));
...
...
@@ -167,12 +167,12 @@ drop table t1;
--
error
ER_PARSE_ERROR
create
table
t1
(
a
int
)
partition
by
list
column
_list
(
a
)
partition
by
list
column
s
(
a
)
(
partition
p0
values
in
(
2
,
1
),
partition
p1
values
in
((
4
),
(
NULL
),
(
3
)));
create
table
t1
(
a
int
)
partition
by
list
column
_list
(
a
)
partition
by
list
column
s
(
a
)
(
partition
p0
values
in
(
2
,
1
),
partition
p1
values
in
(
4
,
NULL
,
3
));
select
partition_method
,
partition_expression
,
partition_description
...
...
@@ -189,7 +189,7 @@ show create table t1;
drop
table
t1
;
create
table
t1
(
a
int
,
b
char
(
10
),
c
varchar
(
5
),
d
int
)
partition
by
range
column
_list
(
a
,
b
,
c
)
partition
by
range
column
s
(
a
,
b
,
c
)
subpartition
by
key
(
c
,
d
)
subpartitions
3
(
partition
p0
values
less
than
(
1
,
'abc'
,
'abc'
),
...
...
@@ -209,7 +209,7 @@ select * from t1 where (a = 1 AND b < 'd' AND (c = 'b' OR (c = 'c' AND d = 1)) O
drop
table
t1
;
create
table
t1
(
a
int
,
b
varchar
(
2
),
c
int
)
partition
by
range
column
_list
(
a
,
b
,
c
)
partition
by
range
column
s
(
a
,
b
,
c
)
(
partition
p0
values
less
than
(
1
,
'A'
,
1
),
partition
p1
values
less
than
(
1
,
'B'
,
1
));
select
partition_method
,
partition_expression
,
partition_description
...
...
@@ -221,7 +221,7 @@ select * from t1 where a = 1 AND b <= 'A' and c = 1;
drop
table
t1
;
create
table
t1
(
a
char
,
b
char
,
c
char
)
partition
by
list
column
_list
(
a
)
partition
by
list
column
s
(
a
)
(
partition
p0
values
in
(
'a'
));
insert
into
t1
(
a
)
values
(
'a'
);
select
*
from
t1
where
a
=
'a'
;
...
...
@@ -229,47 +229,47 @@ drop table t1;
--
error
ER_WRONG_TYPE_COLUMN_VALUE_ERROR
create
table
t1
(
d
time
)
partition
by
range
column
_list
(
d
)
partition
by
range
column
s
(
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
column
_list
(
d
)
partition
by
range
column
s
(
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
column
_list
(
d
)
partition
by
range
column
s
(
d
)
(
partition
p0
values
less
than
(
0
),
partition
p1
values
less
than
(
1
));
create
table
t1
(
a
int
,
b
int
)
partition
by
range
column
_list
(
a
,
b
)
partition
by
range
column
s
(
a
,
b
)
(
partition
p0
values
less
than
(
maxvalue
,
10
));
drop
table
t1
;
create
table
t1
(
d
date
)
partition
by
range
column
_list
(
d
)
partition
by
range
column
s
(
d
)
(
partition
p0
values
less
than
(
'2000-01-01'
),
partition
p1
values
less
than
(
'2009-01-01'
));
drop
table
t1
;
create
table
t1
(
d
date
)
partition
by
range
column
_list
(
d
)
partition
by
range
column
s
(
d
)
(
partition
p0
values
less
than
(
'1999-01-01'
),
partition
p1
values
less
than
(
'2000-01-01'
));
drop
table
t1
;
create
table
t1
(
d
date
)
partition
by
range
column
_list
(
d
)
partition
by
range
column
s
(
d
)
(
partition
p0
values
less
than
(
'2000-01-01'
),
partition
p1
values
less
than
(
'3000-01-01'
));
drop
table
t1
;
create
table
t1
(
a
int
,
b
int
)
partition
by
range
column
_list
(
a
,
b
)
partition
by
range
column
s
(
a
,
b
)
(
partition
p2
values
less
than
(
99
,
99
),
partition
p1
values
less
than
(
99
,
999
));
...
...
@@ -284,21 +284,21 @@ drop table t1;
--
error
ER_PARSE_ERROR
create
table
t1
(
a
int
,
b
int
)
partition
by
list
column
_list
(
a
,
b
)
partition
by
list
column
s
(
a
,
b
)
(
partition
p0
values
in
((
maxvalue
,
maxvalue
)));
create
table
t1
(
a
int
,
b
int
)
partition
by
range
column
_list
(
a
,
b
)
partition
by
range
column
s
(
a
,
b
)
(
partition
p0
values
less
than
(
maxvalue
,
maxvalue
));
drop
table
t1
;
create
table
t1
(
a
int
)
partition
by
list
column
_list
(
a
)
partition
by
list
column
s
(
a
)
(
partition
p0
values
in
(
0
));
select
partition_method
from
information_schema
.
partitions
where
table_name
=
't1'
;
drop
table
t1
;
create
table
t1
(
a
char
(
6
))
partition
by
range
column
_list
(
a
)
partition
by
range
column
s
(
a
)
(
partition
p0
values
less
than
(
'H23456'
),
partition
p1
values
less
than
(
'M23456'
));
insert
into
t1
values
(
'F23456'
);
...
...
@@ -307,28 +307,28 @@ drop table t1;
--
error
1054
create
table
t1
(
a
char
(
6
))
partition
by
range
column
_list
(
a
)
partition
by
range
column
s
(
a
)
(
partition
p0
values
less
than
(
H23456
),
partition
p1
values
less
than
(
M23456
));
--
error
ER_RANGE_NOT_INCREASING_ERROR
create
table
t1
(
a
char
(
6
))
partition
by
range
column
_list
(
a
)
partition
by
range
column
s
(
a
)
(
partition
p0
values
less
than
(
23456
),
partition
p1
values
less
than
(
23456
));
--
error
1064
create
table
t1
(
a
int
,
b
int
)
partition
by
range
column
_list
(
a
,
b
)
partition
by
range
column
s
(
a
,
b
)
(
partition
p0
values
less
than
(
10
));
--
error
ER_PARTITION_COLUMN_LIST_ERROR
create
table
t1
(
a
int
,
b
int
)
partition
by
range
column
_list
(
a
,
b
)
partition
by
range
column
s
(
a
,
b
)
(
partition
p0
values
less
than
(
1
,
1
,
1
);
create
table
t1
(
a
int
,
b
int
)
partition
by
range
column
_list
(
a
,
b
)
partition
by
range
column
s
(
a
,
b
)
(
partition
p0
values
less
than
(
1
,
0
),
partition
p1
values
less
than
(
2
,
maxvalue
),
partition
p2
values
less
than
(
3
,
3
),
...
...
@@ -340,7 +340,7 @@ insert into t1 values (0,1),(1,1),(2,1),(3,1),(3,4),(4,9),(9,1);
select
*
from
t1
;
alter
table
t1
partition
by
range
column
_list
(
b
,
a
)
partition
by
range
column
s
(
b
,
a
)
(
partition
p0
values
less
than
(
1
,
2
),
partition
p1
values
less
than
(
3
,
3
),
partition
p2
values
less
than
(
9
,
5
));
...
...
@@ -374,7 +374,7 @@ select * from t1 where b < 4;
drop
table
t1
;
create
table
t1
(
a
int
,
b
int
)
partition
by
list
column
_list
(
a
,
b
)
partition
by
list
column
s
(
a
,
b
)
subpartition
by
hash
(
b
)
subpartitions
2
(
partition
p0
values
in
((
0
,
0
),
(
1
,
1
)),
...
...
@@ -384,7 +384,7 @@ insert into t1 values (1000,1000);
drop
table
t1
;
create
table
t1
(
a
char
,
b
char
,
c
char
)
partition
by
range
column
_list
(
a
,
b
,
c
)
partition
by
range
column
s
(
a
,
b
,
c
)
(
partition
p0
values
less
than
(
'a'
,
'b'
,
'c'
));
alter
table
t1
add
partition
(
partition
p1
values
less
than
(
'b'
,
'c'
,
'd'
));
...
...
mysql-test/t/partition_column_prune.test
View file @
caa4fffa
...
...
@@ -8,7 +8,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--
enable_warnings
create
table
t1
(
a
char
,
b
char
,
c
char
)
partition
by
range
column
_list
(
a
,
b
,
c
)
partition
by
range
column
s
(
a
,
b
,
c
)
(
partition
p0
values
less
than
(
'a'
,
'b'
,
'c'
));
insert
into
t1
values
(
'a'
,
NULL
,
'd'
);
explain
partitions
select
*
from
t1
where
a
=
'a'
AND
c
=
'd'
;
...
...
@@ -16,7 +16,7 @@ select * from t1 where a = 'a' AND c = 'd';
drop
table
t1
;
## COLUMN_LIST partition pruning tests
create
table
t1
(
a
int
not
null
)
partition
by
range
column
_list
(
a
)
(
create
table
t1
(
a
int
not
null
)
partition
by
range
column
s
(
a
)
(
partition
p0
values
less
than
(
10
),
partition
p1
values
less
than
(
20
),
partition
p2
values
less
than
(
30
),
...
...
@@ -46,7 +46,7 @@ explain partitions select * from t2 where a > 35 and a < 45;
drop
table
t1
,
t2
;
create
table
t1
(
a
int
not
null
,
b
int
not
null
)
partition
by
range
column
_list
(
a
,
b
)
(
partition
by
range
column
s
(
a
,
b
)
(
partition
p01
values
less
than
(
2
,
10
),
partition
p02
values
less
than
(
2
,
20
),
partition
p03
values
less
than
(
2
,
30
),
...
...
mysql-test/t/partition_innodb.test
View file @
caa4fffa
...
...
@@ -10,7 +10,7 @@ drop table if exists t1;
#
create
table
t1
(
a
varchar
(
5
))
engine
=
memory
partition
by
range
column
_list
(
a
)
partition
by
range
column
s
(
a
)
(
partition
p0
values
less
than
(
'm'
),
partition
p1
values
less
than
(
'za'
));
insert
into
t1
values
(
'j'
);
...
...
@@ -19,7 +19,7 @@ drop table t1;
create
table
t1
(
a
varchar
(
5
))
engine
=
myisam
partition
by
range
column
_list
(
a
)
partition
by
range
column
s
(
a
)
(
partition
p0
values
less
than
(
'm'
),
partition
p1
values
less
than
(
'za'
));
insert
into
t1
values
(
'j'
);
...
...
@@ -28,7 +28,7 @@ drop table t1;
create
table
t1
(
a
varchar
(
5
))
engine
=
innodb
partition
by
range
column
_list
(
a
)
partition
by
range
column
s
(
a
)
(
partition
p0
values
less
than
(
'm'
),
partition
p1
values
less
than
(
'za'
));
insert
into
t1
values
(
'j'
);
...
...
mysql-test/t/partition_range.test
View file @
caa4fffa
...
...
@@ -63,7 +63,7 @@ drop table t1;
#
--
error
1064
create
table
t1
(
a
int
,
b
char
(
20
))
partition
by
range
column
_list
(
a
,
b
)
partition
by
range
column
s
(
a
,
b
)
(
partition
p0
values
less
than
(
1
));
--
error
ER_TOO_MANY_VALUES_ERROR
...
...
@@ -77,7 +77,7 @@ partition by range(a)
(
partition
p0
values
less
than
(
1
,
"b"
));
create
table
t1
(
a
int
,
b
char
(
20
))
partition
by
range
column
_list
(
b
)
partition
by
range
column
s
(
b
)
(
partition
p0
values
less
than
(
"b"
));
drop
table
t1
;
...
...
sql/lex.h
View file @
caa4fffa
...
...
@@ -119,7 +119,6 @@ static SYMBOL symbols[] = {
{
"COLUMN"
,
SYM
(
COLUMN_SYM
)},
{
"COLUMN_NAME"
,
SYM
(
COLUMN_NAME_SYM
)},
{
"COLUMNS"
,
SYM
(
COLUMNS
)},
{
"COLUMN_LIST"
,
SYM
(
COLUMN_LIST_SYM
)},
{
"COMMENT"
,
SYM
(
COMMENT_SYM
)},
{
"COMMIT"
,
SYM
(
COMMIT_SYM
)},
{
"COMMITTED"
,
SYM
(
COMMITTED_SYM
)},
...
...
sql/opt_range.cc
View file @
caa4fffa
...
...
@@ -3251,7 +3251,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
/*
We need to call the interval mapper if we have a condition which
makes sense to prune on. In the example of
a COLUMN_LIST
on a and
makes sense to prune on. In the example of
COLUMNS
on a and
b it makes sense if we have a condition on a, or conditions on
both a and b. If we only have conditions on b it might make sense
but this is a harder case we will solve later. For the harder case
...
...
sql/sql_partition.cc
View file @
caa4fffa
...
...
@@ -68,7 +68,7 @@ const LEX_STRING partition_keywords[]=
{
C_STRING_WITH_LEN
(
"KEY"
)
},
{
C_STRING_WITH_LEN
(
"MAXVALUE"
)
},
{
C_STRING_WITH_LEN
(
"LINEAR "
)
},
{
C_STRING_WITH_LEN
(
" COLUMN
_LIST
"
)
}
{
C_STRING_WITH_LEN
(
" COLUMN
S
"
)
}
};
static
const
char
*
part_str
=
"PARTITION"
;
static
const
char
*
subpart_str
=
"SUBPARTITION"
;
...
...
@@ -6925,7 +6925,7 @@ void make_used_partitions_str(partition_info *part_info, String *parts_str)
(1) is applicable for "PARTITION BY <RANGE|LIST>(func(t.field))", where
func is a monotonic function.
(2) is applicable for "PARTITION BY <RANGE|LIST> COLUMN
_LIST
(field_list)
(2) is applicable for "PARTITION BY <RANGE|LIST> COLUMN
S
(field_list)
(3) is applicable for
"[SUB]PARTITION BY <any-partitioning-type>(any_func(t.integer_field))"
...
...
@@ -7624,7 +7624,7 @@ uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter)
DESCRIPTION
This implementation of PARTITION_ITERATOR::get_next() is special for
LIST partitioning: it enumerates partition ids in
part_info->list_array[i] (list_col_array[i] for COLUMN
_LIST
LIST
part_info->list_array[i] (list_col_array[i] for COLUMN
S
LIST
partitioning) where i runs over [min_idx, max_idx] interval.
The function conforms to partition_iter_func type.
...
...
sql/sql_yacc.yy
View file @
caa4fffa
...
...
@@ -611,7 +611,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token COLLATE_SYM /* SQL-2003-R */
%token COLLATION_SYM /* SQL-2003-N */
%token COLUMNS
%token COLUMN_LIST_SYM
%token COLUMN_SYM /* SQL-2003-R */
%token COLUMN_NAME_SYM /* SQL-2003-N */
%token COMMENT_SYM
...
...
@@ -4121,7 +4120,7 @@ part_field_item:
;
part_column_list:
COLUMN
_LIST_SYM
'(' part_field_list ')'
COLUMN
S
'(' part_field_list ')'
{
partition_info *part_info= Lex->part_info;
part_info->column_list= TRUE;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment