> Problem tested using both version 4.0.18 and 4.1.1
> 
> This query gets first byte of utf8 character, not two bytes
> 
> If I use
> 
> SELECT LEFT(FieldName, 2) AS FirstLetter, COUNT(*) FROM TableName GROUP BY
> FirstLetter
> 
> 
> gets right utf8 characters but others wrong
> 
> for example;
> 
> +--------+-------+
> | Ai     |     1 |
> | Ak     |     9 |
> | Ar     |    33 |
> | Ä       |     8 |

I tested with 4.1.1 and 4.1.2 and it works fine. 

Which version did you use with the test you provided?  That is the
expected behavior if you were using MySQL 4.0.18 with a single-byte
character set--4.0.18 does not support utf8.  If that is what you got
with 4.1.1 then it is using the wrong character set somewhere.  

With 4.1.1 do:

SHOW FULL COLUMNS FROM your_table;

And be sure the collation field says utf8_general_ci.  If it doesn't,
then change the charset for your table:

ALTER TABLE your_table CHARACTER SET utf8;

Now try again.  Also be sure your client is using utf8 with this
command:

SET CHARACTER SET utf8;

> I couldn't find 4.1.2 dev source for testing. Can you tell me how I can get
> it please.
> 
> Does anybody knows another solution except getting dev source?

I think this should work with 4.1.1, but here's how to get the dev
source:

Read here about installing development sources for 4.1.x:
http://www.mysql.com/doc/en/Installing_source_tree.html

This is the command you will enter to clone the source:
shell> bk clone bk://mysql.bkbits.net/mysql-4.1 mysql-4.1


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to