[solved] MySQL WITH_WIDEMEMO

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
cacofony
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 06.12.2006, 15:24
Location: Perth - Western Australia
Contact:

[solved] MySQL WITH_WIDEMEMO

Post by cacofony »

Hi,

{$DEFINE WITH_WIDEMEMO} // Have WIDEMEMO, For Delphi we turn these off if not applicable

Could this perhaps be explained further?

I have found issues with large VARCHAR fields or TEXT fields. By commenting this out problems disappear.

Loading strings from streams appears to cause the issue.

Tristan
cacofony
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 06.12.2006, 15:24
Location: Perth - Western Australia
Contact:

Re: MySQL WITH_WIDEMEMO

Post by cacofony »

Sorry ignore that, it still has access violations.

ZDbcCache.pas
function TZRowAccessor.GetRawByteString(Const ColumnIndex: Integer;
var IsNull: Boolean): RawByteString;


Code: Select all

stAsciiStream, stUnicodeStream, stBinaryStream:
      begin
        try
          TempBlob := GetBlobObject(FBuffer, ColumnIndex);
          if (TempBlob <> nil) and not TempBlob.IsEmpty then
            Result := TempBlob.GetString;

        except
          on E: Exception do
          begin
            Result := Format('%s, Column Index: %d, Column Type %d',
              [E.Message, ColumnIndex, Integer(FColumnTypes[ColumnIndex - 1])]);
          end;
        end;
      end;
This will happen for TEXT, LARGETEXT, SMALLTEXT and CAST as CHAR[n] where n > 500?

I placed the exception trap, the solumn type will be stUnicodeStream
cacofony
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 06.12.2006, 15:24
Location: Perth - Western Australia
Contact:

Re: MySQL WITH_WIDEMEMO

Post by cacofony »

This can be easily replicated in the zeoslib test tables. Add some rows of text in the b_text field in table blob_values. I added 62 rows containing the text from lgpl.txt

Add a ZConnection, ZQuery, Datasource and link a DBGrid

Code: Select all

  ZQuery.SQL.Clear;
  ZQuery.SQL.Add('SELECT * FROM blob_values');
  ZQuery.Open;
Scroll through the records and an access violation will occur here

Code: Select all

function TZMySQLBaseDriver.GetFieldData(Row: PZMySQLRow;
  Offset: Cardinal): PAnsiChar;
begin
  Result := PMYSQL_ROW(ROW)[Offset];
end;
cacofony
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 06.12.2006, 15:24
Location: Perth - Western Australia
Contact:

Re: MySQL WITH_WIDEMEMO

Post by cacofony »

My testing would show EgonHugeist has fixed the issue with commit 3158. Nice work.

https://sourceforge.net/p/zeoslib/tickets/77/
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Re: MySQL WITH_WIDEMEMO

Post by papelhigienico »

@miab3 or @cacofony can you close this (Put [SOLVED] in the title of the first message)???

I don't have sufficient privileges to do this... :oops:
Post Reply