浏览代码

* Fixed mysql ftLargeIntField + enabled test

git-svn-id: trunk@9609 -
joost 18 年之前
父节点
当前提交
2cc3f2ebf3
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 4 3
      packages/fcl-db/src/sqldb/mysql/mysqlconn.inc
  2. 2 0
      packages/fcl-db/tests/sqldbtoolsunit.pas

+ 4 - 3
packages/fcl-db/src/sqldb/mysql/mysqlconn.inc

@@ -717,6 +717,7 @@ function TConnectionName.MySQLWriteData(AType: enum_field_types;ASize: Integer;
 
 var
   VI: Integer;
+  VL: LargeInt;
   VS: Smallint;
   VF: Double;
   VC: Currency;
@@ -749,10 +750,10 @@ begin
     FIELD_TYPE_LONGLONG:
       begin
       if (Src<>'') then
-        VI := StrToInt64(Src)
+        VL := StrToInt64(Src)
       else
-        VI := 0;
-      Move(VI, Dest^, SizeOf(LargeInt));
+        VL := 0;
+      Move(VL, Dest^, SizeOf(LargeInt));
       end;
 {$ifdef mysql50}
     FIELD_TYPE_NEWDECIMAL,

+ 2 - 0
packages/fcl-db/tests/sqldbtoolsunit.pas

@@ -103,6 +103,8 @@ begin
   if SQLDbType = MYSQL40 then Fconnection := tMySQL40Connection.Create(nil);
   if SQLDbType = MYSQL41 then Fconnection := tMySQL41Connection.Create(nil);
   if SQLDbType = MYSQL50 then Fconnection := tMySQL50Connection.Create(nil);
+  if SQLDbType in MySQLdbTypes then
+    FieldtypeDefinitions[ftLargeint] := 'BIGINT';
   if SQLDbType = sqlite3 then
     begin
     Fconnection := TSQLite3Connection.Create(nil);