Page 1 of 1

Data clear after canceling ZQuery

Posted: 02.05.2023, 22:15
by atendimentobed
Hi,

After migrating a project to Delphi 11.2 + MySQL 5.0 + Zeos 8.0 I noticed a strange behavior that did not occur previously in the 7.1.4-stable version of Zeos used in Delphi 2010.

To make it easier, I reproduced the problem in a simple scenario. I created a new VCL project with just one form and the components below:
Image

I also created a test database with just one table named tbl_test.
Image

I also put some rows in the table for the example.
Image

ZQuery1 is linked to the tbl_test table, DataSource1 is linked to ZQuery1, ZQuery1 is pointed to ZUpdateSQL1 to execute the DML commands and DBEdit1 pointed to DataSource1, field name. A normal scenario.

I run the application and as expected the name appears correctly in DBEdit1.
Image

Until then, everything is normal. On the EDIT and CANCEL buttons I have simple codes. Just to edit the record and cancel.
Image

If I click on the Edit button and then on the Cancel button, the DBEdit continues to display the value (HELLO), as expected. But if I add the line below in the Edit code the problem happens.
Image

After adding this line, if I click on the Edit button and then on the Cancel button the content of DBEdit1 is erased (HELLO).
Image

This behavior happened only in the new Zeos 8.0 + Delphi 11.2 scenario.

Can anybody help me?

Thx

Re: Data clear after canceling ZQuery

Posted: 03.05.2023, 08:33
by marsupilami
PLease upload your test project, so we can test it. I don't want to copy the code from pictures by typing everything myself. ;)

Re: Data clear after canceling ZQuery

Posted: 03.05.2023, 10:44
by miab3
And where is ZQuery1.Post?

Michal

Re: Data clear after canceling ZQuery

Posted: 03.05.2023, 17:02
by atendimentobed
marsupilami wrote: 03.05.2023, 08:33 PLease upload your test project, so we can test it. I don't want to copy the code from pictures by typing everything myself. ;)
Sorry!!! :-D

Project Delphi:
https://mega.nz/file/2AdyAKoJ#my7xnb2pO ... WJ0P93q4Z8

Script SQL:
https://mega.nz/file/HQswGJya#MtSUXlJQk ... FRsSYVb_zA

Re: Data clear after canceling ZQuery

Posted: 03.05.2023, 17:03
by atendimentobed
miab3 wrote: 03.05.2023, 10:44 And where is ZQuery1.Post?

Michal
Hi,

To simplify the explanation, I didn't put ZQuery1.Post in the example, because the problem happens only in ZQuery1.Cancel.

Re: Data clear after canceling ZQuery

Posted: 04.05.2023, 06:13
by marsupilami
I can confirm the bug. What's even more confusing: It doesn't happen when a DBGrid is connected to the Query.

I have no clue yet what the problem is.

Re: Data clear after canceling ZQuery

Posted: 04.05.2023, 11:24
by miab3
ZConnection1.Connected:=FALSE;
ZQuery1.Open;

Shows old value

Michal

Re: Data clear after canceling ZQuery

Posted: 04.05.2023, 13:23
by atendimentobed
marsupilami wrote: 04.05.2023, 06:13 I can confirm the bug. What's even more confusing: It doesn't happen when a DBGrid is connected to the Query.

I have no clue yet what the problem is.
Hi,

This is a pretty common scenario, a basic CRUD screen. But I couldn't find anyone else who reported this issue, that's why I opened this topic.

Re: Data clear after canceling ZQuery

Posted: 17.05.2023, 16:31
by atendimentobed
Hi marsupilami,

How are you?

Any news about this bug?