Bug #5723 length(<varchar utf8 field>) returns varying results
Submitted: 23 Sep 2004 15:20 Modified: 26 Sep 2004 16:59
Reporter: Timothy Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.6 OS:any (FreeBSD / Linux)
Assigned to: Alexander Barkov CPU Architecture:Any

[23 Sep 2004 15:20] Timothy Smith
Description:
The result of LENGTH(<a varchar utf8 field>) varies when ORDER BY is used.

How to repeat:
Load the attached dump file into mysql command line client in latest 4.1 code.

Then run these three queries:

select length(subject) from incidents2;
select length(subject) from incidents2 order by 1;
select length(subject) from incidents2 where ref_no='040312-000057' order by 1;

The first and third return 432; the second returns 176.

Suggested fix:
Not known
[23 Sep 2004 15:27] Timothy Smith
dump of test table for reproducing the bug

Attachment: incidents2.dump (application/octet-stream, text), 1.96 KiB.

[26 Sep 2004 16:59] Alexander Barkov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html