TZQuery.FieldByName().OldValue broken...?
Posted: 26.07.2020, 21:28
I was about to implement a "smart cancel" for my table wrappers; making .Save to call TZQuery.CancelUpdates if nothing was changed. For that, I cycled through all fields of the TZQuery object, comparing .OldValue to .Value.
Bad thing is, it always returns the same.
All settings on default, the following code
will set "v" to the new value (in this particular case, 0) in both lines.
Using Zeos 7.3.0-a1d45853 connecting to a MySQL server 8.0.18 with libmysql.dll 6.1.11
commit a1d45853e3cbe60d101232b356fb9724c605f7ea
Author: egonhugeist <egonhugeist@localhost>
Date: Fri Jul 24 07:14:50 2020 +0000
hopefully finalize the logs for mySQL
P.s.: Because of a ZDbcIntFs bug ZConnection.ClientVersionStr will stack overflow if there is no active connection. I'll post a pull request on GitHub with the fix soon.
Bad thing is, it always returns the same.
All settings on default, the following code
Code: Select all
Var
v: Variant;
begin
ZQuery1.Active := True;
ZQuery1.First;
ZQuery1.Edit;
ZQuery1.FieldByName('f').AsLargeInt := 0;
v := ZQuery1.FieldByName('f').OldValue;
v := ZQuery1.FieldByName('f').Value;
Zquery1.Cancel;
Using Zeos 7.3.0-a1d45853 connecting to a MySQL server 8.0.18 with libmysql.dll 6.1.11
commit a1d45853e3cbe60d101232b356fb9724c605f7ea
Author: egonhugeist <egonhugeist@localhost>
Date: Fri Jul 24 07:14:50 2020 +0000
hopefully finalize the logs for mySQL
P.s.: Because of a ZDbcIntFs bug ZConnection.ClientVersionStr will stack overflow if there is no active connection. I'll post a pull request on GitHub with the fix soon.