Kaynağa Gözat

* Fix for binary data in Mysql BLOB-fields

git-svn-id: trunk@6555 -
joost 18 yıl önce
ebeveyn
işleme
ef45e75993
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      fcl/db/sqldb/mysql/mysqlconn.inc

+ 3 - 1
fcl/db/sqldb/mysql/mysqlconn.inc

@@ -544,6 +544,7 @@ var
   row : MYSQL_ROW;
   C : TCursorName;
   li : longint;
+  Lengths : PDWord;
 begin
   C:=Cursor as TCursorName;
   if C.Row=nil then
@@ -552,7 +553,8 @@ begin
 
   inc(Row,c.MapDSRowToMSQLRow[FieldDef.FieldNo-1]);
 
-  li := strlen(pchar(row^));
+  Lengths := mysql_fetch_lengths(c.FRes);
+  li := Lengths[c.MapDSRowToMSQLRow[FieldDef.FieldNo-1]];
 
   ReAllocMem(ABlobBuf^.BlobBuffer^.Buffer,li);
   Move(pchar(row^)^, ABlobBuf^.BlobBuffer^.Buffer^, li);