Bug #33679 ASCII partition function returning "This partition function is not allowed"
Submitted: 3 Jan 2008 22:26 Modified: 4 Jan 2008 0:26
Reporter: James M Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.22-rc OS:Linux
Assigned to: CPU Architecture:Any
Tags: ASCII, functions, partition

[3 Jan 2008 22:26] James M
Description:
If I create a partitioned table (either using LIST, RANGE etc) that uses ASCII() an error of "This partition function is not allowed" is returned.

I understand from bug #26082 that nested function calls were removed (sadly!?) but a single call to ASCII should be successful, as is a call to YEAR() or DATETIME() in it's place.

How to repeat:
CREATE TABLE `tbl_test_partition` (
  `tbltest_id` MEDIUMINT(8) unsigned NOT NULL,
  `tbltest_string` VARCHAR(255) NOT NULL
) ENGINE = MYISAM
PARTITION BY LIST ( ASCII(`tbltest_string`) ) ( 
  PARTITION pA VALUES IN (97),
  PARTITION pB VALUES IN (98)
);

Suggested fix:
Allow this partition function call.

Also suggest allowed partition function calls are documented clearly - the best I could find was a small list of only date/time related functions on http://dev.mysql.com/tech-resources/articles/mysql_5.1_partitions.html
[4 Jan 2008 0:26] Mattias Jonsson
ASCII() function is not a supported partitioning function. Manual:
http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-functions.html

This was discussed in Bug#18198