Bug #3872 | problem with ByteFX and blobs over 60KB | ||
---|---|---|---|
Submitted: | 24 May 2004 14:04 | Modified: | 28 Jul 2004 3:18 |
Reporter: | Jason Sherman | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 4.0.15 | OS: | Windows (Windows 2003 Server Standard) |
Assigned to: | Reggie Burnett | CPU Architecture: | Any |
[24 May 2004 14:04]
Jason Sherman
[23 Jun 2004 13:00]
[ name withheld ]
I'm running MySQL 4.1.2-alpha. I've a blob with 537384 bytes of data. Using MySqlDataReader, ByteFX 0.76 told me the field was 621294376 bytes long. 621294376 = 40 51 08 37 (in decimal) 537384 = 40 51 08 So we see that it's juste 37 * 256 * 256 * 256 too large. Either ByteFX reads 4bytes instead of 3, or MySQL Server should send a 0 instead of 37. Let's go into Packet.cs. ReadLenInteger() and ReadInteger(int) are the functions that reads the data length from the server's stream. I fall into case 253 in ReadLenInteger(). Okay in fact in some mode intLen will be 3 or 4 mmm interresting! Initially intLen is 3 but if you set the LongInts property as 'true', it change intLen as 4. Driver.cs : the LongInts property is set as 'true' by CreatePacket(byte[]) if the MySQL server is at least 3.22.5. I don't know the MySQL protocol, however disabled the LongInts property, and... I can read my blob! :D Note that ByteFX succesfully detected that I'm running version 4.1.2. So in a nutshell, blobs smaller than 64KB can be read, because ReadLenInteger() will read correctly one or two bytes (case 252) because the value of shortLen isn't affected by the LongInts property. In case 254, in LongInts mode, it even reads 8bytes! that's 18'446'744'073'709'551'616 bytes wow! In LongInts set as false, it's 4 bytes => 4GB max.
[25 Jun 2004 21:09]
Jason Sherman
i figured as well that it was too many bytes for the size, but I don't know, and didn't have the time/patience to trudge through the c# code to find out why. :) Has there been any more progress???
[8 Jul 2004 17:09]
Reggie Burnett
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html
[13 Jul 2004 1:59]
HYS HYS
So is this issue resolved in the latest build of mysql (4.1.3 Beta) ?
[13 Jul 2004 3:59]
Reggie Burnett
A release of Connector/Net has not been made yet. We are trying to get a version out this week.
[28 Jul 2004 0:47]
HYS HYS
Hello Sorry for being annoying. Is there any solution to this problem ? And thanks for the efforts and reply
[28 Jul 2004 3:18]
Reggie Burnett
This bug has been fixed and will be in the first release of Connector/Net