#At file:///home/mikael/mysql_clones/mysql-6.0-codebase-wl3352/
3656 Mikael Ronstrom 2009-10-30 [merge]
Final merge from mysql-next-mr-wl3352-values
modified:
mysql-test/r/partition_column.result
mysql-test/r/partition_pruning.result
mysql-test/t/partition_column.test
sql/sql_partition.cc
=== modified file 'mysql-test/r/partition_column.result'
--- a/mysql-test/r/partition_column.result 2009-10-30 20:08:34 +0000
+++ b/mysql-test/r/partition_column.result 2009-10-30 21:12:20 +0000
@@ -1,5 +1,5 @@
drop table if exists t1;
-create table t1 (a varchar(1500), b varchar(1570))
+create table t1 (a varchar(2000), b varchar(2094))
partition by list columns(a,b)
( partition p0 values in (('a','b')));
ERROR HY000: The total length of the partitioning fields is too large
@@ -39,6 +39,15 @@ subpartitions 4
partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (a int, b char(10), c varchar(25), d datetime)
+partition by range columns(a,b,c,d)
+subpartition by hash (to_seconds(d))
+subpartitions 4
+( partition p0 values less than (1, '0', MAXVALUE, '1900-01-01'),
+partition p1 values less than (1, 'a', MAXVALUE, '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
@@ -421,7 +430,7 @@ create table t1 (a char(6))
partition by range columns(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
+ERROR HY000: Partition column values of incorrect type
create table t1 (a int, b int)
partition by range columns(a,b)
(partition p0 values less than (10));
=== modified file 'mysql-test/r/partition_pruning.result'
--- a/mysql-test/r/partition_pruning.result 2009-10-30 16:34:50 +0000
+++ b/mysql-test/r/partition_pruning.result 2009-10-30 21:12:20 +0000
@@ -795,7 +795,7 @@ id select_type table partitions type pos
1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
+1 SIMPLE t1 pNULL ref a a 4 const 1 Using index
# Disabling warnings for the invalid date
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
=== modified file 'mysql-test/t/partition_column.test'
--- a/mysql-test/t/partition_column.test 2009-10-30 20:43:49 +0000
+++ b/mysql-test/t/partition_column.test 2009-10-30 21:12:20 +0000
@@ -51,6 +51,7 @@ insert into t1 values ('');
insert into t1 values (_ucs2 0x2020);
drop table t1;
+--error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
create table t1 (a int, b char(10), c varchar(25), d datetime)
partition by range columns(a,b,c,d)
subpartition by hash (to_seconds(d))
@@ -59,6 +60,15 @@ subpartitions 4
partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
+
+create table t1 (a int, b char(10), c varchar(25), d datetime)
+partition by range columns(a,b,c,d)
+subpartition by hash (to_seconds(d))
+subpartitions 4
+( partition p0 values less than (1, '0', MAXVALUE, '1900-01-01'),
+ partition p1 values less than (1, 'a', MAXVALUE, '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";
show create table t1;
@@ -310,7 +320,7 @@ partition by range columns(a)
(partition p0 values less than (H23456),
partition p1 values less than (M23456));
--- error ER_RANGE_NOT_INCREASING_ERROR
+-- error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
create table t1 (a char(6))
partition by range columns(a)
(partition p0 values less than (23456),
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2009-10-30 20:43:49 +0000
+++ b/sql/sql_partition.cc 2009-10-30 21:12:20 +0000
@@ -2283,6 +2283,11 @@ static int add_column_list_values(File f
else
field_cs= NULL;
}
+ if (result_type != item_expr->result_type())
+ {
+ my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
+ return 1;
+ }
if (field_cs && field_cs != item_expr->collation.collation)
{
if (!(item_expr= convert_charset_partition_constant(item_expr,
@@ -2292,11 +2297,6 @@ static int add_column_list_values(File f
return 1;
}
}
- if (result_type != item_expr->result_type())
- {
- my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
- return 1;
- }
{
String val_conv;
res= item_expr->val_str(&str);
| Thread |
|---|
| • bzr commit into mysql-6.0-codebase branch (mikael:3656) | Mikael Ronstrom | 30 Oct |