Bug #45904 Cannot create a key subpartition if character set of UTF8 is used
Submitted: 2 Jul 2009 10:43 Modified: 15 Mar 2010 5:20
Reporter: Jaco Swart Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S1 (Critical)
Version:5.1.34-community-log OS:Any
Assigned to: Mattias Jonsson
Tags: key, subpartition, utf8
Triage: Triaged: D3 (Medium)

[2 Jul 2009 10:43] Jaco Swart
Description:
Table creation fails when trying to create a table using a key subpartition when a default character set of UTF8 is specified.

How to repeat:
The following create table statement fails with "This partition function is not allowed"

CREATE TABLE  `test`.`testpart` (
  `id_field` int(11) NOT NULL AUTO_INCREMENT,
  `id_key` varchar(5) NOT NULL,
  PRIMARY KEY (`id_field`,`id_key`)
) ENGINE=INNODB DEFAULT CHARSET=utf8
partition by list (id_field)
subpartition by key (id_key)
subpartitions 20
(PARTITION p0 VALUES IN (2) ENGINE = INNODB,
 PARTITION p1 VALUES IN (1) ENGINE = INNODB)

By changing the default charset to latin1 the table is created correctly.
[27 Jul 2009 15:11] 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/79342

3477 Mikael Ronstrom	2009-07-27
      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
[5 Aug 2009 11:44] Mattias Jonsson
patch approved, ok to push
[17 Nov 2009 15:46] Mattias Jonsson
Reassigning myself to backport this to 5.1
[17 Nov 2009 21: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/90758

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
[18 Nov 2009 11:23] Mattias Jonsson
pushed into mysql-5.1-bugteam and null merged into mysql-pe
[2 Dec 2009 8:03] Bugs System
Pushed into 5.1.42 (revid:joro@sun.com-20091202080033-mndu4sxwx19lz2zs) (version source revid:davi.arnaut@sun.com-20091125130912-d7hrln14ef7y5d7i) (merge vers: 5.1.42) (pib:13)
[3 Dec 2009 15:25] Jon Stephens
Documented bugfix in the 5.1.42 changelog as follows:

        SUBPARTITION BY KEY failed with DEFAULT CHARSET=utf8.

Closed.
[16 Dec 2009 8:38] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091216083311-xorsasf5kopjxshf) (version source revid:alik@sun.com-20091214191830-wznm8245ku8xo702) (merge vers: 6.0.14-alpha) (pib:14)
[16 Dec 2009 8:45] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091216082430-s0gtzibcgkv4pqul) (version source revid:alexey.kopytov@sun.com-20091124083136-iqm136jm31sfdwg3) (merge vers: 5.5.0-beta) (pib:14)
[16 Dec 2009 8:51] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20091216083231-rp8ecpnvkkbhtb27) (version source revid:alik@sun.com-20091212203859-fx4rx5uab47wwuzd) (merge vers: 5.6.0-beta) (pib:14)
[16 Dec 2009 15:07] Jon Stephens
Also documented in the 5.5.1, 5.6.0 and 6.0.14 changelogs. Closed.
[7 Mar 2010 23:56] Paul Dubois
5.6.0 changelog entry unneeded.
[12 Mar 2010 14:11] Bugs System
Pushed into 5.1.44-ndb-7.0.14 (revid:jonas@mysql.com-20100312135944-t0z8s1da2orvl66x) (version source revid:jonas@mysql.com-20100312115609-woou0te4a6s4ae9y) (merge vers: 5.1.44-ndb-7.0.14) (pib:16)
[12 Mar 2010 14:26] Bugs System
Pushed into 5.1.44-ndb-6.2.19 (revid:jonas@mysql.com-20100312134846-tuqhd9w3tv4xgl3d) (version source revid:jonas@mysql.com-20100312060623-mx6407w2vx76h3by) (merge vers: 5.1.44-ndb-6.2.19) (pib:16)
[12 Mar 2010 14:41] Bugs System
Pushed into 5.1.44-ndb-6.3.33 (revid:jonas@mysql.com-20100312135724-xcw8vw2lu3mijrhn) (version source revid:jonas@mysql.com-20100312103652-snkltsd197l7q2yg) (merge vers: 5.1.44-ndb-6.3.33) (pib:16)
[15 Mar 2010 5:20] Jon Stephens
No additional changelog entries required. Returning to Closed state.