Jump to content

Zdeněk Hanuš

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio
  1. Zdeněk Hanuš

    TIBSQLMonitor truncates the result in the "EventText" event "OnSQL"

    Hello, I'm sorry, but the fix works without any problems for me. Did you use the advice that Vandrovnik gave me in your program? It doesn't work without it.
  2. Zdeněk Hanuš

    TIBSQLMonitor truncates the result in the "EventText" event "OnSQL"

    Hello, I modified these two methods. The problem was that Char is no longer 1 byte, but 2 bytes. The fixes are between "// Start of fix" and "// End of fix". procedure TWriterThread.WriteToBuffer; var i, len, Step: Integer; Text : String; begin Lock; try { If there are no monitors throw out the message The alternative is to have messages queue up until a monitor is ready.} if FMonitorCount^ = 0 then begin CS.BeginWrite; FMsgs.Remove(FMsgs[0]); CS.EndWrite; end else begin Text := TTraceObject(FMsgs[0]).FMsg; i := 1; len := Length(Text); while (len > 0) do begin BeginWrite; try FillChar(FBuffer[0], cMaxBufferSize, #0); // Clear the buffer of previous data FTraceDataType^ := Integer(TTraceObject(FMsgs[0]).FDataType); FTimeStamp^ := TTraceObject(FMsgs[0]).FTimeStamp; FBufferSize^ := Min(len * Sizeof(Char), cMaxBufferSize); Move(Text[i], FBuffer[0], FBufferSize^); // Start of fix Step := cMaxBufferSize div SizeOf(Char); Inc(i, Step); //Inc(i, cMaxBufferSize); Dec(len, Step); //Dec(len, cMaxBufferSize); // End of fix finally EndWrite; end; end; CS.BeginWrite; FMsgs.Remove(FMsgs[0]); CS.EndWrite; end; finally Unlock; end; end; procedure TReaderThread.ReadSQLData; var S: String; BL, CL: Integer; begin st.FMsg := ''; {do not localize} BeginRead; if not bDone then try // Start of fix //SetString(st.FMsg, FBuffer, FBufferSize^); BL := FBufferSize^; SetString(S, FBuffer, BL); CL := SizeOf(Char); if CL > 1 then begin BL := BL div CL; S := Copy(S, 1, BL); end; st.FMsg := S; // End of fix st.FDataType := TTraceFlag(FTraceDataType^); st.FTimeStamp := TDateTime(FTimeStamp^); finally EndRead; end; end;
  3. Zdeněk Hanuš

    TIBSQLMonitor truncates the result in the "EventText" event "OnSQL"

    Yes. It works. How simple. Thank you very much. Zdeněk
  4. Hello, I use IBX to connect to Firebird 3.0. If I monitor communication with the server using the TIBSQLMonitor component, the monitor truncates the text "EventText" in the "OnSQL" event for longer commands to some 506 characters. The remaining characters are just the character #0. Has anyone solved it? I have Delphi 10.3.3 and Delphi 10.4.2 and the bug is in both. I was looking for a bug and I think I found it, but I'm not able to "beat" the system package. Thank you for your help.
×