#1 2015-01-16 14:40:14

alpinistbg
Member
Registered: 2014-11-12
Posts: 124

More TID overflows, unfortunately

  R := TSQLRecord.Create([], 4294967296 + 1);
  Client.Add(R, true, true);
  R.FillPrepare(Client);
  R.FillOne;
  ShowMessage(Int64ToUtf8(R.ID));

Shows '1'!

Overflow occurred somewhere in the round-trip. TSQLRecordFill.Fill suspected.

Edit:

List of suspected assignments:

mORMot.pas (18361,12) PID := GetInteger(IDColumn[aP]) else
mORMot.pas (18362,12) PID := GetInteger(PPUTF8Char(PtrInt(aPP)-FieldIndexNextPtr)^);
mORMot.pas (18371,17) result := GetInteger(IDColumn[i])-PID else
mORMot.pas (18372,17) result := GetInteger(PPUTF8Char(PtrInt(CI)-FieldIndexNextPtr)^)-PID;
mORMot.pas (18381,17) result := GetInteger(IDColumn[J])-PID else
mORMot.pas (18382,17) result := GetInteger(PPUTF8Char(PtrInt(CJ)-FieldIndexNextPtr)^)-PID;
mORMot.pas (18568,18) result := GetInteger(IDColumn[A])-GetInteger(IDColumn[b]);
mORMot.pas (21898,22) Dest.ID := GetInteger(aTableRow[TableIndex]) else
mORMot.pas (21909,21) aDest.ID := GetInteger(aTableRow[TableIndex]) else
mORMot.pas (22281,14) fID := GetInteger(Value) else begin
mORMot.pas (32040,14) aID := GetInteger(U^);
mORMot.pas (34423,12) V := GetInteger(PropValue,err);
mORMot.pas (34518,14) V := GetInteger(PropValue,err);
mORMot.pas (35965,14) aID := GetInteger(pointer(fProcessRest.OneFieldValue(Table,'RowID',

Last edited by alpinistbg (2015-01-16 15:56:14)

Offline

#2 2015-01-16 18:29:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,192
Website

Re: More TID overflows, unfortunately

I've done another pass of fixes for TID = Int64 support.
See http://synopse.info/fossil/info/ad3b484a43

Note that the V := GetInteger() when deserializing a TSQLRecord published property has not been changed, since the current implementation using PtrInt = NativeInt is OK.

See also http://synopse.info/fossil/info/533ccc611f which includes a regression test for Add+Retrieve of huge IDs.

Thanks for the feedback!

Offline

Board footer

Powered by FluxBB