Bug #4698 max(substring(...))
Submitted: 22 Jul 2004 14:49 Modified: 22 Jul 2004 16:27
Reporter: Emmanuel CORGE Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.3b OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[22 Jul 2004 14:49] Emmanuel CORGE
Description:
I'm trying to use max on a substring function. The result is ok.  With a column of varchar type directly on the max, the result is nok.

Query : select max(chrono) from affaire
Result : ABC1000 -> It's ok.

Query : select max(substring(chrono,4,1)) from affaire
Result : ùî -> It's nok. 

Query : select max(substring(chrono,4,1)+1) from affaire
Result : 1001 -> It's ok

How to repeat:
execute query in description
[22 Jul 2004 16:27] Alexander Keremidarski
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Additional info:

Please provide table structure as well as server and client Character Set's information.

SHOW VARIABLES LIKE "character_%';

All string operations in 4.1 are character set and collation dependant