|
@@ -503,7 +503,9 @@ begin
|
|
pqclear(res);
|
|
pqclear(res);
|
|
|
|
|
|
tr.ErrorOccured := True;
|
|
tr.ErrorOccured := True;
|
|
- atransaction.Rollback;
|
|
|
|
|
|
+// Don't perform the rollback, only make it possible to do a rollback.
|
|
|
|
+// The other databases also don't do this.
|
|
|
|
+// atransaction.Rollback;
|
|
DatabaseError(SErrExecuteFailed + ' (PostgreSQL: ' + s + ')',self);
|
|
DatabaseError(SErrExecuteFailed + ' (PostgreSQL: ' + s + ')',self);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -597,8 +599,14 @@ begin
|
|
case FieldDef.DataType of
|
|
case FieldDef.DataType of
|
|
ftInteger, ftSmallint, ftLargeInt,ftfloat :
|
|
ftInteger, ftSmallint, ftLargeInt,ftfloat :
|
|
begin
|
|
begin
|
|
- for tel := 1 to i do // postgres returns big-endian numbers
|
|
|
|
- pchar(Buffer)[tel-1] := CurrBuff[i-tel];
|
|
|
|
|
|
+ case i of // postgres returns big-endian numbers
|
|
|
|
+ sizeof(int64) : pint64(buffer)^ := BEtoN(pint64(CurrBuff)^);
|
|
|
|
+ sizeof(integer) : pinteger(buffer)^ := BEtoN(pinteger(CurrBuff)^);
|
|
|
|
+ sizeof(smallint) : psmallint(buffer)^ := BEtoN(psmallint(CurrBuff)^);
|
|
|
|
+ else
|
|
|
|
+ for tel := 1 to i do
|
|
|
|
+ pchar(Buffer)[tel-1] := CurrBuff[i-tel];
|
|
|
|
+ end; {case}
|
|
end;
|
|
end;
|
|
ftString :
|
|
ftString :
|
|
begin
|
|
begin
|
|
@@ -609,21 +617,14 @@ begin
|
|
end;
|
|
end;
|
|
ftdate :
|
|
ftdate :
|
|
begin
|
|
begin
|
|
- li := 0;
|
|
|
|
- for tel := 1 to i do // postgres returns big-endian numbers
|
|
|
|
- pchar(@li)[tel-1] := CurrBuff[i-tel];
|
|
|
|
-// double(buffer^) := x + 36526; This doesn't work, please tell me what is wrong with it?
|
|
|
|
dbl := pointer(buffer);
|
|
dbl := pointer(buffer);
|
|
- dbl^ := li + 36526;
|
|
|
|
|
|
+ dbl^ := BEtoN(plongint(CurrBuff)^) + 36526;
|
|
i := sizeof(double);
|
|
i := sizeof(double);
|
|
end;
|
|
end;
|
|
ftDateTime, fttime :
|
|
ftDateTime, fttime :
|
|
begin
|
|
begin
|
|
|
|
+ pint64(buffer)^ := BEtoN(pint64(CurrBuff)^);
|
|
dbl := pointer(buffer);
|
|
dbl := pointer(buffer);
|
|
- dbl^ := 0;
|
|
|
|
- for tel := 1 to i do // postgres returns big-endian numbers
|
|
|
|
- pchar(Buffer)[tel-1] := CurrBuff[i-tel];
|
|
|
|
-
|
|
|
|
dbl^ := (dbl^+3.1558464E+009)/86400; // postgres counts seconds elapsed since 1-1-2000
|
|
dbl^ := (dbl^+3.1558464E+009)/86400; // postgres counts seconds elapsed since 1-1-2000
|
|
// Now convert the mathematically-correct datetime to the
|
|
// Now convert the mathematically-correct datetime to the
|
|
// illogical windows/delphi/fpc TDateTime:
|
|
// illogical windows/delphi/fpc TDateTime:
|