If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySQL Connector/J Bug (?)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-03, 16:37
sascha sascha is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 03-08-04, 12:39
dweebo dweebo is offline
Registered User
 
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.

Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On