Bug #66095 Multiple Blob for ODBC Driver 5.1
Submitted: 30 Jul 2012 18:29 Modified: 21 Sep 2012 12:02
Reporter: dd dd Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1 OS:Microsoft Windows (XP)
Assigned to: Bogdan Degtyariov
Tags: BLOB, Data Type, multiple, UPDATE

[30 Jul 2012 18:29] dd dd
Description:
Seem system unable to update the blob data when multiple blob is exist in one table. This problem never happen with driver 3.5. Change to 3.5 all problem solved

How to repeat:
1. Create 2 blob data type in one table
2. From application, update blob with new image data
3. Windows error will occur.

Suggested fix:
Just follow 3.5 driver
[31 Jul 2012 8:05] Bogdan Degtyariov
Hi,

Can you please be more specific about the application you use for updating image data? What error does it display?

My standard C test application updates tables with several blobs without any problems.
[31 Jul 2012 13:16] dd dd
I'm using visual basic 6 with mysql ODBC connector 5.1. Below is the sample code

sFileName = App.Path & "\tmp\BusinessPhoto.jpg"
If Dir(sFileName, vbNormal) <> "" Then
  DataStream.Type = adTypeBinary
  DataStream.Open
  DataStream.LoadFromFile sFileName
  DoEvents
  rcd.Fields("BusinessPhoto").Value = DataStream.Read
  'start load photo image
  DataStream.Close
End If
'--------------
rcd.update  <---

The problem occurs when the debugger reach update command. 

Below is the item i had done to solve this problem
1. Remove all blob type data except one blob (working fine)
2. Add another blob data type (windows encounter error and terminate my VB IDE)
3. Change mysql odbc from 5.1 to 3.5 (working fine)
[21 Sep 2012 12:02] Bogdan Degtyariov
Verified.

CREATE TABLE bug66095 (id INT PRIMARY KEY auto_increment, b1 BLOB, b2 BLOB);

The bug occurs only when you update the first BLOB column b1.
If update the last BLOB column (for instance b2) it works fine.

The workaround could be to select only one blob, which needs to be updated:

SQL = "SELECT id, b1 FROM bug66095"

However, it is a bug, which has to be fixed
[21 Sep 2012 12:03] Bogdan Degtyariov
test case

Attachment: bug66095.vbs (application/octet-stream, text), 772 bytes.

[24 Sep 2012 5:51] Bogdan Degtyariov
Trace file from the test case

Attachment: SQL_TEST_VB_002.LOG (application/octet-stream, text), 63.39 KiB.