Bug #46388 VB.NET get "longblob" data, the return value is "System.String"
Submitted: 26 Jul 2009 12:47 Modified: 24 Feb 2010 14:28
Reporter: David Yang Email Updates:
Status: Closed Impact on me:
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.27 OS:Microsoft Windows
Assigned to: CPU Architecture:Any
Tags: BLOB, hex, System.String

[26 Jul 2009 12:47] David Yang
I create a VB.NET program "synchronization mySQL".

the program will be Reading Data from mySQL_A to mySQL_B.

mySQL version : 4.0.24

ex : 
I have a text file, the content is "cccccc..."  (120 times 'c' words) .
Query " select filecontent from myTable limit1 "

before using MyODBC 3.51.10
the return datatype is System.Byte(), 
I can convert the Bytes Data To HEX String by myself.

but, when I using MyODBC 3.51.27
the return datatype is System.String 
(the value is not cccc..., the value has changed to 6363636363 .... )

test state...

MyODBC 3.51.10  connection  MySQL 5.0.45:"blob column" return Bytes 
MyODBC 3.51.10  connection  MySQL 4.0.24:"blob column" return Bytes

MyODBC 3.51.27  connection  MySQL 5.0.45:"blob column" return Bytes 
MyODBC 3.51.27  connection  MySQL 4.0.24:"blob column" return String (Already Change frist 100 Bytes to Hex String )

How to repeat:
install MySQL 4.0.24

Create a Text File
==(File Content is  120 times 'c' )====

Create a Table, a Column (LongBlob).

save the file to mySQL...

INSERT xxxTable( filecontent )
VALUES ( 0x636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 )

...(120 times '63')

use MyODBC 3.51.27 to Query the data...

the Return Value...is String (should be Bytes, maybe is auto changed)
【63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363                  ?_                】
ths value only first 200 word (100 times '63') ok.
(words 201 ~ 240  is bad)

Suggested fix:
[27 Jul 2009 6:43] Tonci Grgin
Hi David and thanks for your report.

Unfortunately for you, there have been many incompatible changes since MySQL server 4.0.x (which is EOL-ed btw) so you will have to upgrade server first:
"... is designed to work with all versions of MySQL from 4.1."

So please upgrade your old MySQL server and retest.
[27 Aug 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".