diff --git a/source/mysql_connection.pas b/source/mysql_connection.pas index 2f97720f..c21b3e23 100644 --- a/source/mysql_connection.pas +++ b/source/mysql_connection.pas @@ -2101,18 +2101,16 @@ begin FColumnTypes[i] := Datatypes[Integer(dtSet)] else for j:=Low(Datatypes) to High(Datatypes) do begin if Field._type = Datatypes[j].NativeType then begin - if Datatypes[j].Index in [dtTinytext, dtText, dtMediumtext, dtLongtext] then begin - // Text and Blob types share the same constants (see FIELD_TYPEs in mysql_api) - // Some function results return binary collation up to the latest versions. Work around - // that by checking if this field is a real table field - // See http://bugs.mysql.com/bug.php?id=10201 - if Connection.IsUnicode then - IsBinary := (Field.charsetnr = COLLATION_BINARY) and (Field.org_table <> '') - else - IsBinary := (Field.flags and BINARY_FLAG) = BINARY_FLAG; - if IsBinary then - continue; - end; + // Text and Blob types share the same constants (see FIELD_TYPEs in mysql_api) + // Some function results return binary collation up to the latest versions. Work around + // that by checking if this field is a real table field + // See http://bugs.mysql.com/bug.php?id=10201 + if Connection.IsUnicode then + IsBinary := (Field.charsetnr = COLLATION_BINARY) and (Field.org_table <> '') + else + IsBinary := (Field.flags and BINARY_FLAG) = BINARY_FLAG; + if IsBinary and (Datatypes[j].Category = dtcText) then + continue; FColumnTypes[i] := Datatypes[j]; break; end;