Description:
'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.