mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 19:09:16 +02:00
* Fixed mysql ftLargeInt support+test (mantis 9744)
git-svn-id: trunk@8703 -
This commit is contained in:
parent
76b23821e1
commit
66c6ba7b64
@ -427,7 +427,12 @@ function TConnectionName.MySQLDataType(AType: enum_field_types; ASize, ADecimals
|
|||||||
begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
case AType of
|
case AType of
|
||||||
FIELD_TYPE_TINY, FIELD_TYPE_SHORT, FIELD_TYPE_LONG, FIELD_TYPE_LONGLONG,
|
FIELD_TYPE_LONGLONG:
|
||||||
|
begin
|
||||||
|
NewType := ftLargeint;
|
||||||
|
NewSize := 0;
|
||||||
|
end;
|
||||||
|
FIELD_TYPE_TINY, FIELD_TYPE_SHORT, FIELD_TYPE_LONG,
|
||||||
FIELD_TYPE_INT24:
|
FIELD_TYPE_INT24:
|
||||||
begin
|
begin
|
||||||
NewType := ftInteger;
|
NewType := ftInteger;
|
||||||
|
@ -26,6 +26,7 @@ type
|
|||||||
procedure TearDown; override;
|
procedure TearDown; override;
|
||||||
procedure RunTest; override;
|
procedure RunTest; override;
|
||||||
published
|
published
|
||||||
|
procedure TestBug9744;
|
||||||
procedure TestCrossStringDateParam;
|
procedure TestCrossStringDateParam;
|
||||||
procedure TestGetFieldNames;
|
procedure TestGetFieldNames;
|
||||||
procedure TestUpdateIndexDefs;
|
procedure TestUpdateIndexDefs;
|
||||||
@ -866,6 +867,41 @@ begin
|
|||||||
inherited RunTest;
|
inherited RunTest;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestFieldTypes.TestBug9744;
|
||||||
|
var i : integer;
|
||||||
|
begin
|
||||||
|
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) ' +
|
||||||
|
') ');
|
||||||
|
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)');
|
||||||
|
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.Prepare;
|
||||||
|
query.open;
|
||||||
|
query.close;
|
||||||
|
finally
|
||||||
|
Connection.ExecuteDirect('drop table TTTXY');
|
||||||
|
Connection.ExecuteDirect('drop table TTTOBJ');
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TTestFieldTypes.TestCrossStringDateParam;
|
procedure TTestFieldTypes.TestCrossStringDateParam;
|
||||||
begin
|
begin
|
||||||
TestXXParamQuery(ftDate,'DATE',testDateValuesCount,True);
|
TestXXParamQuery(ftDate,'DATE',testDateValuesCount,True);
|
||||||
|
@ -70,7 +70,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
DataEventnames : Array [TDataEvent] of String[19] =
|
DataEventnames : Array [TDataEvent] of String[21] =
|
||||||
('deFieldChange', 'deRecordChange', 'deDataSetChange', 'deDataSetScroll',
|
('deFieldChange', 'deRecordChange', 'deDataSetChange', 'deDataSetScroll',
|
||||||
'deLayoutChange', 'deUpdateRecord', 'deUpdateState', 'deCheckBrowseMode',
|
'deLayoutChange', 'deUpdateRecord', 'deUpdateState', 'deCheckBrowseMode',
|
||||||
'dePropertyChange', 'deFieldListChange', 'deFocusControl' ,'deParentScroll',
|
'dePropertyChange', 'deFieldListChange', 'deFocusControl' ,'deParentScroll',
|
||||||
|
Loading…
Reference in New Issue
Block a user