Description:
My mysql server 4.1.1 run with default-charset=cp1250 like
my operating system Windows XP.
When database url not contain default-charset definition then server charset is not identified properly.
Debugging give me that MySQLIO.java.serverCharsetIndex is correct and set to value 26, but in Connection.java, is line
setEncoding(CharsetMapping.INDEX_TO_CHARSET[this.io.serverCharsetIndex]);
where value 26 get Encoding = null ?
The problem is in CharsetMapping.java which contain line with definition:
INDEX_TO_CHARSET[26] = (String) MYSQL_TO_JAVA_CHARSET_MAP.get("win1250");
and this points to null !
How to repeat:
Run mysql server with default-charset=cp1250
Creat XML definition with database url that not contain default-charset definition.
Suggested fix:
CharsetMapping.java
at line 93 is :
tempMap.put("Cp1250", "Cp1250");
correct and restore value win1250 like:
tempMap.put("win1250", "Cp1250");
of course another solution is to change line:
INDEX_TO_CHARSET[26] = (String) MYSQL_TO_JAVA_CHARSET_MAP.get("win1250");
to
INDEX_TO_CHARSET[26] = (String) MYSQL_TO_JAVA_CHARSET_MAP.get("Cp1250");