Bug #8629 exception occurs when connecting to the server that use 'euckr' charset
Submitted: 19 Feb 2005 19:41 Modified: 16 Mar 2005 21:22
Reporter: Sangjin Han Email Updates:
Status: Closed Impact on me:
Category:Connector / J Severity:S1 (Critical)
Version:3.0.16 OS:Windows (WindowsXP)
Assigned to: Mark Matthews CPU Architecture:Any

[19 Feb 2005 19:41] Sangjin Han

'euckr' is a character set for Korean language supported by MySQL.
When I set my configuration to 'euckr' and connect to server, an exception occurs during the translation between java-style encoding name 'EUC_KR' and MySQL character set name 'euckr'.

It seems that there is a miswriting 'euc_kr' in the translating table, in where it should be 'euckr'.

How to repeat:
1. Shutdown mysql server

2. Set default character set to 'euckr', by appending a line "default_character_set=euckr" to the [mysqld] section in my.ini

3. Restart the server

4. Connect to the MySQL server using MySQL Connector/J

5. An exception occurs like this:

java.sql.SQLException: Syntax error or access violation message from server: "Unknown character set: 'euc_kr'"
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
        at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1224)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2248)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2208)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2189)
        at com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java:2710)
        at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3239)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1803)
        at com.mysql.jdbc.Connection.<init>(Connection.java:450)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at core.Client.<init>(Client.java:18)
        ... 1 more

Suggested fix:
I think you can fix this bug by just editing the entry of 'euc_kr' to 'euckr' in CharsetMapping.java.
[16 Mar 2005 21:22] Mark Matthews
Fixed for 3.0.17.