View Issue Details

IDProjectCategoryView StatusLast Update
0025420FPCPatchpublic2014-03-04 17:54
ReporterBigChimpAssigned ToMarco van de Voort 
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx64 (with x86 compiler)OSWindowsOS VersionWindows 7
Product Version2.6.4Product Build 
Target VersionFixed in Version2.6.4 
Summary0025420: [Patch] Fix for packages/fcl-db/tests/dbtestframework.pas compile errors
DescriptionCompiling testfieldtypes.pas
testfieldtypes.pas(1276,39) Error: Illegal qualifier
testfieldtypes.pas(1278,39) Error: Illegal qualifier
testfieldtypes.pas(1283,39) Error: Illegal qualifier
testfieldtypes.pas(1285,39) Error: Illegal qualifier
testfieldtypes.pas(1287,39) Error: Illegal qualifier
testfieldtypes.pas(2158,14) Warning: Class types "TSQLQuery" and "HackedDataset" are not related
testfieldtypes.pas(2164,14) Warning: Class types "TSQLQuery" and "HackedDataset" are not related
testfieldtypes.pas(2170,14) Warning: Class types "TSQLQuery" and "HackedDataset" are not related
testfieldtypes.pas(2327) Fatal: There were 5 errors compiling module, stopping
Fatal: Compilation aborted
Error: /home/pascaldev/264/bin/x86_64-linux/ppcx64 returned an error exitcode (normal if you did not

Laco:it is because there is used array constructor, which was introduced in FPC>=2.7.1
 solution is remove whole test TTestFieldTypes.TestOpenSpecialStatements from testfieldtypes.pas

Attached patch against 2.6.4RC1 fixes this and dbtestframework.pas compiles
TagsNo tags attached.
Fixed in Revisionr26229
FPCOldBugId0
FPCTarget
Attached Files
  • 264_dbtestfix.diff (2,157 bytes)
    Index: packages/fcl-db/tests/testfieldtypes.pas
    ===================================================================
    --- packages/fcl-db/tests/testfieldtypes.pas	(revision 26227)
    +++ packages/fcl-db/tests/testfieldtypes.pas	(working copy)
    @@ -60,7 +60,6 @@
         procedure TestDblQuoteEscComments;
         procedure TestInsertReturningQuery;
         procedure TestOpenStoredProc;
    -    procedure TestOpenSpecialStatements;
         
         procedure TestTemporaryTable;
         procedure TestRefresh;
    @@ -1261,49 +1260,6 @@
       end;
     end;
     
    -procedure TTestFieldTypes.TestOpenSpecialStatements;
    -const CTE_SELECT = 'WITH a AS (SELECT * FROM FPDEV) SELECT * FROM a';
    -type TTestStatements = array of string;
    -var statements: TTestStatements;
    -    s: string;
    -begin
    -  // tests non-select statements (other than "SELECT ..."), which return result-set
    -  // at least one row must be returned
    -  with TSQLDBConnector(DBConnector) do
    -  begin
    -    case SQLServerType of
    -      ssSQLite:
    -        statements := TTestStatements.Create('pragma table_info(FPDEV)');
    -      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*)
    -        );
    -      ssPostgreSQL:
    -        statements := TTestStatements.Create(CTE_SELECT, 'EXPLAIN '+CTE_SELECT);
    -      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
    -        Ignore(STestNotApplicable);
    -    end;
    -
    -    for s in statements do
    -    begin
    -      Query.SQL.Text := s;
    -      Query.Open;
    -      AssertTrue(Query.FieldCount>0);
    -      AssertFalse('Eof after open', Query.Eof);
    -      Query.Next;
    -      Query.Close;
    -    end;
    -  end;
    -end;
    -
     procedure TTestFieldTypes.TestClearUpdateableStatus;
     // Test if CanModify is correctly disabled in case of a select query without
     // a from-statement.
    
    264_dbtestfix.diff (2,157 bytes)

Activities

Reinier Olislagers

2013-12-13 15:39

developer  

264_dbtestfix.diff (2,157 bytes)
Index: packages/fcl-db/tests/testfieldtypes.pas
===================================================================
--- packages/fcl-db/tests/testfieldtypes.pas	(revision 26227)
+++ packages/fcl-db/tests/testfieldtypes.pas	(working copy)
@@ -60,7 +60,6 @@
     procedure TestDblQuoteEscComments;
     procedure TestInsertReturningQuery;
     procedure TestOpenStoredProc;
-    procedure TestOpenSpecialStatements;
     
     procedure TestTemporaryTable;
     procedure TestRefresh;
@@ -1261,49 +1260,6 @@
   end;
 end;
 
-procedure TTestFieldTypes.TestOpenSpecialStatements;
-const CTE_SELECT = 'WITH a AS (SELECT * FROM FPDEV) SELECT * FROM a';
-type TTestStatements = array of string;
-var statements: TTestStatements;
-    s: string;
-begin
-  // tests non-select statements (other than "SELECT ..."), which return result-set
-  // at least one row must be returned
-  with TSQLDBConnector(DBConnector) do
-  begin
-    case SQLServerType of
-      ssSQLite:
-        statements := TTestStatements.Create('pragma table_info(FPDEV)');
-      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*)
-        );
-      ssPostgreSQL:
-        statements := TTestStatements.Create(CTE_SELECT, 'EXPLAIN '+CTE_SELECT);
-      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
-        Ignore(STestNotApplicable);
-    end;
-
-    for s in statements do
-    begin
-      Query.SQL.Text := s;
-      Query.Open;
-      AssertTrue(Query.FieldCount>0);
-      AssertFalse('Eof after open', Query.Eof);
-      Query.Next;
-      Query.Close;
-    end;
-  end;
-end;
-
 procedure TTestFieldTypes.TestClearUpdateableStatus;
 // Test if CanModify is correctly disabled in case of a select query without
 // a from-statement.
264_dbtestfix.diff (2,157 bytes)

Marco van de Voort

2013-12-13 21:13

manager   ~0071889

Committed to fixes (final will be branched from fixes, not the RC branch)

Issue History

Date Modified Username Field Change
2013-12-13 15:39 Reinier Olislagers New Issue
2013-12-13 15:39 Reinier Olislagers Status new => assigned
2013-12-13 15:39 Reinier Olislagers Assigned To => Marco van de Voort
2013-12-13 15:39 Reinier Olislagers File Added: 264_dbtestfix.diff
2013-12-13 15:40 Reinier Olislagers Priority normal => high
2013-12-13 21:13 Marco van de Voort Fixed in Revision => r26229
2013-12-13 21:13 Marco van de Voort Note Added: 0071889
2013-12-13 21:13 Marco van de Voort Status assigned => resolved
2013-12-13 21:13 Marco van de Voort Fixed in Version => 2.6.3
2013-12-13 21:13 Marco van de Voort Resolution open => fixed
2013-12-13 21:13 Marco van de Voort Target Version 2.6.4 =>
2013-12-14 12:32 Reinier Olislagers Status resolved => closed
2014-03-04 17:54 Jonas Maebe Fixed in Version 2.6.3 => 2.6.4