#1 2010-09-20 05:05:21

TPrami
Member
Registered: 2010-07-06
Posts: 84

Bug/Feature in BigTable

// VCL FileSeek() is buggy
// -> used to fix issue with files > 2 GB (thanks to sanyin for the report)
function FileSeek64(Handle: Integer; const Offset: Int64; Origin: Integer): Int64;
var R64: Int64Rec absolute Result;
begin
  Result := Offset;
  R64.Lo := SetFilePointer(Handle,R64.Lo,@R64.Hi,Origin); // <- Range Check error in here
  if (R64.Lo=cardinal(-1)) and (GetLastError<>0) then
    R64.Hi := cardinal(-1);
end;

Error on TSynBigTable.LoadFromFile; secondd FileSeek64

R64.Lo=4294967280
R64.Hi=4294967295
Origin=2

Added following as workaround:

  {$IFOPT R+}
    {$DEFINE RANGECHECKON}
  {$ENDIF}
 

{$IFDEF RANGECHECKON}
  {$R-}
{$ENDIF}
// VCL FileSeek() is buggy
// -> used to fix issue with files > 2 GB (thanks to sanyin for the report)
function FileSeek64(Handle: Integer; const Offset: Int64; Origin: Integer): Int64;
var R64: Int64Rec absolute Result;
begin
  Result := Offset;
  R64.Lo := SetFilePointer(Handle,R64.Lo,@R64.Hi,Origin);
  if (R64.Lo=cardinal(-1)) and (GetLastError<>0) then
    R64.Hi := cardinal(-1);
end;
{$IFDEF RANGECHECKON}
  {$R+}
{$ENDIF}


-Tommi Prami-

Offline

#2 2010-09-20 07:28:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 12,253
Website

Re: Bug/Feature in BigTable

Hello,

None of our units is to be use with RangeChecking ON.

Please set this setting to OFF in your programs, when you're using any of our units.

Offline

#3 2010-09-20 13:30:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 12,253
Website

Re: Bug/Feature in BigTable

We forced range checking OFF in the 1.9.2 update of the engine.

See http://synopse.info/forum/viewtopic.php?id=113

Offline

Board footer

Powered by FluxBB