Browse Source

* Support for smallint fields, bug #8417

git-svn-id: trunk@6789 -
joost 18 years ago
parent
commit
dcc62c3ccc

+ 6 - 1
packages/fcl-db/src/sqldb/interbase/ibconnection.pp

@@ -441,7 +441,7 @@ begin
           TrLen := SQLLen;
       end;
     SQL_SHORT :
-        TrType := ftInteger;
+        TrType := ftSmallint;
     SQL_LONG :
       begin
         LensSet := True;
@@ -818,6 +818,11 @@ begin
             FillByte(buffer^,sizeof(LargeInt),0);
             Move(CurrBuff^, Buffer^, SQLDA^.SQLVar[x].SQLLen);
           end;
+        ftSmallint :
+          begin
+            FillByte(buffer^,sizeof(Smallint),0);
+            Move(CurrBuff^, Buffer^, SQLDA^.SQLVar[x].SQLLen);
+          end;
         ftDate, ftTime, ftDateTime:
           GetDateTime(CurrBuff, Buffer, SQLDA^.SQLVar[x].SQLType);
         ftString  :

+ 4 - 4
packages/fcl-db/tests/database.ini

@@ -1,7 +1,7 @@
 [Database]
 ; This file contains several sections, one for each database-type. Select here
 ; which database has to be tested currently.
-type=dbf
+type=interbase
 
 
 
@@ -59,10 +59,10 @@ hostname=192.168.1.1
 [interbase]
 connector=sql
 connectorparams=interbase
-name=/path/to/database.fdb
+name=/opt/firebird/data/test.fdb
 user=sysdba
-password=masterkey
-hostname=192.168.1.1
+password=rosivrepus
+hostname=127.0.0.1
 
 [odbc]
 connector=sql

+ 1 - 1
packages/fcl-db/tests/toolsunit.pas

@@ -81,7 +81,7 @@ const
   testValuesCount = 25;
   testFloatValues : Array[0..testValuesCount-1] of double = (-maxSmallint-1,-maxSmallint,-256,-255,-128,-127,-1,0,1,127,128,255,256,maxSmallint,maxSmallint+1,0.123456,-0.123456,4.35,12.434E7,9.876e-5,123.45678,2.4,3.2,0.4,23);
   testIntValues : Array[0..testValuesCount-1] of integer = (-maxInt,-maxInt+1,-maxSmallint-1,-maxSmallint,-256,-255,-128,-127,-1,0,1,127,128,255,256,maxSmallint,maxSmallint+1,MaxInt-1,MaxInt,100,130,150,-150,-132,234);
-  testSmallIntValues : Array[0..testValuesCount-1] of smallint = (-maxSmallint,-maxSmallint+1,-256,-255,-128,-127,-1,0,1,127,128,255,256,maxSmallint,maxSmallint-1,100,110,120,130,150,-150,-132,234,231,42);
+  testSmallIntValues : Array[0..testValuesCount-1] of smallint = (-maxSmallint,-maxSmallint+1,-256,-255,-128,-127,-1,0,1,127,128,255,256,maxSmallint,maxSmallint-1,100,110,120,130,150,-150,-132,234,-15567,42);
   testLargeIntValues : Array[0..testValuesCount-1] of smallint = (-MaxSIntValue,MaxSIntValue+1,-maxInt-1,-maxInt+1,-maxSmallint,-maxSmallint+1,-256,-255,-128,-127,-1,0,1,127,128,255,256,maxSmallint,maxSmallint-1,maxSmallint+1,MaxInt-1,MaxInt,MaxSIntValue-1,MaxSIntValue,235253244);
   testBooleanValues : Array[0..testValuesCount-1] of boolean = (true,false,false,true,true,false,false,true,false,true,true,true,false,false,false,false,true,true,true,true,false,true,true,false,false);
   testStringValues : Array[0..testValuesCount-1] of string = (