mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into c-3d08e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug18198 sql/sql_partition.cc: Auto merged sql/sql_show.cc: Auto merged storage/archive/ha_archive.cc: Auto merged
This commit is contained in:
@ -111,3 +111,32 @@ NULL test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0
|
||||
NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default
|
||||
NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY LINEAR HASH (a)
|
||||
(PARTITION p0 VALUES LESS THAN (10));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) )
|
||||
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
|
||||
table_schema="test" AND table_name="t1";
|
||||
SUBPARTITION_METHOD
|
||||
LINEAR HASH
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
PARTITION BY LIST (a)
|
||||
(PARTITION p0 VALUES IN
|
||||
(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM)
|
||||
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
|
||||
table_schema = "test" AND table_name = "t1";
|
||||
PARTITION_DESCRIPTION
|
||||
10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53
|
||||
drop table t1;
|
||||
|
@ -936,4 +936,16 @@ OPTIMIZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note The storage engine for the table doesn't support optimize
|
||||
drop table t1;
|
||||
create database db99;
|
||||
use db99;
|
||||
create table t1 (a int not null)
|
||||
engine=archive
|
||||
partition by list (a)
|
||||
(partition p0 values in (1), partition p1 values in (2));
|
||||
insert into t1 values (1), (2);
|
||||
create index inx on t1 (a);
|
||||
alter table t1 add partition (partition p2 values in (3));
|
||||
alter table t1 drop partition p2;
|
||||
use test;
|
||||
drop database db99;
|
||||
End of 5.1 tests
|
||||
|
@ -554,3 +554,26 @@ PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
|
||||
insert into t1 values (10);
|
||||
ERROR HY000: Table has no partition for value 10
|
||||
drop table t1;
|
||||
create table t1 (v varchar(12))
|
||||
partition by range (ascii(v))
|
||||
(partition p0 values less than (10));
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by hash (rand(a));
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
|
||||
create table t1 (a int)
|
||||
partition by hash(CURTIME() + a);
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
|
||||
create table t1 (a int)
|
||||
partition by hash (NOW()+a);
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
|
||||
create table t1 (a int)
|
||||
partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
|
||||
ERROR HY000: This partition function is not allowed
|
||||
create table t1 (a int)
|
||||
partition by range (a + (select count(*) from t1))
|
||||
(partition p1 values less than (1));
|
||||
ERROR HY000: This partition function is not allowed
|
||||
create table t1 (a char(10))
|
||||
partition by hash (extractvalue(a,'a'));
|
||||
ERROR HY000: The PARTITION function returns the wrong type
|
||||
|
@ -99,3 +99,25 @@ select * from information_schema.partitions where table_schema="test"
|
||||
and table_name="t1";
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug 20161 Partitions: SUBPARTITION METHOD doesn't show LINEAR keyword
|
||||
#
|
||||
create table t1 (a int)
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY LINEAR HASH (a)
|
||||
(PARTITION p0 VALUES LESS THAN (10));
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
|
||||
table_schema="test" AND table_name="t1";
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int)
|
||||
PARTITION BY LIST (a)
|
||||
(PARTITION p0 VALUES IN
|
||||
(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53));
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
|
||||
table_schema = "test" AND table_name = "t1";
|
||||
drop table t1;
|
||||
|
@ -1077,4 +1077,21 @@ OPTIMIZE TABLE t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug 17310 Partitions: Bugs with archived partitioned tables
|
||||
#
|
||||
create database db99;
|
||||
use db99;
|
||||
create table t1 (a int not null)
|
||||
engine=archive
|
||||
partition by list (a)
|
||||
(partition p0 values in (1), partition p1 values in (2));
|
||||
insert into t1 values (1), (2);
|
||||
--error 0, 1005
|
||||
create index inx on t1 (a);
|
||||
alter table t1 add partition (partition p2 values in (3));
|
||||
alter table t1 drop partition p2;
|
||||
use test;
|
||||
drop database db99;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -747,3 +747,31 @@ CREATE TABLE t1(a int)
|
||||
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
||||
insert into t1 values (10);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
|
||||
#
|
||||
create table t1 (v varchar(12))
|
||||
partition by range (ascii(v))
|
||||
(partition p0 values less than (10));
|
||||
drop table t1;
|
||||
|
||||
-- error 1064
|
||||
create table t1 (a int)
|
||||
partition by hash (rand(a));
|
||||
-- error 1064
|
||||
create table t1 (a int)
|
||||
partition by hash(CURTIME() + a);
|
||||
-- error 1064
|
||||
create table t1 (a int)
|
||||
partition by hash (NOW()+a);
|
||||
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
||||
create table t1 (a int)
|
||||
partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
|
||||
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
||||
create table t1 (a int)
|
||||
partition by range (a + (select count(*) from t1))
|
||||
(partition p1 values less than (1));
|
||||
-- error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
|
||||
create table t1 (a char(10))
|
||||
partition by hash (extractvalue(a,'a'));
|
||||
|
Reference in New Issue
Block a user