Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Unanswered: MySQL Connector/J Bug (?)

    Hi!

    As of my previous post, I am having troubles updating blob fields via the jdbc calls from Connector/J 3.0.9 to a MySQL 4.0.16 server on a Debian Linux system. I isolated the problem to be a weird function call in com.mysql.jdbc.PreparedStatement.java at line 358:

    ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
    bytesOut.write('\\'');
    --> escapeblockFast(x.getBytes(1, (int)x.length()), bytesOut, Integer.MAX_VALUE);

    where x is a java.sql.Blob. The function escapeblockFast() iterates over the byte[] given by the first argument Integer.MAX_VALUE times and therefore always throws an ArrayIndexOutOfBoundsException (until the byte[] has size Integer.MAX_VALUE).

    Is this bug known? Has anyone suceeded in updating blob's via the ResultSet.updateBlob() method ever?

    Thanks for comments,
    Sascha

  2. #2
    Join Date
    Mar 2004
    Posts
    1

    Re: MySQL Connector/J Bug (?)

    I had the same problem, upgraded to Connector/J 3.0.11 and it's working fine now.

    Originally posted by sascha
    Hi!

    As of my previous post, I am having troubles updating blob fields via the jdbc calls from Connector/J 3.0.9 to a MySQL 4.0.16 server on a Debian Linux system. I isolated the problem to be a weird function call in com.mysql.jdbc.PreparedStatement.java at line 358:

    ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
    bytesOut.write('\\'');
    --> escapeblockFast(x.getBytes(1, (int)x.length()), bytesOut, Integer.MAX_VALUE);

    where x is a java.sql.Blob. The function escapeblockFast() iterates over the byte[] given by the first argument Integer.MAX_VALUE times and therefore always throws an ArrayIndexOutOfBoundsException (until the byte[] has size Integer.MAX_VALUE).

    Is this bug known? Has anyone suceeded in updating blob's via the ResultSet.updateBlob() method ever?

    Thanks for comments,
    Sascha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •