From 1e03f4b0b56fc48b22039338d4e47404160d8da7 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Mon, 24 Oct 2016 19:34:07 +0000 Subject: [PATCH] Remove quirky logic from TMySQLQuery.Execute when distinguishing between text and binary data types. See http://www.heidisql.com/forum.php?t=22441 --- source/dbconnection.pas | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index f5d3d173..160e9a01 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -5420,19 +5420,18 @@ begin FColumnTypes[i] := FConnection.Datatypes[j]; end else if Field._type = Cardinal(FConnection.Datatypes[j].NativeType) then begin // Text and Blob types share the same constants (see FIELD_TYPEs) - // 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 + // See http://dev.mysql.com/doc/refman/5.7/en/c-api-data-structures.html if Connection.IsUnicode then - IsBinary := (Field.charsetnr = COLLATION_BINARY) and (Field.org_table <> '') + IsBinary := Field.charsetnr = COLLATION_BINARY else IsBinary := (Field.flags and BINARY_FLAG) = BINARY_FLAG; - if IsBinary and (FConnection.Datatypes[j].Index in [dtTinytext..dtLongtext]) then + if IsBinary and (FConnection.Datatypes[j].Index in [dtChar..dtLongtext]) then continue; FColumnTypes[i] := FConnection.Datatypes[j]; break; end; end; + FConnection.Log(lcDebug, 'Detected column type for '+FColumnNames[i]+': '+FColumnTypes[i].Name); end; FRecNo := -1; First;