Bug #6547 Invalid character set index: 200
Submitted: 10 Nov 2004 12:53 Modified: 17 Nov 2004 18:25
Reporter: Stein Rustad Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:net-1.0.1-beta2 OS:Windows (Windows XP)
Assigned to: Reggie Burnett CPU Architecture:Any

[10 Nov 2004 12:53] Stein Rustad
Description:
When connecting to a all-utf8 database, an MySql.Data.MySqlClient.MySqlException: Invalid character set index: 200
 is thrown. If the all fields in table are changed into latin1, the error does not occur.

How to repeat:
Using a table test_tbl with one field varchar(255) utf8, and the following code

using MySql.Data.MySqlClient;
MySqlConnection dbcon = new MySqlConnection("Data Source=localhost;Database=db;User ID=;Password=");
dbcon.Open();
MySqlCommand dbcmd = dbcon.CreateCommand();
dbcmd.CommandText = "SELECT * FROM test_tbl";
MySqlDataReader result = dbcmd.ExecuteReader();

StackTrace is:
[MySqlException: Invalid character set index: 200]
   MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()

If i change the field to latin1, the error does not occur.
[10 Nov 2004 12:56] Stein Rustad
BTW DB is MySQL4.1.7
[15 Nov 2004 16:54] Reggie Burnett
Can you post the output of show create table on that table?  We have utf-8 support working really well and I am not sure where this 200 is coming from.
[16 Nov 2004 8:43] Stein Rustad
In my.ini: default-character-set=utf8 (error also occurs when set to latin1 in my.ini)

CREATE DATABASE `db` DEFAULT CHARACTER SET utf8 COLLATE utf8_swedish_ci;

CREATE TABLE `test_tbl` (
  `test` VARCHAR( 255 ) NOT NULL
) CHARACTER SET utf8 COLLATE utf8_swedish_ci TYPE = MYISAM;

Running this results in the exception mentioned above.
[17 Nov 2004 18:25] Reggie Burnett
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