Ticket #1622 (closed defect: fixed)
BLOB support in MySQL driver not working
| Reported by: | Kosta | Owned by: | mloskot |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.2 |
| Component: | OGR_SF | Version: | unspecified |
| Severity: | normal | Keywords: | MySQL BLOB |
| Cc: | warmerdam, hobu |
Description
The BLOB support in the MySQL driver is completely messed up:
- During field type determination MySQL FIELD_TYPE_BLOB is assigned as OFTString (ogrmysqlresultlayer.cpp: 163).
- The MySQL types FIELD_TYPE_TINY_BLOB, FIELD_TYPE_MEDIUM_BLOB, and FIELD_TYPE_LONG_BLOB are not handled (ogrmysqlresultlayer.cpp: 163).
- In CreateField?() the case of OFTBinary is not handled (ogrmysqltablelayer.cpp: 887).
- In CreateFeature?() (ogrmysqltablelayer.cpp: 735) the call to GetFieldAsString?() will truncate binary data to something about 40 bytes (~80 hex digits => see TEMP_BUFFER_SIZE in ogrfeature.cpp: 949).
- Binary data must/should be supplied to MySQL via "x'<hex digits>'".
A patch fixing the above issues is attached...
The patch also fixes another issue:
- Before doing an SQL command to delete a feature, InterruptLongTransaction?() has to be called (ogrmysqltablelayer.cpp: 634), otherwise I get an MySQL error Commands out of sync.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

