#At file:///Users/mattiasj/clones/bzrroot/b45904-51-bugteam/ based on revid:anurag.shekhar@stripped
3202 Mattias Jonsson 2009-11-17
backport of bug#45904 from mysql-pe to 5.1
@ sql/sql_partition.cc
Bug#45904 Used list_of_part_fields instead of list_of_subpart_fields to discover if KEY subpartitioning => caused failure when charset=utf8 even for subpartitioning by key, would also allow for subpartitioning by hash with utf8 erroneously
modified:
mysql-test/r/partition.result
mysql-test/t/partition.test
sql/sql_partition.cc
=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result 2009-10-08 13:58:17 +0000
+++ b/mysql-test/r/partition.result 2009-11-17 21:47:34 +0000
@@ -50,6 +50,13 @@ t1 CREATE TABLE `t1` (
PARTITION p3 VALUES LESS THAN (733969) ENGINE = MyISAM,
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
DROP TABLE t1;
+create table t1 (a int NOT NULL, b varchar(5) NOT NULL)
+default charset=utf8
+partition by list (a)
+subpartition by key (b)
+(partition p0 values in (1),
+partition p1 values in (2));
+drop table t1;
create table t1 (a int, b int, key(a))
partition by list (a)
( partition p0 values in (1),
=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test 2009-10-08 13:58:17 +0000
+++ b/mysql-test/t/partition.test 2009-11-17 21:47:34 +0000
@@ -62,6 +62,17 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
#
+# Bug#45904: Error when CHARSET=utf8 and subpartitioning
+#
+create table t1 (a int NOT NULL, b varchar(5) NOT NULL)
+default charset=utf8
+partition by list (a)
+subpartition by key (b)
+(partition p0 values in (1),
+ partition p1 values in (2));
+drop table t1;
+
+#
# Bug#44059: rec_per_key on empty partition gives weird optimiser results
#
create table t1 (a int, b int, key(a))
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2009-10-16 10:29:42 +0000
+++ b/sql/sql_partition.cc 2009-11-17 21:47:34 +0000
@@ -1679,7 +1679,7 @@ bool fix_partition_func(THD *thd, TABLE
if (((part_info->part_type != HASH_PARTITION ||
part_info->list_of_part_fields == FALSE) &&
check_part_func_fields(part_info->part_field_array, TRUE)) ||
- (part_info->list_of_part_fields == FALSE &&
+ (part_info->list_of_subpart_fields == FALSE &&
part_info->is_sub_partitioned() &&
check_part_func_fields(part_info->subpart_field_array, TRUE)))
{
Attachment: [text/bzr-bundle]
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (mattias.jonsson:3202)Bug#45904 | Mattias Jonsson | 17 Nov |