Bug #17946 Partitions: key() can be for a character column
Submitted: 6 Mar 2006 1:35 Modified: 16 Apr 2006 14:28
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.8-beta-debug OS:Linux (SUSE 10.0)
Assigned to: Mikael Ronström CPU Architecture:Any

[6 Mar 2006 1:35] Peter Gulutzan
Description:
I can create a table partitioned by key(),
where the primary key is a CHAR column.
LIKE searches on this table fail.

How to repeat:
mysql> create table tm1 (s1 char(32) primary key) partition by key() partitions 100;
Query OK, 0 rows affected (0.08 sec)

mysql> insert into tm1 values ('na');
Query OK, 1 row affected (0.04 sec)

mysql> select * from tm1 where s1 like 'n%';
Empty set (0.00 sec)
[6 Mar 2006 11:28] Miguel Solorzano
Thank you for the bug report.
[10 Apr 2006 11:24] Mikael Ronström
This bug has been fixed by a previous patch in version 5.1.10 or earlier
[12 Apr 2006 8:50] Mikael Ronström
PARTITION BY KEY(..) can contain any type of fields (excepts BLOB's and for MySQL
Cluster some other special exceptions). The function in this case is actually a MySQL
defined hash function which will always return an integer value, thus ok.
[16 Apr 2006 14:28] 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 bugfix in 5.1.10 changelog. Also amended Partitioning chapter in 5.1 Manual based on info supplied by Mikael. Closed.