buffer too small...

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Posts: 5
Joined: Thu 27 Apr 2006 14:28

buffer too small...

Post by johnqh » Sat 21 Nov 2009 19:49

I have a database with text fields which stores Chinese text. The connection already uses "unicode=true". In MySQL, the field uses UTF-8 charset.

And the code has no problem with retrieving data.

When I update the text, with a very simple update statement:

UPDATE book SET long_desc='a long text here' WHERE id = '10874'

It gives me an exception if the string is long: "The output byte buffer is too small to contain the encoded data, encoding 'Unicode (UTF-8)' fallback 'System.Text.EncoderReplacementFallback'.
Parameter name: bytes"

This is my code:
DbCommand command = mConnection.CreateCommand();
command.CommandText = inCommand;
int affected = command.ExecuteNonQuery();
return affected;
Last edited by johnqh on Sat 21 Nov 2009 20:09, edited 1 time in total.

Posts: 5
Joined: Thu 27 Apr 2006 14:28

Post by johnqh » Sat 21 Nov 2009 20:09

By the way, if I run the update statement directly in MySQL, it works without any problem.

Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 23 Nov 2009 14:30

Please try using the latest 5.50.54 version of dotConnect for MySQL. If the problem persists, please give us the following information:
1) your call stack;
2) the versions of your dotConnect for MySQL, MySQL Server;
3) a small test project with DDL/DML script and a test data (text with Chinese characters). We will try to reproduce the issue in our environment.

Post Reply