Re: weird mysql problem on linux, international chars truncates varchar
Posted by: Ryan Thompson
Date: September 05, 2006 06:15AM

I am having the same problem, a test case (executed on 5.0.18) is below.
Note that a direct selection of the converted character value for 'テ' (0x8365) produces the correct result, but inserting the same function result into a database column results in a truncated string event though UTF8 is explicitly given as the table encoding.


mysql> select concat('test',char(conv(8365,16,10)),'スト');
+----------------------------------------------+
| concat('test',char(conv(8365,16,10)),'スト') |
+----------------------------------------------+
| testテスト |
+----------------------------------------------+
1 row in set (0.00 sec)

mysql> create table test.cc (a text) default charset utf8;
inQuery OK, 0 rows affected (0.00 sec)

mysql> insert into test.cc values(concat('test',char(conv(8365,16,10)),'スト'));
sQuery OK, 1 row affected, 1 warning (0.00 sec)

mysql> select * from test.cc;
+------+
| a |
+------+
| test |
+------+
1 row in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: weird mysql problem on linux, international chars truncates varchar
1779
September 05, 2006 06:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.