Opened 16 years ago

Closed 16 years ago

#2741 closed defect (invalid)

MySQL TEXT field displayed as BLOB (hex numbers)

Reported by: oldbucsfan Owned by: dmorissette
Priority: high Milestone: 5.2 release
Component: OGR Support Version: 5.2
Severity: major Keywords: MySQL, OGR, MapServer, Mapscript, Text, Blob, Hex
Cc: warmerdam

Description

When getting a row returned in from a MySQL database using a OGR connection in a ms layer, if a field is of type 'LONGTEXT' (i think any TEXT field - non varchar or char) the data that is returned is in hex numbers as if the field was type 'LONGBLOB'. Blob and Text fields are very similar in MySQL and testing the difference requires finding out if the field has been flagged as binary (BLOB) or not (TEXT).

Tried using PHP/Mapscript versions 2.2.7 and 2.2.8 which were build with Mapserver 5.0.2 and 5.2.

Example layer:

LAYER

NAME "Sites" STATUS OFF GROUP "Sites" TYPE POINT TOLERANCE 8 TOLERANCEUNITS pixels CONNECTIONTYPE OGR CONNECTION "MYSQL:test,user=username,password=pass" DATA "Select * from site_point"

TEMPLATE "void"

METADATA

"DESCRIPTION" "Sites" "RESULT_FIELDS" "SiteNumber,SiteName,cultaffil" "RESULT_HEADERS" "Site Number,Site Name,Cultural Affiliation" "RESULT_HYPERLINK" "SiteNumber" "LAYER_ENCODING" "UTF-8" "ows_title" "Sites"

END # Metadata

END

Change History (3)

comment:1 by dmorissette, 16 years ago

Cc: warmerdam added

MapServer doesn't have knowledge of specifics like this from the data source and cannot do much abou tthis.

I suspect the issue is that the MySQL driver at the OGR level needs to be enhanced to properly handle (i.e. decode) LONGTEXT field type and return that as regular text data.

Adding Frank to CC to get his comments.

comment:2 by oldbucsfan, 16 years ago

Wanted to correct some info above. I am using MapServer for Windows versions 2.2.7 and 2.2.8.

comment:3 by warmerdam, 16 years ago

Resolution: invalid
Status: newclosed

I concur. This is an OGR issue. I would suggest refiling this in the GDAL/OGR trac at:

http://trac.osgeo.org/gdal

Please include some details on how to create and populate a small test table that demonstrates this problem. (ie. the create table, and insert statements, and the corresponding ogrinfo output).

Note: See TracTickets for help on using tickets.