Bug #15408 Partitions: subpartition names are not unique
Submitted: 2 Dec 2005 2:16 Modified: 8 Mar 2006 15:22
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.4-alpha-debug OS:Linux (linux)
Assigned to: Reggie Burnett

[2 Dec 2005 2:16] Peter Gulutzan
Description:
I can define two subpartitions with the same name.
That's no good. All subpartition names should be
unique within the table, even if the subpartitions
belong to different partitions.
 

How to repeat:
mysql> create table tpp (s1 int, s2 int) partition by list (s1)  (partition p1 values in (0) (subpartition p1b), partition p2 values in (2) (subpartition p1b));
Query OK, 0 rows affected (0.00 sec)
[6 Jan 2006 18:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/716
[16 Feb 2006 21:02] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2752
[21 Feb 2006 23:02] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/3004
[23 Feb 2006 11:18] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented functionality change in 5.1.7 changelog. Closed.
[24 Feb 2006 20:11] Peter Gulutzan
I am still able to create one table with two subpartitions with the same name, thus:

mysql> create table t2 (s1 int) partition by list (s1) subpartition by hash(s1)                                            (partition p1 values in (1) (subpartition s0), partition p2 values in (2) (subpa                                           rtition `s0 `));
Query OK, 0 rows affected (0.01 sec)

mysql> show create table t2;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                                                           |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t2    | CREATE TABLE `t2` (
  `s1` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (s1) SUBPARTITION BY HASH (s1) (PARTITION p1 VALUES IN (1)  (SUBPARTITION s0 ENGINE = MyISAM), PARTITION p2 VALUES IN (2)  (SUBPARTITION s0 ENGINE = MyISAM)) |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

... so I changed the bug status back to 'verified'.
[24 Feb 2006 20:35] Peter Gulutzan
When closing again, please look at the manual:
http://dev.mysql.com/doc/refman/5.1/en/partitioning-subpartitions.html
The page still says that:
"Names of subpartitions must be unique within each partition, but do not
have to be unique within the table as a whole."
[6 Mar 2006 5:21] Reggie Burnett
This is, in fact, fixed.  You have found a different bug.  Show create table appears to be trimming space from the end of the subpart names and therefore they are shown as not having a trailing space.  

Stefan,

We need to modify this documentation page to indicate that subparts names now have to be unique across the entire table.

http://dev.mysql.com/doc/refman/5.1/en/partitioning-subpartitions.html
[8 Mar 2006 15:22] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented feature change in 5.1.8 changelog and Partitioning chapter in 5.1 Manual. Closed.