Bug #31017 | GREATEST() and LEAST() implicitly converts the wrong way if used with mixed args | ||
---|---|---|---|
Submitted: | 14 Sep 2007 4:21 | Modified: | 27 Sep 2007 8:53 |
Reporter: | Tobias Asplund | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server | Severity: | S4 (Feature request) |
Version: | 5.0.45 | OS: | MacOS |
Assigned to: | CPU Architecture: | Any |
[14 Sep 2007 4:21]
Tobias Asplund
[14 Sep 2007 5:00]
Valeriy Kravchuk
Thank you for a reasonable feature request. Indeed, this: mysql> SELECT GREATEST('B', 'C', 1); +-----------------------+ | GREATEST('B', 'C', 1) | +-----------------------+ | 1 | +-----------------------+ 1 row in set, 2 warnings (0.00 sec) mysql> show warnings; +---------+------+---------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------+ | Warning | 1292 | Truncated incorrect DOUBLE value: 'B' | | Warning | 1292 | Truncated incorrect DOUBLE value: 'C' | +---------+------+---------------------------------------+ 2 rows in set (0.02 sec) is not the best way. It should be processed as GREATEST('B', 'C', '1') by default.
[27 Sep 2007 8:53]
Sergei Golubchik
This is questionable. What about GREATEST('000100', ' 2', 1) ? Besides, the current behavior is clearly documented, see http://dev.mysql.com/doc/refman/5.0/en/type-conversion.html