=== modified file 'src/com/mysql/jdbc/PreparedStatement.java' --- src/com/mysql/jdbc/PreparedStatement.java 2013-11-21 12:31:45 +0000 +++ src/com/mysql/jdbc/PreparedStatement.java 2014-03-11 10:07:54 +0000 @@ -390,7 +390,6 @@ endpointList.add(new int[] { lastParmEnd, this.statementLength }); this.staticSql = new byte[endpointList.size()][]; - char[] asCharArray = sql.toCharArray(); for (i = 0; i < this.staticSql.length; i++) { int[] ep = endpointList.get(i); @@ -399,8 +398,8 @@ int len = end - begin; if (this.foundLoadData) { - String temp = new String(asCharArray, begin, len); - this.staticSql[i] = StringUtils.getBytes(temp); + this.staticSql[i] = StringUtils.getBytes( + sql.substring(begin, begin + len)); } else if (encoding == null) { byte[] buf = new byte[len]; @@ -416,9 +415,8 @@ .getServerCharacterEncoding(), begin, len, connection.parserKnowsUnicode(), getExceptionInterceptor()); } else { - String temp = new String(asCharArray, begin, len); - - this.staticSql[i] = StringUtils.getBytes(temp, + this.staticSql[i] = StringUtils.getBytes( + sql.substring(begin, begin + len), encoding, connection .getServerCharacterEncoding(), connection.parserKnowsUnicode(), conn, getExceptionInterceptor());