Page 9 of 9

Re: zMemtable

Posted: 18.06.2022, 17:07
by miab3
Hi Jan,

The problem is a bit more complex.
During testing, I noticed that when using FreeTDS, TEXTSIZE is
initialized depending on the version of Delphi and Lazarus and MSSQL on:
0
10000000
1073741823
2147483647

ADD:( More precisely, FColumnLengths [ColumnIndex] in line
stBytes: if FColumnLengths [ColumnIndex] <= 0
it takes on such values)

Added to this is the fact that the user can set it SET TEXTSIZE - to any value.
Therefore, for a long time, I propose to introduce this CURRENT_TEXTSIZE for use by ZEOS where it is necessary and by the user when he needs.

Michał

Re: zMemtable

Posted: 19.06.2022, 11:26
by marsupilami
miab3 wrote: 18.06.2022, 17:07 Hi Jan,

The problem is a bit more complex.
During testing, I noticed that when using FreeTDS, TEXTSIZE is
initialized depending on the version of Delphi and Lazarus and MSSQL on:
0
10000000
1073741823
2147483647

ADD:( More precisely, FColumnLengths [ColumnIndex] in line
stBytes: if FColumnLengths [ColumnIndex] <= 0
it takes on such values)

Added to this is the fact that the user can set it SET TEXTSIZE - to any value.
Therefore, for a long time, I propose to introduce this CURRENT_TEXTSIZE for use by ZEOS where it is necessary and by the user when he needs.

Michał
Hello Michal,

i totally agree with you - in the long term we need a better handling of these things. But for me this it a two step process:
  1. Fix the problem for TEXTSIZE=2147483647
  2. Fix it for other settings of TEXTSIZE
So at first I need a confirmation that the latest changes fix the problem for TEXTSIZE=2147483647. Could you please test this?

Re: zMemtable

Posted: 19.06.2022, 12:23
by miab3
Here is a test for the D10.3-Win32 ZEOS8trunk_r7817(7816) with your freetds-1.3.12.zip.

Sequence of actions:
-Open (ZTable)
-Clone (ZTable to ZMemTable)
-Save (ZMemTable to file) - ERROR

Code: Select all

procedure TForm1.Button2Click(Sender: TObject);
var fs: TFileStream;
begin
  fs := TFileStream.Create('t2code.bin', fmCreate);
  Try
    ZMemTable1.SaveToStream(fs);
  Finally
    fs.Free;
  End;
end;
freedD103W32.jpg
With my fix, this error was not there.

Michał