3 messages in com.mysql.lists.javaRe: MySQL Connector/J Bug (?)| From | Sent On | Attachments |
|---|---|---|
| Sascha Zelzer | 28 Nov 2003 07:11 | |
| Mark Matthews | 28 Nov 2003 17:38 | |
| Sascha Zelzer | 28 Nov 2003 19:03 |
| Subject: | Re: MySQL Connector/J Bug (?)![]() |
|---|---|
| From: | Mark Matthews (ma...@mysql.com) |
| Date: | 11/28/2003 05:38:00 PM |
| List: | com.mysql.lists.java |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Sascha Zelzer wrote:
Hi!
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
This should be fixed in the nightly builds of Connector/J 3.0 (it was fixed some time back, but hasn't made it into a release yet).
Please let me know if a nightly snapshot from http://downloads.mysql.com/snapshots.php fixes the issue for you (PreparedStatement.setBlob() is used in the testsuite, and that is run on every check-in).
-Mark
- -- Mr. Mark Matthews MySQL AB, Software Development Manager, J2EE and Windows Platforms Office: +1 708 557 2388 www.mysql.com
Are you MySQL Certified? http://www.mysql.com/certification/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQE/x/iNtvXNTca6JD8RAuG2AJsE3Gj2aJ8ys5CIdOIvYqQMISq1uQCfUeBp /qk0thR8lvX7idNvCRTyx20= =A82H -----END PGP SIGNATURE-----




