Parcourir la source

* Initialize fractional part of SQL_DATE_STRUCT

git-svn-id: trunk@17414 -
joost il y a 14 ans
Parent
commit
0addec8f18
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      packages/fcl-db/src/sqldb/odbc/odbcconn.pas

+ 3 - 0
packages/fcl-db/src/sqldb/odbc/odbcconn.pas

@@ -776,6 +776,9 @@ begin
     end;
     ftDateTime:           // mapped to TDateTimeField
     begin
+      // Seems like not all ODBC-drivers (mysql on Linux) set the fractional part. Initialize
+      // it's value to avoid 'random' data.
+      ODBCTimeStampStruct.Fraction:=0;
       Res:=SQLGetData(ODBCCursor.FSTMTHandle, FieldDef.Index+1, SQL_C_TYPE_TIMESTAMP, @ODBCTimeStampStruct, SizeOf(SQL_TIMESTAMP_STRUCT), @StrLenOrInd);
       if StrLenOrInd<>SQL_NULL_DATA then
       begin