Bug #45300 | MAX() and ENUM type | ||
---|---|---|---|
Submitted: | 3 Jun 2009 11:52 | Modified: | 1 Apr 2011 16:52 |
Reporter: | Nuno Tavares | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | 5.1.37 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | enum, MAX, min |
[3 Jun 2009 11:52]
Nuno Tavares
[3 Jun 2009 11:55]
Nuno Tavares
I'm sorry, it seems I didn't look enough. I just checked http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_max which states: "For MAX(), MySQL currently compares ENUM and SET columns by their string value rather than by the string's relative position in the set. This differs from how ORDER BY compares them. This is expected to be rectified in a future MySQL release." Well, anyway, 2009-2002 = 7 years, so maybe this will remind someone it should be fixed :-)
[23 Jun 2009 12:47]
MySQL Verification Team
Thank you for the bug report.
[1 Apr 2011 16:31]
Adrian Jones
From what I can figure, this still isn't fixed ?
[1 Apr 2011 16:52]
Nuno Tavares
Adrian, Just verified in 5.1.37, it still happens. Please note also: « I think there should be a function to convert the INT value to the VARCHAR related value, which would be doing something similar to what FIND_IN_SET() does, but looking at the column type definition. » Best, -NT