mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-10 14:51:39 +02:00
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) git-svn-id: trunk@23062 -
This commit is contained in:
parent
b1fa17411a
commit
f3e071493f
@ -1769,8 +1769,6 @@ procedure TTestFieldTypes.TestBug9744;
|
|||||||
var i : integer;
|
var i : integer;
|
||||||
begin
|
begin
|
||||||
// Tests rev.8703: "Fixed MySQL ftLargeInt support"; count() returns BIGINT values
|
// Tests rev.8703: "Fixed MySQL ftLargeInt support"; count() returns BIGINT values
|
||||||
if not(SQLServerType in [ssMySQL, ssSQLite]) then Ignore('This test does not apply to this db-engine, since it has no double field-type');
|
|
||||||
|
|
||||||
with TSQLDBConnector(DBConnector) do
|
with TSQLDBConnector(DBConnector) do
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
@ -1782,23 +1780,23 @@ begin
|
|||||||
Connection.ExecuteDirect('create table TTTXY ( ' +
|
Connection.ExecuteDirect('create table TTTXY ( ' +
|
||||||
' ID INT NOT NULL, ' +
|
' ID INT NOT NULL, ' +
|
||||||
' NP INT NOT NULL, ' +
|
' NP INT NOT NULL, ' +
|
||||||
' X DOUBLE, ' +
|
|
||||||
' Y DOUBLE, ' +
|
|
||||||
' PRIMARY KEY (ID,NP)' +
|
' PRIMARY KEY (ID,NP)' +
|
||||||
') ');
|
') ');
|
||||||
|
Transaction.CommitRetaining;
|
||||||
for i := 0 to 7 do
|
for i := 0 to 7 do
|
||||||
begin
|
begin
|
||||||
connection.ExecuteDirect('insert into TTTOBJ(ID,NAME) values ('+inttostr(i)+',''A'+inttostr(i)+''')');
|
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) values ('+inttostr(i)+',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)+',2)');
|
||||||
end;
|
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 as OBJ, TTTXY as XY where OBJ.ID=XY.ID group by OBJ.ID, OBJ.NAME';
|
||||||
query.Prepare;
|
query.Prepare;
|
||||||
query.open;
|
query.open;
|
||||||
query.close;
|
query.close;
|
||||||
finally
|
finally
|
||||||
Connection.ExecuteDirect('drop table TTTXY');
|
Connection.ExecuteDirect('drop table TTTXY');
|
||||||
Connection.ExecuteDirect('drop table TTTOBJ');
|
Connection.ExecuteDirect('drop table TTTOBJ');
|
||||||
|
Transaction.CommitRetaining;
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user