Browse Source

--- Merging r23060 into '.':
U packages/fcl-db/tests/testfieldtypes.pas
--- Merging r23061 into '.':
G packages/fcl-db/tests/testfieldtypes.pas
--- Merging r23062 into '.':
G packages/fcl-db/tests/testfieldtypes.pas
--- Merging r23063 into '.':
U packages/fcl-db/tests/sqldbtoolsunit.pas
G packages/fcl-db/tests/testfieldtypes.pas
--- Merging r23065 into '.':
G packages/fcl-db/tests/testfieldtypes.pas
--- Merging r23067 into '.':
U packages/fcl-db/tests/tcsdfdata.pp
--- Merging r23069 into '.':
G packages/fcl-db/tests/testfieldtypes.pas
G packages/fcl-db/tests/sqldbtoolsunit.pas
--- Merging r23074 into '.':
G packages/fcl-db/tests/sqldbtoolsunit.pas
--- Merging r23075 into '.':
G packages/fcl-db/tests/testfieldtypes.pas
G packages/fcl-db/tests/sqldbtoolsunit.pas
--- Merging r23082 into '.':
G packages/fcl-db/tests/testfieldtypes.pas
--- Merging r23112 into '.':
G packages/fcl-db/tests/testfieldtypes.pas
--- Merging r23121 into '.':
G packages/fcl-db/tests/sqldbtoolsunit.pas
--- Merging r23122 into '.':
G packages/fcl-db/tests/testfieldtypes.pas
--- Merging r23125 into '.':
U packages/fcl-db/tests/README.txt

# revisions: 23060,23061,23062,23063,23065,23067,23069,23074,23075,23082,23112,23121,23122,23125
r23060 | lacak | 2012-11-26 10:02:31 +0100 (Mon, 26 Nov 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: tests: add TestLargeIntParamQuery
r23061 | lacak | 2012-11-26 10:52:04 +0100 (Mon, 26 Nov 2012) | 2 lines
Changed paths:
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: tests: formatting
(removes unneeded spaces in table definitions + adds comments to some tests where is not clear at first look what they tests)
r23062 | lacak | 2012-11-26 11:58:11 +0100 (Mon, 26 Nov 2012) | 2 lines
Changed paths:
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: test: adapt one test, which was MySQL specific to run on all sqlDB connectors.
(removed unused columns with DOUBLE data type, which is MySQL specific and prevents successful test table creation + add to GROUB BY clause column which is not part of aggregate function)
r23063 | lacak | 2012-11-26 14:08:39 +0100 (Mon, 26 Nov 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-db/tests/sqldbtoolsunit.pas
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: tests: improve testing for approximate numeric data types. SQL standard defines DOUBLE PRECISION (tested in TestSupportFloatFields), FLOAT (tested in TestFloat) and REAL (added new test TestSQLReal (single precision floating point values))
r23065 | lacak | 2012-11-27 08:19:15 +0100 (Tue, 27 Nov 2012) | 2 lines
Changed paths:
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: tests: add TestSmallIntParamQuery
(plus small cleanup)
r23067 | reiniero | 2012-11-27 11:24:20 +0100 (Tue, 27 Nov 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-db/tests/tcsdfdata.pp

- fcl-db: removed faulty sdfdataset test against sdf spec as sdfdataset must comply with the RFC4180 CSV format, see issue #22980
r23069 | lacak | 2012-11-27 13:35:06 +0100 (Tue, 27 Nov 2012) | 2 lines
Changed paths:
M /trunk/packages/fcl-db/tests/sqldbtoolsunit.pas
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: tests: adapt some tests for Interbase XE
(Interbase and Firebird are not the same; f.e. Interbase does not support BIGINT data type, CTEs, Execute block, insert returning etc.)
r23074 | lacak | 2012-11-28 12:12:09 +0100 (Wed, 28 Nov 2012) | 3 lines
Changed paths:
M /trunk/packages/fcl-db/tests/sqldbtoolsunit.pas

fcl-db: tests: use SQLServerType instead of SQLConnType.
To allow correctly testing TODBCConnection.
(we need know remote DB server to setup some tests)
r23075 | lacak | 2012-11-28 13:47:09 +0100 (Wed, 28 Nov 2012) | 3 lines
Changed paths:
M /trunk/packages/fcl-db/tests/sqldbtoolsunit.pas
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: tests:
* add new method CommitDDL to TSQLDBConnector. There is often used in tests "if SQLConnType=interbase then TSQLDBConnector(DBConnector).Transaction.CommitRetaining;" so move this to separate method and use it.
* TODBCConnection in auto commit mode does not work well for Firebird/Interbase, so switch to manual commit mode.
r23082 | lacak | 2012-11-30 09:36:18 +0100 (Fri, 30 Nov 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: tests: formatting + comments
r23112 | lacak | 2012-12-04 13:18:59 +0100 (Tue, 04 Dec 2012) | 2 lines
Changed paths:
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

fcl-db: tests: improve TestSQLInterval + comments
(MySQL ODBC driver does not correctly handles TIME values >= '100:00:00')
r23121 | lacak | 2012-12-07 12:12:14 +0100 (Fri, 07 Dec 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-db/tests/sqldbtoolsunit.pas

fcl-db: tests: starting from rev.23113 is AutoCommit OFF by default for TODBCConnection. So we does not need set it explicitly (reverts my previous commit in rev.23075)
r23122 | reiniero | 2012-12-07 12:24:13 +0100 (Fri, 07 Dec 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-db/tests/testfieldtypes.pas

* fcl-db tests: cosmetic: test using constants instead of manually assigned values that happen to be the same
r23125 | reiniero | 2012-12-08 15:54:04 +0100 (Sat, 08 Dec 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-db/tests/README.txt

* fcl-db tests: cosmetic: updated readme

git-svn-id: branches/fixes_2_6@24931 -

marco 12 years ago
parent
commit
3d25098890

+ 6 - 4
packages/fcl-db/tests/README.txt

@@ -14,8 +14,8 @@ DBTestframework architecture
 ============================
 To test a TDataset descendent, a 'connector' is needed to test the database.
 To add a new connector, create a new *toolsunit.pas file, then add it to 
-the uses section in 'dbtestframework.pas'. Several connectors are available 
-in the '*toolsunit.pas' files.
+the uses section in 'dbtestframework.pas' and 'dbtestframework_gui.lpr'.
+Several connectors are available in the '*toolsunit.pas' files.
 
 The connector must inherit from TDBConnector in toolsunit.pas.
 The connector implements two different kinds of datasets: 
@@ -28,7 +28,9 @@ The corresponding Drop*Dataset procedures must drop the tables/delete the data.
 GetNDataset and GetFieldsDataset should return the relevant dataset in closed state so the tests can open them and work with them.
 They call InternalGetNDataset and InternalGetFieldDataset which should be implemented in all descendents and returns the relevant dataset, closed, with all data.
 
-Toolsunit.pas defines some variables for use, e.g. testValuesCount is the number of records/test values in the FieldDataset dataset; MaxDataset is the same for NDataset.
+Toolsunit.pas defines some variables for use, e.g.
+- testValuesCount is the number of records/test values in the FieldDataset dataset
+- MaxDataset is the same for NDataset.
 See e.g. the SQLDBToolsUnit for the implementation for SQL Databases.
 
 Tests
@@ -68,7 +70,7 @@ TSQLDBConnector = class(TDBConnector)
 - its name in database.ini is sqldb
 - incidentally, in databases.ini, more parameter such as
 connectorparams=postgresql (which specify db type) are needed
-The parameters use depend on the connector type (sql,...)
+The parameters used depend on the connector type (sql,...)
 
 If you specify the wrong (or no) name (or don't have database.ini), you will get an exception in your test runner:
 Unknown db connector specified

+ 61 - 48
packages/fcl-db/tests/sqldbtoolsunit.pas

@@ -38,17 +38,17 @@ const MySQLConnTypes = [mysql40,mysql41,mysql50,mysql51,mysql55];
           'VARCHAR(10)',
           'SMALLINT',
           'INTEGER',
-          '',
+          '',             // ftWord
           'BOOLEAN',
-          'FLOAT',
+          'DOUBLE PRECISION', // ftFloat
           '',             // ftCurrency
           'DECIMAL(18,4)',// ftBCD
           'DATE',
           'TIME',
           'TIMESTAMP',    // ftDateTime
-          '',
-          '',
-          '',
+          '',             // ftBytes
+          '',             // ftVarBytes
+          '',             // ftAutoInc
           'BLOB',         // ftBlob
           'BLOB',         // ftMemo
           'BLOB',         // ftGraphic
@@ -58,7 +58,7 @@ const MySQLConnTypes = [mysql40,mysql41,mysql50,mysql51,mysql55];
           '',
           '',
           'CHAR(10)',     // ftFixedChar
-          '',
+          '',             // ftWideString
           'BIGINT',       // ftLargeInt
           '',
           '',
@@ -72,8 +72,8 @@ const MySQLConnTypes = [mysql40,mysql41,mysql50,mysql51,mysql55];
           '',             // ftGuid
           'TIMESTAMP',    // ftTimestamp
           'NUMERIC(18,6)',// ftFmtBCD
-          '',
-          ''
+          '',             // ftFixedWideChar
+          ''              // ftWideMemo
         );
              
 
@@ -101,6 +101,7 @@ type
   public
     destructor Destroy; override;
     constructor Create; override;
+    procedure CommitDDL;
     property Connection : TSQLConnection read FConnection;
     property Transaction : TSQLTransaction read FTransaction;
     property Query : TSQLQuery read FQuery;
@@ -181,9 +182,7 @@ begin
     end;
 
     if length(dbQuoteChars)>1 then
-      begin
-      FieldNameQuoteChars:=dbquotechars;
-      end;
+      FieldNameQuoteChars:=dbQuoteChars;
 
     Open;
   end;
@@ -200,15 +199,21 @@ begin
   FieldtypeDefinitions := FieldtypeDefinitionsConst;
 
   case SQLServerType of
-    ssFirebird, ssInterbase:
+    ssFirebird:
       begin
       FieldtypeDefinitions[ftBoolean] := '';
-      FieldtypeDefinitions[ftMemo] := 'BLOB SUB_TYPE TEXT';
+      FieldtypeDefinitions[ftMemo]    := 'BLOB SUB_TYPE TEXT';
+      end;
+    ssInterbase:
+      begin
+      FieldtypeDefinitions[ftMemo]     := 'BLOB SUB_TYPE TEXT';
+      FieldtypeDefinitions[ftLargeInt] := 'NUMERIC(18,0)';
       end;
     ssMSSQL, ssSybase:
       // todo: Sybase: copied over MSSQL; verify correctness
       begin
       FieldtypeDefinitions[ftBoolean] := 'BIT';
+      FieldtypeDefinitions[ftFloat]   := 'FLOAT';
       FieldtypeDefinitions[ftCurrency]:= 'MONEY';
       FieldtypeDefinitions[ftDate]    := 'DATETIME';
       FieldtypeDefinitions[ftTime]    := '';
@@ -222,15 +227,14 @@ begin
     ssMySQL:
       begin
       //MySQL recognizes BOOLEAN, but as synonym for TINYINT, not true sql boolean datatype
-      FieldtypeDefinitions[ftBoolean] := '';
-      FieldtypeDefinitions[ftFloat] := 'DOUBLE';
+      FieldtypeDefinitions[ftBoolean]  := '';
       // Use 'DATETIME' for datetime-fields instead of timestamp, because
       // mysql's timestamps are only valid in the range 1970-2038.
       // Downside is that fields defined as 'TIMESTAMP' aren't tested
       FieldtypeDefinitions[ftDateTime] := 'DATETIME';
-      FieldtypeDefinitions[ftBytes] := 'BINARY(5)';
+      FieldtypeDefinitions[ftBytes]    := 'BINARY(5)';
       FieldtypeDefinitions[ftVarBytes] := 'VARBINARY(10)';
-      FieldtypeDefinitions[ftMemo] := 'TEXT';
+      FieldtypeDefinitions[ftMemo]     := 'TEXT';
       end;
     ssOracle:
       begin
@@ -476,41 +480,50 @@ begin
   // exists. And while this exeption is in a try..except statement, the debugger
   // always shows the exception, which is pretty annoying.
   try
-    if SQLConnType = INTERBASE then
-      begin
-      // This only works with Firebird 2+
-      FConnection.ExecuteDirect('execute block as begin if (exists (select 1 from rdb$relations where rdb$relation_name=''' + ATableName + ''')) '+
-        'then execute statement ''drop table ' + ATAbleName + ';'';end');
-      FTransaction.CommitRetaining;
-      end;
-    if SQLConnType = mssql then
-      begin
-      // Checking is needed here to avoid getting "auto rollback" of a subsequent CREATE TABLE statement
-      // which leads to the rollback not referring to the right transaction=>SQL error
-      // Use SQL92 ISO standard INFORMATION_SCHEMA:
-      FConnection.ExecuteDirect(
-        'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_TYPE=''BASE TABLE'' AND TABLE_NAME=''' + ATableName + ''') '+
-        'begin '+
-        'drop table ' + ATAbleName + ' '+
-        'end');
-      FTransaction.CommitRetaining;
-      end;
-    if SQLConnType = sybase then
-      begin
-      // Checking is needed here to avoid getting "auto rollback" of a subsequent CREATE TABLE statement
-      // which leads to the rollback not referring to the right transaction=>SQL error
-      // Can't use SQL standard information_schema; instead query sysobjects for User tables
-      FConnection.ExecuteDirect(
-        'if exists (select * from sysobjects where type = ''U'' and name=''' + ATableName + ''') '+
-        'begin '+
-        'drop table ' + ATAbleName + ' '+
-        'end');
-      end;
+    case SQLServerType of
+      ssFirebird:
+        begin
+        // This only works with Firebird 2+
+        FConnection.ExecuteDirect('execute block as begin if (exists (select 1 from rdb$relations where rdb$relation_name=''' + ATableName + ''')) '+
+          'then execute statement ''drop table ' + ATableName + ';'';end');
+        FTransaction.CommitRetaining;
+        end;
+      ssMSSQL:
+        begin
+        // Checking is needed here to avoid getting "auto rollback" of a subsequent CREATE TABLE statement
+        // which leads to the rollback not referring to the right transaction=>SQL error
+        // Use SQL92 ISO standard INFORMATION_SCHEMA:
+        FConnection.ExecuteDirect(
+          'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_TYPE=''BASE TABLE'' AND TABLE_NAME=''' + ATableName + ''') '+
+          'begin '+
+          'drop table ' + ATableName + ' '+
+          'end');
+        end;
+      ssSybase:
+        begin
+        // Checking is needed here to avoid getting "auto rollback" of a subsequent CREATE TABLE statement
+        // which leads to the rollback not referring to the right transaction=>SQL error
+        // Can't use SQL standard information_schema; instead query sysobjects for User tables
+        FConnection.ExecuteDirect(
+          'if exists (select * from sysobjects where type = ''U'' and name=''' + ATableName + ''') '+
+          'begin '+
+          'drop table ' + ATableName + ' '+
+          'end');
+        end;
+    end;
   except
     FTransaction.RollbackRetaining;
   end;
 end;
 
+procedure TSQLDBConnector.CommitDDL;
+begin
+  // Commits schema definition and manipulation statements;
+  // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+  if SQLServerType in [ssFirebird, ssInterbase] then
+    Transaction.CommitRetaining;
+end;
+
 destructor TSQLDBConnector.Destroy;
 begin
   if assigned(FTransaction) then
@@ -521,7 +534,7 @@ begin
       Fconnection.ExecuteDirect('DROP TABLE FPDEV2');
       Ftransaction.Commit;
     Except
-      if Ftransaction.Active then Ftransaction.Rollback
+      if Ftransaction.Active then Ftransaction.Rollback;
     end; // try
     end;
   inherited Destroy;

+ 14 - 6
packages/fcl-db/tests/tcsdfdata.pp

@@ -24,7 +24,12 @@ type
     procedure TestSingleLineHeader;
     procedure TestSingleLineNoHeader;
     procedure TestOutput;
+    {
+    November 2012: this test tests again sdf;
+    however sdfdataset should comply with RFC4180 CSV, see issue #22980
+    todo: rewrite test to RFC4180
     procedure TestInputOurFormat;
+    }
     procedure TestDelimitedTextOutput;
   end;
 
@@ -128,6 +133,8 @@ begin
 end;
 
 procedure Ttestsdfspecific.TestOutput;
+// Basic assignment test: assign some difficult data to records and
+// see if the recordcount is correct.
 const
   OutputFilename='output.csv';
 begin
@@ -173,8 +180,9 @@ begin
   TestDataset.Close;
 end;
 
+{
 procedure Ttestsdfspecific.TestInputOurFormat;
-// Test if input works with our format
+// Test if input works as expected: output is written according to specs and read in.
 // Mainly check if reading quotes is according to Delphi sdf specs and works.
 // See test results from bug 19610 for evidence that the strings below should work.
 // If this works, we can switch to this and be RFC 4180 compliant and Delphi compliant.
@@ -236,15 +244,15 @@ begin
   TestDataSet.Next;
   AssertEquals(Expected7, TestDataSet.FieldByName('NAME').AsString);
 end;
+}
 
 procedure Ttestsdfspecific.TestDelimitedTextOutput;
-// Test if input works with our format
-// Mainly check if reading quotes is according to Delphi sdf specs and works.
-// See test results from bug 19610 for evidence that the strings below should work.
-// If this works, we can switch to this and be RFC 4180 compliant and Delphi compliant.
+// Test if saving and loading data keeps the original values.
+
+// Mainly check if writing & reading quotes works.
+// to do: more fully test RFC4180
 const
   OutputFileName='delim.csv';
-  //Value1 is the on disk format; it should translate to Expected1
   Value1='Delimiter,"and";quote';
   Value2='J"T"';
   Value3='Just a long line';

+ 225 - 169
packages/fcl-db/tests/testfieldtypes.pas

@@ -50,11 +50,11 @@ type
     procedure TestGetFieldNames;
     procedure TestUpdateIndexDefs;
     procedure TestMultipleFieldPKIndexDefs;
+    procedure TestGetIndexDefs;
     procedure TestSetBlobAsMemoParam;
     procedure TestSetBlobAsBlobParam;
     procedure TestSetBlobAsStringParam;
     procedure TestNonNullableParams;
-    procedure TestGetIndexDefs;
     procedure TestDblQuoteEscComments;
     procedure TestpfInUpdateFlag; // bug 7565
     procedure TestInt;
@@ -88,7 +88,9 @@ type
     procedure TestStringParamQuery;
     procedure TestFixedStringParamQuery;
     procedure TestDateParamQuery;
+    procedure TestSmallIntParamQuery;
     procedure TestIntParamQuery;
+    procedure TestLargeIntParamQuery;
     procedure TestTimeParamQuery;
     procedure TestDateTimeParamQuery;
     procedure TestFmtBCDParamQuery;
@@ -114,6 +116,7 @@ type
     procedure TestSQLLargeint;
     procedure TestSQLInterval;
     procedure TestSQLIdentity;
+    procedure TestSQLReal;
   end;
 
 implementation
@@ -184,7 +187,7 @@ begin
     AFld3.FieldName := 'CALCFLD';
     AFld3.DataSet := ds;
     Afld3.FieldKind := fkCalculated;
-    AFld3.ProviderFlags := [];
+    AFld3.ProviderFlags := [];  // do not include calculated fields into generated sql insert/update
 
     Open;
     Edit;
@@ -218,13 +221,13 @@ begin
       script.append('create table b (id int);');
       ExecuteScript;
       // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-      if SQLConnType=interbase then TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+      TSQLDBConnector(DBConnector).CommitDDL;
       end;
   finally
     TSQLDBConnector(DBConnector).Connection.ExecuteDirect('drop table a');
     TSQLDBConnector(DBConnector).Connection.ExecuteDirect('drop table b');
     // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    if SQLConnType=interbase then TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+    TSQLDBConnector(DBConnector).CommitDDL;
   end;
 end;
 
@@ -257,8 +260,8 @@ procedure TTestFieldTypes.TestLargeRecordSize;
 begin
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('create table FPDEV2 (plant varchar(8192),sampling_type varchar(8192),area varchar(8192), area_description varchar(8192), batch varchar(8192), sampling_datetime timestamp, status varchar(8192), batch_commentary varchar(8192))');
 
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-  if UpperCase(dbconnectorparams)='INTERBASE' then TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+  // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+  TSQLDBConnector(DBConnector).CommitDDL;
 
   with TSQLDBConnector(DBConnector).Query do
     begin
@@ -302,7 +305,7 @@ begin
     else
       s := ', N19_0 NUMERIC(19,0)';
     Connection.ExecuteDirect('create table FPDEV2 (FT NUMERIC(18,4), N4_2 NUMERIC(4,2), N9_3 NUMERIC(9,3), N9_5 NUMERIC(9,5), N18_0 NUMERIC(18,0), N18_3 NUMERIC(18,3), N18_5 NUMERIC(18,5)' + s + ')');
-    Transaction.CommitRetaining;
+    CommitDDL;
 
     with Query do
     begin
@@ -470,8 +473,6 @@ begin
     else
       TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FT) values (''' + testDateValues[i] + ''')');
 
-//  TSQLDBConnector(DBConnector).Transaction.CommitRetaining; // For debug-purposes
-
   with TSQLDBConnector(DBConnector).Query do
     begin
     Open;
@@ -491,7 +492,7 @@ var s : string;
 
 begin
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('create table FPDEV2 (ID int,FT '+FieldtypeDefinitions[ftblob]+')');
-  TSQLDBConnector(DBConnector).Transaction.CommitRetaining; // For interbase
+  TSQLDBConnector(DBConnector).CommitDDL;
 
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (ID,FT) values (1,''Test deze blob'')');
 
@@ -537,8 +538,6 @@ begin
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FT) values (''Test deze blob'')');
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FT) values (Null)');
 
-//  TSQLDBConnector(DBConnector).Transaction.CommitRetaining; // For debug-purposes
-
   with TSQLDBConnector(DBConnector).Query do
     begin
     Open;
@@ -568,12 +567,6 @@ begin
     end;
 end;
 
-procedure TTestFieldTypes.TestSetBlobAsStringParam;
-
-begin
-  TestSetBlobAsParam(1);
-end;
-
 
 procedure TTestFieldTypes.TestBlob;
 
@@ -583,8 +576,6 @@ begin
 
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FT) values (''Test deze blob'')');
 
-//  TSQLDBConnector(DBConnector).Transaction.CommitRetaining; // For debug-purposes
-
   with TSQLDBConnector(DBConnector).Query do
     begin
     Open;
@@ -690,8 +681,8 @@ end;
 procedure TTestFieldTypes.TestNullValues;
 begin
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('create table FPDEV2 (FIELD1 INT, FIELD2 INT)');
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-  TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+  // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+  TSQLDBConnector(DBConnector).CommitDDL;
 
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FIELD1) values (1)');
 
@@ -708,11 +699,15 @@ end;
 
 
 procedure TTestFieldTypes.TestParamQuery;
+// Tests running insert queries using parameters
+const
+  DecoyFieldData1='decoytest';
+  DecoyFieldData2=':decoy ::test $decoy2 $$2';
 begin
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('create table FPDEV2 (FIELD1 INT, FIELD2 INT, FIELD3 INT, DECOY VARCHAR(30))');
 
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-  TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+  // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+  TSQLDBConnector(DBConnector).CommitDDL;
 
   with TSQLDBConnector(DBConnector).Query do
     begin
@@ -722,7 +717,7 @@ begin
     ExecSQL;
 
     sql.clear;
-    sql.append('insert into FPDEV2 (field1,field2,decoy) values (:field1,:field2,''decoytest'')');
+    sql.append('insert into FPDEV2 (field1,field2,decoy) values (:field1,:field2,'''+DecoyFieldData1+''')');
     Params.ParamByName('field1').AsInteger := 2;
     Params.ParamByName('field2').DataType := ftInteger;
     Params.ParamByName('field2').Value := Null;
@@ -736,7 +731,7 @@ begin
     ExecSQL;
 
     sql.clear;
-    sql.append('insert into FPDEV2 (field1,field2,field3,decoy) values (:field1,:field2,:field3,'':decoy ::test $decoy2 $$2'')');
+    sql.append('insert into FPDEV2 (field1,field2,field3,decoy) values (:field1,:field2,:field3,'''+DecoyFieldData2+''')');
     Params.ParamByName('field1').AsInteger := 4;
     Params.ParamByName('field2').AsInteger := 2;
     Params.ParamByName('field3').AsInteger := 3;
@@ -759,7 +754,7 @@ begin
     AssertEquals(2,FieldByName('FIELD1').asinteger);
     AssertTrue(FieldByName('FIELD2').IsNull);
     AssertTrue(FieldByName('FIELD3').IsNull);
-    AssertEquals('decoytest',FieldByName('DECOY').AsString);
+    AssertEquals(DecoyFieldData1,FieldByName('DECOY').AsString);
     next;
     AssertEquals(3,FieldByName('FIELD1').asinteger);
     AssertEquals(2,FieldByName('FIELD2').asinteger);
@@ -769,7 +764,7 @@ begin
     AssertEquals(4,FieldByName('FIELD1').asinteger);
     AssertEquals(2,FieldByName('FIELD2').asinteger);
     AssertEquals(3,FieldByName('FIELD3').asinteger);
-    AssertEquals(':decoy ::test $decoy2 $$2',FieldByName('DECOY').AsString);
+    AssertEquals(DecoyFieldData2,FieldByName('DECOY').AsString);
     next;
     AssertEquals(5,FieldByName('FIELD1').asinteger);
     AssertEquals(2,FieldByName('FIELD2').asinteger);
@@ -781,14 +776,24 @@ begin
   TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
 end;
 
+procedure TTestFieldTypes.TestSmallIntParamQuery;
+begin
+  TestXXParamQuery(ftSmallInt,FieldtypeDefinitions[ftSmallInt],testValuesCount);
+end;
+
 procedure TTestFieldTypes.TestIntParamQuery;
 begin
   TestXXParamQuery(ftInteger,'INT',testIntValuesCount);
 end;
 
+procedure TTestFieldTypes.TestLargeIntParamQuery;
+begin
+  TestXXParamQuery(ftLargeInt,FieldtypeDefinitions[ftLargeInt],testValuesCount);
+end;
+
 procedure TTestFieldTypes.TestFmtBCDParamQuery;
 begin
-  TestXXParamQuery(ftFMTBcd,FieldtypeDefinitionsConst[ftFMTBcd],testValuesCount);
+  TestXXParamQuery(ftFMTBcd,FieldtypeDefinitions[ftFMTBcd],testValuesCount);
 end;
 
 procedure TTestFieldTypes.TestDateParamQuery;
@@ -796,6 +801,11 @@ begin
   TestXXParamQuery(ftDate,FieldtypeDefinitions[ftDate],testDateValuesCount);
 end;
 
+procedure TTestFieldTypes.TestCrossStringDateParam;
+begin
+  TestXXParamQuery(ftDate,FieldtypeDefinitions[ftDate],testDateValuesCount,True);
+end;
+
 procedure TTestFieldTypes.TestTimeParamQuery;
 begin
   TestXXParamQuery(ftTime,FieldtypeDefinitions[ftTime],testValuesCount);
@@ -854,8 +864,8 @@ begin
 
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('create table FPDEV2 (ID INT, FIELD1 '+ASQLTypeDecl+')');
 
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-  if SQLConnType=interbase then TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+  // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+  TSQLDBConnector(DBConnector).CommitDDL;
 
   with TSQLDBConnector(DBConnector).Query do
     begin
@@ -870,7 +880,9 @@ begin
       begin
       Params.ParamByName('id').AsInteger := i;
       case ADataType of
-        ftInteger: Params.ParamByName('field1').asInteger := testIntValues[i];
+        ftSmallInt: Params.ParamByName('field1').AsSmallInt := testSmallIntValues[i];
+        ftInteger: Params.ParamByName('field1').AsInteger := testIntValues[i];
+        ftLargeInt: Params.ParamByName('field1').AsLargeInt := testLargeIntValues[i];
         ftBoolean: Params.ParamByName('field1').AsBoolean := testBooleanValues[i];
         ftFloat  : Params.ParamByName('field1').AsFloat   := testFloatValues[i];
         ftBCD    : Params.ParamByName('field1').AsCurrency:= testBCDValues[i];
@@ -906,7 +918,9 @@ begin
       begin
       AssertEquals(i,FieldByName('ID').AsInteger);
       case ADataType of
+        ftSmallInt: AssertEquals(testSmallIntValues[i],FieldByName('FIELD1').AsInteger);
         ftInteger: AssertEquals(testIntValues[i],FieldByName('FIELD1').AsInteger);
+        ftLargeInt: AssertEquals(testLargeIntValues[i],FieldByName('FIELD1').AsLargeInt);
         ftBoolean: AssertEquals(testBooleanValues[i],FieldByName('FIELD1').AsBoolean);
         ftFloat  : AssertEquals(testFloatValues[i],FieldByName('FIELD1').AsFloat);
         ftBCD    : AssertEquals(testBCDValues[i],FieldByName('FIELD1').AsCurrency);
@@ -928,10 +942,12 @@ begin
   TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
 end;
 
+
 procedure TTestFieldTypes.TestSetBlobAsParam(asWhat: integer);
+const
+  TestValue='Test deze BLob';
 var
   ASQL          : TSQLQuery;
-
 begin
   CreateTableWithFieldType(ftBlob,FieldtypeDefinitions[ftBlob]);
   TestFieldDeclaration(ftBlob,0);
@@ -941,9 +957,9 @@ begin
     begin
     sql.Text := 'insert into FPDEV2 (FT) values (:BlobParam)';
     case asWhat of
-      0: Params.ParamByName('blobParam').AsMemo := 'Test deze BLob';
-      1: Params.ParamByName('blobParam').AsString := 'Test deze BLob';
-      2: Params.ParamByName('blobParam').AsBlob := 'Test deze BLob';
+      0: Params.ParamByName('blobParam').AsMemo := TestValue;
+      1: Params.ParamByName('blobParam').AsString := TestValue;
+      2: Params.ParamByName('blobParam').AsBlob := TestValue;
     end;
     ExecSQL;
     end;
@@ -952,16 +968,34 @@ begin
     begin
     Open;
     if not eof then
-      AssertEquals('Test deze BLob',fields[0].AsString);
+      AssertEquals(TestValue, Fields[0].AsString);
     close;
     end;
 end;
 
+procedure TTestFieldTypes.TestSetBlobAsMemoParam;
+begin
+  // Firebird/Interbase ODBC driver : if parameter of ValueType=SQL_C_CHAR is bind to BLOB column
+  // driver interprets character data as hexadecimal string and performs conversion ('FF10'=#255#16)
+  TestSetBlobAsParam(0);
+end;
+
+procedure TTestFieldTypes.TestSetBlobAsStringParam;
+begin
+  TestSetBlobAsParam(1);
+end;
+
+procedure TTestFieldTypes.TestSetBlobAsBlobParam;
+begin
+  TestSetBlobAsParam(2);
+end;
+
+
 procedure TTestFieldTypes.TestAggregates;
 begin
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('create table FPDEV2 (FIELD1 INT, FIELD2 INT)');
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-  TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+  // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+  TSQLDBConnector(DBConnector).CommitDDL;
 
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 values (1,1)');
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 values (2,3)');
@@ -1001,7 +1035,7 @@ begin
   begin
     Connection.ExecuteDirect('create table FPDEV2 (FT ' +ASQLTypeDecl+ ')');
     // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    Transaction.CommitRetaining;
+    CommitDDL;
   end;
 end;
 
@@ -1021,24 +1055,6 @@ begin
     end;
 end;
 
-procedure TTestFieldTypes.SetUp;
-begin
-  InitialiseDBConnector;
-end;
-
-procedure TTestFieldTypes.TearDown;
-begin
-  if assigned(DBConnector) then
-    TSQLDBConnector(DBConnector).Transaction.Rollback;
-  FreeDBConnector;
-end;
-
-procedure TTestFieldTypes.RunTest;
-begin
-//  if (SQLConnType in TSQLConnType) then
-    inherited RunTest;
-end;
-
 procedure TTestFieldTypes.TestQueryAfterReconnect;
 var DS: TDataset;
 begin
@@ -1220,7 +1236,7 @@ end;
 
 procedure TTestFieldTypes.TestInsertReturningQuery;
 begin
-  if not(SQLConnType in [postgresql,interbase,oracle]) then Ignore(STestNotApplicable);
+  if not(SQLServerType in [ssFirebird, ssOracle, ssPostgreSQL]) then Ignore(STestNotApplicable);
   with TSQLDBConnector(DBConnector) do
     begin
     // This only works with databases that supports 'insert into .. returning'
@@ -1291,26 +1307,25 @@ begin
   // at least one row must be returned
   with TSQLDBConnector(DBConnector) do
   begin
-    case SQLConnType of
-      sqlite3:
+    case SQLServerType of
+      ssSQLite:
         statements := TTestStatements.Create('pragma table_info(FPDEV)');
-      interbase:
+      ssFirebird:
         statements := TTestStatements.Create(
           CTE_SELECT (*FB 2.1*),
           'EXECUTE BLOCK RETURNS (U VARCHAR(255)) AS BEGIN SELECT rdb$get_context(''SYSTEM'',''CURRENT_USER'') FROM rdb$database INTO U; SUSPEND; END' (*FB 2.0*)
         );
-      postgresql:
+      ssPostgreSQL:
         statements := TTestStatements.Create(CTE_SELECT);
-      mssql:
+      ssMSSQL:
         statements := TTestStatements.Create(CTE_SELECT  (*MS SQL 2005*));
+      ssMySQL:
+        statements := TTestStatements.Create(
+          'check table FPDEV',  // bug 14519
+          'show tables from '+Connection.DatabaseName  // bug 16842
+        )
       else
-        if SQLConnType in MySQLConnTypes then
-          statements := TTestStatements.Create(
-            'check table FPDEV',  // bug 14519
-            'show tables from '+Connection.DatabaseName  // bug 16842
-          )
-        else
-          Ignore(STestNotApplicable);
+        Ignore(STestNotApplicable);
     end;
 
     for s in statements do
@@ -1505,13 +1520,14 @@ const
 begin
   with TSQLDBConnector(DBConnector) do
     begin
-    Connection.ExecuteDirect('create table FPDEV2 (         ' +
-                              '  ID INT NOT NULL          , ' +
-                              '  NAME VARCHAR(16000),       ' +
-                              '  PRIMARY KEY (ID)           ' +
-                              ')                            ');
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+    Connection.ExecuteDirect('create table FPDEV2 (  ' +
+                              '  ID INT NOT NULL ,   ' +
+                              '  NAME VARCHAR(16000),' +
+                              '  PRIMARY KEY (ID)    ' +
+                              ')                     ');
+    // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+    TSQLDBConnector(DBConnector).CommitDDL;
+
     query.sql.Text:='select * from FPDEV2';
     Query.Open;
     Query.InsertRecord([1,FieldValue]);
@@ -1527,13 +1543,14 @@ procedure TTestFieldTypes.TestNumericNames;
 begin
   with TSQLDBConnector(DBConnector) do
     begin
-    Connection.ExecuteDirect('create table FPDEV2 (         ' +
-                              '  '+connection.FieldNameQuoteChars[0]+'2ID'+connection.FieldNameQuoteChars[1]+' INT NOT NULL, ' +
-                              '  '+connection.FieldNameQuoteChars[0]+'3TEST'+connection.FieldNameQuoteChars[1]+' VARCHAR(10), ' +
+    Connection.ExecuteDirect('create table FPDEV2 (' +
+                              '  '+connection.FieldNameQuoteChars[0]+'2ID'+connection.FieldNameQuoteChars[1]+' INT NOT NULL,' +
+                              '  '+connection.FieldNameQuoteChars[0]+'3TEST'+connection.FieldNameQuoteChars[1]+' VARCHAR(10),' +
                               '  PRIMARY KEY ('+connection.FieldNameQuoteChars[0]+'2ID'+connection.FieldNameQuoteChars[0]+') ' +
-                              ')                            ');
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+                              ') ');
+    // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+    TSQLDBConnector(DBConnector).CommitDDL;
+
     with query do
       begin
       SQL.Text:='select * from FPDEV2';
@@ -1562,13 +1579,14 @@ begin
   with TSQLDBConnector(DBConnector) do
     begin
     AssertEquals(-1,query.RowsAffected);
-    Connection.ExecuteDirect('create table FPDEV2 (         ' +
-                              '  ID INT NOT NULL            , ' +
-                              '  '+Connection.FieldNameQuoteChars[0]+'NAME-TEST'+Connection.FieldNameQuoteChars[1]+' VARCHAR(250),  ' +
-                              '  PRIMARY KEY (ID)           ' +
-                              ')                            ');
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+    Connection.ExecuteDirect('create table FPDEV2 (' +
+                              '  ID INT NOT NULL,  ' +
+                              '  '+Connection.FieldNameQuoteChars[0]+'NAME-TEST'+Connection.FieldNameQuoteChars[1]+' VARCHAR(250), ' +
+                              '  PRIMARY KEY (ID)  ' +
+                              ')                   ');
+    // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+    TSQLDBConnector(DBConnector).CommitDDL;
+
     Connection.ExecuteDirect('insert into FPDEV2(ID,'+Connection.FieldNameQuoteChars[0]+'NAME-TEST'+Connection.FieldNameQuoteChars[1]+') values (1,''test1'')');
     Query.SQL.Text := 'select * from FPDEV2';
     Query.Open;
@@ -1655,13 +1673,14 @@ begin
   with TSQLDBConnector(DBConnector) do
     begin
     AssertEquals(-1,query.RowsAffected);
-    Connection.ExecuteDirect('create table FPDEV2 (         ' +
-                              '  ID INT NOT NULL            , ' +
-                              '  NAME VARCHAR(250),         ' +
-                              '  PRIMARY KEY (ID)           ' +
-                              ')                            ');
-// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+    Connection.ExecuteDirect('create table FPDEV2 (' +
+                              '  ID INT NOT NULL,  ' +
+                              '  NAME VARCHAR(250),' +
+                              '  PRIMARY KEY (ID)  ' +
+                              ')                   ');
+    // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+    TSQLDBConnector(DBConnector).CommitDDL;
+
     Query.SQL.Text := 'insert into FPDEV2(ID,NAME) values (1,''test1'')';
     Query.ExecSQL;
     AssertEquals(1,query.RowsAffected);
@@ -1720,7 +1739,7 @@ begin
     begin
     Connection.ExecuteDirect('create table FPDEV2 (id1 int, id2 int,vchar varchar(10))');
     // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+    TSQLDBConnector(DBConnector).CommitDDL;
 
     Query.sql.Text := 'insert into FPDEV2 values(:id1,:id2,:vchar)';
     query.params[0].asinteger := 1;
@@ -1743,7 +1762,7 @@ begin
     begin
     Connection.ExecuteDirect('create table FPDEV2 (id1 int, id2 int, id3 int, id4 int,id5 int,id6 int,id7 int,id8 int, id9 int, id10 int, id11 int)');
     // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+    TSQLDBConnector(DBConnector).CommitDDL;
 
     Query.sql.Text := 'insert into FPDEV2 values(:id1,:id2,:id3,:id4,:id5,:id6,:id7,:id8,:id9,:id10,:id11)';
     for i := 0 to 10 do
@@ -1760,43 +1779,37 @@ end;
 procedure TTestFieldTypes.TestBug9744;
 var i : integer;
 begin
-  if not(SQLServerType in [ssMySQL, ssSQLite]) then Ignore('This test does not apply to this db-engine, since it has no double field-type');
-
+  // Tests rev.8703: "Fixed MySQL ftLargeInt support"; count() returns BIGINT values
   with TSQLDBConnector(DBConnector) do
     begin
     try
-      Connection.ExecuteDirect('create table TTTOBJ (         ' +
-                                '  ID INT NOT NULL,           ' +
-                                '  NAME VARCHAR(250),         ' +
-                                '  PRIMARY KEY (ID)           ' +
-                                ')                            ');
-      Connection.ExecuteDirect('create table TTTXY (          ' +
-                                '  ID INT NOT NULL,           ' +
-                                '  NP INT NOT NULL,           ' +
-                                '  X DOUBLE,                  ' +
-                                '  Y DOUBLE,                  ' +
-                                '  PRIMARY KEY (ID,NP)        ' +
-                                ')                            ');
+      Connection.ExecuteDirect('create table TTTOBJ ( ' +
+                                '  ID INT NOT NULL,   ' +
+                                '  NAME VARCHAR(250), ' +
+                                '  PRIMARY KEY (ID)   ' +
+                                ')                    ');
+      Connection.ExecuteDirect('create table TTTXY (  ' +
+                                '  ID INT NOT NULL,   ' +
+                                '  NP INT NOT NULL,   ' +
+                                '  PRIMARY KEY (ID,NP)' +
+                                ')                    ');
+      Transaction.CommitRetaining;
       for i := 0 to 7 do
         begin
         connection.ExecuteDirect('insert into TTTOBJ(ID,NAME) values ('+inttostr(i)+',''A'+inttostr(i)+''')');
-        connection.ExecuteDirect('insert into TTTXY(ID,NP,X,Y) values ('+inttostr(i)+',1,1,1)');
-        connection.ExecuteDirect('insert into TTTXY(ID,NP,X,Y) values ('+inttostr(i)+',2,2,2)');
+        connection.ExecuteDirect('insert into TTTXY(ID,NP) values ('+inttostr(i)+',1)');
+        connection.ExecuteDirect('insert into TTTXY(ID,NP) values ('+inttostr(i)+',2)');
         end;
-      Query.SQL.Text := 'select OBJ.ID, OBJ.NAME, count(XY.NP) as NPF from TTTOBJ as OBJ, TTTXY as XY where (OBJ.ID=XY.ID) group by OBJ.ID';
+      Query.SQL.Text := 'select OBJ.ID, OBJ.NAME, count(XY.NP) as NPF from TTTOBJ OBJ, TTTXY XY where OBJ.ID=XY.ID group by OBJ.ID, OBJ.NAME';
       query.Prepare;
       query.open;
       query.close;
     finally
       Connection.ExecuteDirect('drop table TTTXY');
       Connection.ExecuteDirect('drop table TTTOBJ');
-      end
-    end;
-end;
-
-procedure TTestFieldTypes.TestCrossStringDateParam;
-begin
-  TestXXParamQuery(ftDate,'DATE',testDateValuesCount,True);
+      Transaction.CommitRetaining;
+    end
+  end;
 end;
 
 procedure TTestFieldTypes.TestGetFieldNames;
@@ -1903,7 +1916,7 @@ begin
 end;
 
 var testIntervalValuesCount: integer;
-const testIntervalValues: array[0..4] of shortstring = ('00:00:00.000','00:00:01.000','23:59:59.000','838:59:59.000','1000:00:00.000');
+const testIntervalValues: array[0..5] of shortstring = ('00:00:00.000','00:00:01.000','23:59:59.000','99:59:59.000','838:59:59.000','1000:00:00.000');
 // Placed here, as long as bug 18702 is not solved
 function TestSQLInterval_GetSQLText(const a: integer) : string;
 begin
@@ -1925,7 +1938,7 @@ begin
   if SQLConnType = postgresql then
   begin
     datatype:='INTERVAL';
-    testIntervalValuesCount := 5;
+    testIntervalValuesCount := 6;
   end
   else
   begin
@@ -1933,9 +1946,10 @@ begin
     if datatype = '' then
       Ignore(STestNotApplicable);
     if SQLServerType = ssSQLite then
-      testIntervalValuesCount := 5
+      testIntervalValuesCount := 6
     else if SQLServerType = ssMySQL then
-      testIntervalValuesCount := 4
+      // MySQL ODBC driver does not correctly handles time values >= '100:00:00'
+      testIntervalValuesCount := 5
     else
       testIntervalValuesCount := 3;
   end;
@@ -2023,9 +2037,41 @@ begin
   end;
 end;
 
+function TestSQLReal_GetSQLText(const i: integer) : string;
+begin
+  if i < 20 then // first 20 values fit into MySQL FLOAT data type
+    Result := FloatToStr(testFloatValues[i], DBConnector.FormatSettings)
+  else
+    Result := 'NULL';
+end;
+procedure TTestFieldTypes.TestSQLReal;
+  procedure CheckFieldValue(AField:TField; i: integer);
+  begin
+    if i < 20 then
+      AssertEquals(testFloatValues[i], AField.AsFloat)
+    else
+      AssertTrue(AField.IsNull);
+  end;
+var datatype: string;
+begin
+  case SQLServerType of
+    ssFirebird, ssInterbase,
+    ssMySQL:
+      datatype:='FLOAT';
+    else
+      datatype:='REAL';
+  end;
+  TestSQLFieldType(ftFloat, datatype, sizeof(double), @TestSQLReal_GetSQLText, @CheckFieldValue);
+end;
+
 procedure TTestFieldTypes.TestUpdateIndexDefs;
 var ds : TSQLQuery;
 begin
+  // Firebird/Interbase ODBC driver returns for :
+  //   SQLPrimaryKeys (PK_NAME): RDB$RELATION_CONSTRAINTS(RDB$CONSTRAINT_NAME)
+  //   SQLStatistics (INDEX_NAME): RDB$INDICES(RDB$INDEX_NAME)
+  // these two names can differ (when PRIMARY KEY is created without giving constraint name),
+  // therefore two indexes may be created instead of one (see TODBCConnection.UpdateIndexDefs)
   ds := DBConnector.GetNDataset(1) as TSQLQuery;
   ds.Prepare;
   ds.ServerIndexDefs.Update;
@@ -2042,14 +2088,13 @@ procedure TTestFieldTypes.TestMultipleFieldPKIndexDefs;
 var ds : TSQLQuery;
 begin
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('create table FPDEV2 (' +
-                              '  ID1 INT NOT NULL,           ' +
-                              '  ID2 INT NOT NULL,           ' +
-                              '  NAME VARCHAR(50),           ' +
-                              '  PRIMARY KEY (ID1, ID2)      ' +
-                              ')                            ');
-
+                              '  ID1 INT NOT NULL,     ' +
+                              '  ID2 INT NOT NULL,     ' +
+                              '  NAME VARCHAR(50),     ' +
+                              '  PRIMARY KEY (ID1, ID2)' +
+                              ')                       ');
   // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-  if SQLConnType=interbase then TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+  TSQLDBConnector(DBConnector).CommitDDL;
 
   ds := TSQLDBConnector(DBConnector).Query;
   ds.sql.Text:='select * from FPDEV2';
@@ -2060,19 +2105,36 @@ begin
   Asserttrue(ds.ServerIndexDefs[0].Options=[ixPrimary,ixUnique]);
 end;
 
+procedure TTestFieldTypes.TestGetIndexDefs;
 
-procedure TTestFieldTypes.TestSetBlobAsMemoParam;
-begin
-  TestSetBlobAsParam(0);
-end;
+var ds : TSQLQuery;
+    inddefs : TIndexDefs;
 
-procedure TTestFieldTypes.TestSetBlobAsBlobParam;
 begin
-  TestSetBlobAsParam(2);
+  ds := DBConnector.GetNDataset(1) as TSQLQuery;
+  ds.Open;
+  AssertEquals('ServerIndexDefs.Count', 1, ds.ServerIndexDefs.Count);
+  inddefs := HackedDataset(ds).GetIndexDefs(ds.ServerIndexDefs,[ixPrimary]);
+  AssertEquals('ixPrimary', 1, inddefs.count);
+  AssertTrue(CompareText('ID',inddefs[0].Fields)=0);
+  AssertTrue(inddefs[0].Options=[ixPrimary,ixUnique]);
+  inddefs.Free;
+
+  inddefs := HackedDataset(ds).GetIndexDefs(ds.ServerIndexDefs,[ixPrimary,ixUnique]);
+  AssertEquals('ixPrimary,ixUnique', 1, inddefs.count);
+  AssertTrue(CompareText('ID',inddefs[0].Fields)=0);
+  AssertTrue(inddefs[0].Options=[ixPrimary,ixUnique]);
+  inddefs.Free;
+
+  inddefs := HackedDataset(ds).GetIndexDefs(ds.ServerIndexDefs,[ixDescending]);
+  AssertEquals('ixDescending', 0, inddefs.count);
+  inddefs.Free;
 end;
 
+
 procedure TTestFieldTypes.TestTemporaryTable;
 begin
+  // Tests rev.6481: "Do not use a new connection for every statement that is executed";
   if SQLServerType in [ssMSSQL, ssSybase] then Ignore('This test does not apply to this sqldb-connection type, since it doesn''t support temporary tables');
 
   with TSQLDBConnector(DBConnector).Query do
@@ -2087,7 +2149,7 @@ begin
     ExecSQL;
     try
       // Firebird/Interbase needs a commit after DDL:
-      TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+      TSQLDBConnector(DBConnector).CommitDDL;
 
       SQL.Text := 'INSERT INTO FPDEV_TEMP(id) values (5)';
       ExecSQL;
@@ -2101,38 +2163,12 @@ begin
         begin
         SQL.Text := 'DROP TABLE FPDEV_TEMP';
         ExecSQL;
-        TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
+        TSQLDBConnector(DBConnector).CommitDDL;
         end;
     end;
     end;
 end;
 
-procedure TTestFieldTypes.TestGetIndexDefs;
-
-var ds : TSQLQuery;
-    inddefs : TIndexDefs;
-
-begin
-  ds := DBConnector.GetNDataset(1) as TSQLQuery;
-  ds.Open;
-  AssertEquals('ServerIndexDefs.Count', 1, ds.ServerIndexDefs.Count);
-  inddefs := HackedDataset(ds).GetIndexDefs(ds.ServerIndexDefs,[ixPrimary]);
-  AssertEquals('ixPrimary', 1, inddefs.count);
-  AssertTrue(CompareText('ID',inddefs[0].Fields)=0);
-  AssertTrue(inddefs[0].Options=[ixPrimary,ixUnique]);
-  inddefs.Free;
-
-  inddefs := HackedDataset(ds).GetIndexDefs(ds.ServerIndexDefs,[ixPrimary,ixUnique]);
-  AssertEquals('ixPrimary,ixUnique', 1, inddefs.count);
-  AssertTrue(CompareText('ID',inddefs[0].Fields)=0);
-  AssertTrue(inddefs[0].Options=[ixPrimary,ixUnique]);
-  inddefs.Free;
-
-  inddefs := HackedDataset(ds).GetIndexDefs(ds.ServerIndexDefs,[ixDescending]);
-  AssertEquals('ixDescending', 0, inddefs.count);
-  inddefs.Free;
-end;
-
 procedure TTestFieldTypes.TestDblQuoteEscComments;
 begin
   with TSQLDBConnector(DBConnector).Query do
@@ -2219,6 +2255,26 @@ begin
     end;
 end;
 
+
+procedure TTestFieldTypes.SetUp;
+begin
+  InitialiseDBConnector;
+end;
+
+procedure TTestFieldTypes.TearDown;
+begin
+  if assigned(DBConnector) then
+    TSQLDBConnector(DBConnector).Transaction.Rollback;
+  FreeDBConnector;
+end;
+
+procedure TTestFieldTypes.RunTest;
+begin
+//  if (SQLConnType in TSQLConnType) then
+    inherited RunTest;
+end;
+
+
 initialization
   if uppercase(dbconnectorname)='SQL' then RegisterTest(TTestFieldTypes);
 end.