mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-27 02:30:57 +02:00
* Patch from Lacak to support DECFLOAT(16) type. Fixes issue #41185
This commit is contained in:
parent
083a059043
commit
689a8f261f
@ -1288,9 +1288,7 @@ begin
|
|||||||
Move(i128, VSQLVar^.SQLData^, VSQLVar^.SQLLen);
|
Move(i128, VSQLVar^.SQLData^, VSQLVar^.SQLLen);
|
||||||
end;
|
end;
|
||||||
SQL_DEC16:
|
SQL_DEC16:
|
||||||
begin
|
PQWord(VSQLVar^.SQLData)^ := BCDToDPDec64(AParam.AsFMTBCD);
|
||||||
// ToDo
|
|
||||||
end;
|
|
||||||
else
|
else
|
||||||
if (VSQLVar^.sqltype <> SQL_NULL) then
|
if (VSQLVar^.sqltype <> SQL_NULL) then
|
||||||
DatabaseErrorFmt(SUnsupportedParameter,[FieldTypeNames[AParam.DataType]],self);
|
DatabaseErrorFmt(SUnsupportedParameter,[FieldTypeNames[AParam.DataType]],self);
|
||||||
@ -1334,7 +1332,7 @@ begin
|
|||||||
// if VSQLVar^.AliasName <> FieldDef.Name then
|
// if VSQLVar^.AliasName <> FieldDef.Name then
|
||||||
// DatabaseErrorFmt(SFieldNotFound,[FieldDef.Name],self);
|
// DatabaseErrorFmt(SFieldNotFound,[FieldDef.Name],self);
|
||||||
if assigned(VSQLVar^.SQLInd) and (VSQLVar^.SQLInd^ = -1) then
|
if assigned(VSQLVar^.SQLInd) and (VSQLVar^.SQLInd^ = -1) then
|
||||||
result := false
|
Result := False
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
|
||||||
@ -1350,7 +1348,7 @@ begin
|
|||||||
VarCharLen := FieldDef.Size;
|
VarCharLen := FieldDef.Size;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := true;
|
Result := True;
|
||||||
case FieldDef.DataType of
|
case FieldDef.DataType of
|
||||||
ftBCD :
|
ftBCD :
|
||||||
begin
|
begin
|
||||||
@ -1370,8 +1368,9 @@ begin
|
|||||||
begin
|
begin
|
||||||
case (VSQLVar^.sqltype and not 1) of
|
case (VSQLVar^.sqltype and not 1) of
|
||||||
SQL_DEC16:
|
SQL_DEC16:
|
||||||
// ToDo
|
AFmtBcd := DPDec64ToBcd(PQWord(CurrBuff)^);
|
||||||
AFmtBcd := 0;
|
SQL_DEC34:
|
||||||
|
Result := False; // Not implemented yet
|
||||||
else
|
else
|
||||||
case VSQLVar^.SQLLen of
|
case VSQLVar^.SQLLen of
|
||||||
2 : AFmtBcd := BcdDivPower10(PSmallint(CurrBuff)^, -VSQLVar^.SQLScale);
|
2 : AFmtBcd := BcdDivPower10(PSmallint(CurrBuff)^, -VSQLVar^.SQLScale);
|
||||||
@ -1426,8 +1425,8 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
result := false;
|
Result := False;
|
||||||
databaseerrorfmt(SUnsupportedFieldType, [Fieldtypenames[FieldDef.DataType], Self]);
|
DatabaseErrorFmt(SUnsupportedFieldType, [Fieldtypenames[FieldDef.DataType], Self]);
|
||||||
end
|
end
|
||||||
end; { case }
|
end; { case }
|
||||||
end; { if/else }
|
end; { if/else }
|
||||||
|
Loading…
Reference in New Issue
Block a user