AV on second try of ZQuery.Post

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
brunodelmondes
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 28.10.2020, 15:12
Location: Brazil

AV on second try of ZQuery.Post

Post by brunodelmondes »

Hey guys!

I was doing some tests with Zeos 8 SVN 7589 on Delphi 2010 and Firebird 4.0.0.2496 (relase). On firebird.conf I setted DataTypeCompatibility = 3.0 property. Here is the DML of the table on FB database:

Code: Select all

CREATE TABLE PRODUCT
(
  ID INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
  DESCRIPTION VARCHAR(60),
  PRICE NUMERIC(15,4) DEFAULT 0,
  CONSTRAINT INTEG_3 PRIMARY KEY (ID)
);
I have an ZConnection (Conn) and ZQuery (qryProd) with default configurations.
Conn = TransactionLevel: tiReadCommited, Charset WIN1252

The below code is causing an access violation at line 1497 of ZDbcCache unit, it just happens on the second try:
( stCurrency: Statement.SetCurrency(StatementIndex, PCurrency(Data)^); )

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin

  if not Conn.Connected then
  begin
    Conn.Disconnect;
    Conn.Connect;
  end;

  if not qryProd.Active then
  begin
    qryProd.Close;
    qryProd.Open;
  end;

  with qryProd do
  begin
    Append;
    FieldByName('description').AsString := 'test ' + IntToStr(Random(100000));
    FieldByName('price').AsCurrency := Random(1000);
    Post;
  end;

end;
Bruno Delmondes
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: AV on second try of ZQuery.Post

Post by marsupilami »

Hello Bruno,

I assume you use "firebird" as the protocol? Could you please test what happens if you use the "interbase" protocol? Background: firebird uses the "new" interface based API as a default whereas the interbase protocol uses the legacy API.

Best regards,

Jan
brunodelmondes
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 28.10.2020, 15:12
Location: Brazil

Re: AV on second try of ZQuery.Post

Post by brunodelmondes »

Hello Jan,
I assume you use "firebird" as the protocol?
Yes, forgot to mension that.
Could you please test what happens if you use the "interbase" protocol?
Just tested, same AV hapens at the same line and unit I mensioned above.
Bruno Delmondes
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: AV on second try of ZQuery.Post

Post by marsupilami »

Hello Bruno,

I created a ticket on our bug tracker for this. It will take some days for me to add a test case and see what I can do.

Best regards,

Jan
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: AV on second try of ZQuery.Post

Post by miab3 »

Simply put, the problem occurs when you try to enter a second record into the table above.
I also have it, for FB3.
Additionally, I was able to trigger such an error messages:
PROD_ERR.png
Michał
You do not have the required permissions to view the files attached to this post.
Last edited by miab3 on 02.07.2021, 16:32, edited 1 time in total.
brunodelmondes
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 28.10.2020, 15:12
Location: Brazil

Re: AV on second try of ZQuery.Post

Post by brunodelmondes »

Hello Jan,
I created a ticket on our bug tracker for this. It will take some days for me to add a test case and see what I can do.
All right, thank you!

Hello Michal,
I managed to get something like this:
Well, I get a common AV error message and, as I said, I'm testing Firebird 4 stable, I don't know if that's why.
Bruno Delmondes
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: AV on second try of ZQuery.Post

Post by marsupilami »

Hello Bruno hello Michal,

I added a fix for this in r7600 and r7601. Could you please check if this fixes your problems?

Best regards,

Jan
brunodelmondes
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 28.10.2020, 15:12
Location: Brazil

Re: AV on second try of ZQuery.Post

Post by brunodelmondes »

Thank you Jan, it's working fine now.
Bruno Delmondes
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: AV on second try of ZQuery.Post

Post by miab3 »

Hi Jan,

It looks like you have successfully fixed the bug.
Now it works for me without errors with Firebird 3.
Delphi 10.3.3 Win32/64 Zeos8 trunk r7600.

Michał
Post Reply