Commit 04a70beb authored by unknown's avatar unknown
Browse files

BUG#18198: More fixes


mysql-test/r/partition.result:
  Removed test case no longer supported
mysql-test/r/partition_error.result:
  Changed behaviour of test case
mysql-test/r/partition_pruning.result:
  Changed behaviour of test case
mysql-test/t/partition.test:
  Changed behaviour of test case
mysql-test/t/partition_error.test:
  Changed behaviour of test case
mysql-test/t/partition_pruning.test:
  Changed behaviour of test case
sql/sql_partition.cc:
  Ensured PARTITION BY KEY can use any column type
parent 1e949e84
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -750,11 +750,6 @@ t2 CREATE TABLE `t2` (
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' /*!50100 PARTITION BY KEY (a)  */
drop table t2;
create table t1 (s1 char(2) character set utf8)
partition by list (cast(s1 as signed))
(partition p1 values in (1),
partition p2 values in (2));
drop table t1;
create table t1 (f1 int) partition by hash (f1) as select 1;
drop table t1;
prepare stmt1 from 'create table t1 (s1 int) partition by hash (s1)';
+1 −1
Original line number Diff line number Diff line
@@ -641,7 +641,7 @@ ERROR HY000: Partition constant is out of partition function domain
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
drop table t1;
ERROR HY000: This partition function is not allowed
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
+3 −9
Original line number Diff line number Diff line
@@ -284,13 +284,6 @@ explain partitions select * from t9 where a <= '2004-12-19';
id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t9	p0,p1	ALL	NULL	NULL	NULL	NULL	2	Using where
drop table t5,t6,t7,t8,t9;
create table t1 (a enum('a','b','c','d') default 'a') 
partition by hash (ascii(a)) partitions 2;
insert into t1 values ('a'),('b'),('c');
explain partitions select * from t1 where a='b';
id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	p0,p1	ALL	NULL	NULL	NULL	NULL	3	Using where
drop table t1;
create table t1 (
a1 int not null
)
@@ -643,8 +636,9 @@ f_int1 f_int2
8	8
9	9
drop table t1;
create table t1 (a char(10)) partition by list(length(a)) (
partition p1 values in (1),
create table t1 (a char(10) binary)
partition by list(length(a))
(partition p1 values in (1),
partition p2 values in (2),
partition p3 values in (3),
partition p4 values in (4),
+7 −5
Original line number Diff line number Diff line
@@ -883,11 +883,13 @@ drop table t2;
#
# Bug#14367: Partitions: crash if utf8 column
#
create table t1 (s1 char(2) character set utf8)
partition by list (cast(s1 as signed))
(partition p1 values in (1),
 partition p2 values in (2));
drop table t1;
# utf columns not supported after Bug #18198 is fixed
#
#create table t1 (s1 char(2) character set utf8)
#partition by list (cast(s1 as signed))
#(partition p1 values in (1),
# partition p2 values in (2));
#drop table t1;

#
# Bug#15336 Partitions: crash if create table as select
+1 −1
Original line number Diff line number Diff line
@@ -809,10 +809,10 @@ partition by range (a)
#
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
#
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
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)
Loading