Bug #27727 Generate a warning during implicit casts
Submitted: 10 Apr 2007 6:22 Modified: 29 Mar 2011 19:05
Reporter: Roberto Spadim (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Types Severity:S4 (Feature request)
Version:5.1.x OS:Any
Assigned to: CPU Architecture:Any
Tags: partition tables, qc

[10 Apr 2007 6:22] Roberto Spadim
Description:
hello i didn't found any partition type that could be good for strings,
for example i have an field that contain the unique id of products, an it's the primary key
i could partition this table with the substring(field,1,4) since i could partition table with strings, substring <'0001'  substring < '0005' substring <'1000' substring <'2000' and substring>='2000'

any idea on how to make this?

How to repeat:
i dont't know, may by and key partition could work but i have unique keys too, and i couldn't remove the constraint of unique value on the table

Suggested fix:
maybe a new partition type could allow us to partition a table using substrings in the future maybe regexp and like expressions... how knows..
[29 Apr 2007 12:11] Valeriy Kravchuk
Please, check if range partitioning over something like CAST(substring(field,1,4) as unsigned) will help you. Read http://dev.mysql.com/doc/refman/5.1/en/partitioning-range.html for the details.
[4 Jun 2007 20:05] Valeriy Kravchuk
Please, specify exact feature/documentation request, if any, based on your last private comment.
[5 Jun 2007 16:34] Roberto Spadim
i don't remember but the problem was
if you don't work with only allowed functions on partition the parser return an error telling that the function used is not supported
since substr isn't supported in partition by range, just numeric functions could work, but casting the string you can use it as a number casted, if mysql cast without user know, and generate a warning could be more intelligent for begginners
[5 Jun 2007 19:18] Valeriy Kravchuk
Thank you for a reasonable feature request (implicit cast to number with warning for the expression used to partition by range).
[26 Jan 2011 22:28] Mattias Jonsson
Partitioning by a 'string' field can be done either by KEY partitioning in 5.1+, or by RANGE/LIST COLUMNS partitioning in 5.5.

Closing as 'Not a bug'.
[29 Mar 2011 18:52] Roberto Spadim
nice closed
should i close it or leave as not a bug?
[29 Mar 2011 19:05] Roberto Spadim
nice closed
should i close it or leave as not a bug?