[Solved] Crash in ZEOS in TZAbstractDataset.ApplyUpdates
Moderators: gto, cipto_kh, EgonHugeist
[Solved] Crash in ZEOS in TZAbstractDataset.ApplyUpdates
Hallo,
I got a big problem in ZeosDBO in all versions after Zeosdbo SVN Rev 3942.
Please have a look at http://www.lazarusforum.de/viewtopic.php?f=17&t=11738
Any tipps or hints for me?
Thank You
Klaus
I got a big problem in ZeosDBO in all versions after Zeosdbo SVN Rev 3942.
Please have a look at http://www.lazarusforum.de/viewtopic.php?f=17&t=11738
Any tipps or hints for me?
Thank You
Klaus
Last edited by MacWomble on 28.08.2018, 10:46, edited 1 time in total.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
Hello Klaus,
unfortunately I can't register on the lazarusforum.de forum. It uses recaptcha V1 that seems to be shut down. So we will have to stick to english for now.
Anyway - having Rev. 3942 as the last working revision is strange because Rev. 3943 only is a small change in the firebird driver. And you are on MySQL - right?
Where did you get your revision number from? Do you see that in CodeTyphoon? Or did you check out Zeos yourself and installed it in CodeTyphoon?
It could help if you could drill down your example to the minimum required code to still show the bug. Maby make a copy of your project and remove everything that isn't needed to reproduce the bug. If the bug only happens with the window for modyfying the Auftraege table, then maybe it is enough to only look into the code there? Maybe even the call to TfrmAuftrag can be replaced by a some lines of code that modify qryAuftrag without posting the changes for a test case?
Also it might be an idea to change your code to not use CachedUpdates at all and use transactions instead?
Best regards,
Jan
unfortunately I can't register on the lazarusforum.de forum. It uses recaptcha V1 that seems to be shut down. So we will have to stick to english for now.
Anyway - having Rev. 3942 as the last working revision is strange because Rev. 3943 only is a small change in the firebird driver. And you are on MySQL - right?
Where did you get your revision number from? Do you see that in CodeTyphoon? Or did you check out Zeos yourself and installed it in CodeTyphoon?
It could help if you could drill down your example to the minimum required code to still show the bug. Maby make a copy of your project and remove everything that isn't needed to reproduce the bug. If the bug only happens with the window for modyfying the Auftraege table, then maybe it is enough to only look into the code there? Maybe even the call to TfrmAuftrag can be replaced by a some lines of code that modify qryAuftrag without posting the changes for a test case?
Also it might be an idea to change your code to not use CachedUpdates at all and use transactions instead?
Best regards,
Jan
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
This revision is ~2 years old. It is always good idea to try recent versions first.
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
OK, lets look to the facts first:
I use CT Lab 6.60 and they wrote : -Update pl_ZeosDBO to Ver 6.6.2 Source SVN Rev 4943
This must be 5 days old in my opinion.
- The older version SVN Rev 3942 is the last I know it works in my project.
My problem occurs with newer versions and I did a screen from the calling stack and the moment my project crashes om Post
It' a simple form I call with TDBEdit, TDBMEMO and TDBLookupCombo connected to a Datasource and TZQuery with a simple call:
Because my project is really complex and I use many Sub-units it's not easy to capsulate the part where the error occurs.
Is it possible that there is something wrong with ANSI and UTF8 ? (Look Stack.png)
Regards Klaus
I use CT Lab 6.60 and they wrote : -Update pl_ZeosDBO to Ver 6.6.2 Source SVN Rev 4943
This must be 5 days old in my opinion.
- The older version SVN Rev 3942 is the last I know it works in my project.
My problem occurs with newer versions and I did a screen from the calling stack and the moment my project crashes om Post
It' a simple form I call with TDBEdit, TDBMEMO and TDBLookupCombo connected to a Datasource and TZQuery with a simple call:
Code: Select all
function BearbeiteAuftrag(IDAuftrag: integer; Neu: boolean): boolean;
var
Suchtext: string;
LastRec: integer;
F: TfrmAuftrag;
begin
with dtmAuftrag do
begin
if IDAuftrag = 0 then
if MessageDlg('Es sind noch keine Aufträge vorhanden. Wollen Sie jetzt einen anlegen?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
Neu := True
else
begin
Result := False;
exit;
end;
if Neu then
begin
CreateNewAuftrag(IDAuftrag);
end;
if IDAuftrag > 0 then
begin
OpenSQLSet(qryAuftrag, 'Select * from Auftraege Where idauftrag = ' + IntToStr(IDAuftrag));
F := TfrmAuftrag.Create(nil);
if qryAuftragsListe.FieldByName('colorn').AsVariant <> NULL then
F.pnlHeader.Color := qryAuftragsListe.FieldByName('colorn').AsVariant;
try
F.ShowModal;
if DoSave then
begin
if qryAuftrag.State = dsEdit then
qryAuftrag.ApplyUpdates; // HERE IS THE POINT WHERE THE PROJECT CRASHES
qryAuftragsListe.Refresh;
qryAuftragsListe.Locate('idauftrag', qryAuftrag.FieldByName('idauftrag').AsInteger, []);
Result := True;
end
else
begin
qryAuftrag.CancelUpdates;
Result := False;
end;
finally
FreeAndNil(F);
end;
end;
end;
end;
Because my project is really complex and I use many Sub-units it's not easy to capsulate the part where the error occurs.
Is it possible that there is something wrong with ANSI and UTF8 ? (Look Stack.png)
Regards Klaus
You do not have the required permissions to view the files attached to this post.
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
OK, found a difference:
The version witch works for me has in ZDbcCache.pas in procedure:
procedure TZRowAccessor.SetPAnsiChar(ColumnIndex: Integer; Value: PAnsichar;
Len: PNativeUInt);
Edit: See next post
The version witch works for me has in ZDbcCache.pas in procedure:
procedure TZRowAccessor.SetPAnsiChar(ColumnIndex: Integer; Value: PAnsichar;
Len: PNativeUInt);
Edit: See next post
Last edited by MacWomble on 25.08.2018, 20:09, edited 1 time in total.
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
Sorry, the first code in the last post was wrong - so I deleted it!
The error is in combination with TDBMemo. May be when using german 'Umlaute' (using UTF8-bin in MySQL)
The code-part working for me is:
and the actual - not working - is:
The error is in combination with TDBMemo. May be when using german 'Umlaute' (using UTF8-bin in MySQL)
The code-part working for me is:
Code: Select all
stUnicodeStream, stAsciiStream:
begin
Blob := GetBlob(ColumnIndex, IsNull{%H-});
if Blob.IsClob then
Blob.SetPAnsiChar(Value, ConSettings^.ClientCodePage^.CP, Len^)
else
Blob.SetBuffer(Value, Len^);
end;
Code: Select all
stUnicodeStream, stAsciiStream:
if (Data^ = nil) then
PIZLob(Data^)^ := TZAbstractCLob.CreateWithData(Value, Len^, ConSettings^.ClientCodePage^.CP, ConSettings)
else if PIZLob(Data^)^.IsClob then // here the error occurs (Zeile 4120) - working on content of TDBMemo
PIZLob(Data^)^.SetPAnsiChar(Value, ConSettings^.ClientCodePage^.CP, Len^)
else
PIZLob(Data^)^.SetBuffer(Value, Len^);
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
I found out now that the error occurs on tables where I use Mediumtext. Changing this to Varchar in the Database makes it work.
Also Tinytext, Blobs etc won't work!
This is an error in my opinion and should be corrected in ZEOS.
Regards Klaus
Also Tinytext, Blobs etc won't work!
This is an error in my opinion and should be corrected in ZEOS.
Regards Klaus
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
Hello Klaus,
it would help us a grat deal if you could try to create a minimum code example. Your posts on lazarusform.de suggest that you are quite close to this Otherwise we still have to do quite some guessing which is quite time consuming for us. Does the following example trigger the problem?
If it doesn't trigger the problem, could you try to modify it so it triggers the problem? The idea is to create a code example that we can use to create a bug report and also to extend our test suites.
Best regards,
Jan
it would help us a grat deal if you could try to create a minimum code example. Your posts on lazarusform.de suggest that you are quite close to this Otherwise we still have to do quite some guessing which is quite time consuming for us. Does the following example trigger the problem?
Code: Select all
Query.Close;
Query.Sql := 'select IdIntCol, MediumTextCol from testtable where IdIntCol = 5';
Query.Open;
Query.Edit;
Query.FieldByName('MediumTextCol').AsString := 'äöüß';
Query.Post;
Best regards,
Jan
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
I tried to generate a testprogramm but:
1. I created a schema 'TEST' in mysql. I can connect with TZConnection, but I can't use TZQuery with that. TZQuery converts 'TEST' to 'test' and can't find the database. Thats definitly an error!
2. I created a new schema 'test' and can now use TZQuery wit TZConnection but the IDE crashes with no comment when I connect a DBGrid (over TDataSource) or try to use the field-editor in TZQuery.
Back to my mainproblem:
Now when I use varchar instead of Mediumtext all works fine except the varchar is greater than 255. VarChar is than handled as Blob and the exactly same problem occurs as with Mediumtext - handling Blobs is not possible with ZEOS in the moment!
1. I created a schema 'TEST' in mysql. I can connect with TZConnection, but I can't use TZQuery with that. TZQuery converts 'TEST' to 'test' and can't find the database. Thats definitly an error!
2. I created a new schema 'test' and can now use TZQuery wit TZConnection but the IDE crashes with no comment when I connect a DBGrid (over TDataSource) or try to use the field-editor in TZQuery.
Back to my mainproblem:
Now when I use varchar instead of Mediumtext all works fine except the varchar is greater than 255. VarChar is than handled as Blob and the exactly same problem occurs as with Mediumtext - handling Blobs is not possible with ZEOS in the moment!
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
Yes - it is. Please create a bug report on the bug tracker about that. So you use MySQL on Linux.MacWomble wrote:1. I created a schema 'TEST' in mysql. I can connect with TZConnection, but I can't use TZQuery with that. TZQuery converts 'TEST' to 'test' and can't find the database. Thats definitly an error!
It seems that the IDE crashes when Zeos gets asked for metadata. Without an error message it is hard to know wether the bug happens in Zeos or in the IDE or in the LCL or in the FCL or...MacWomble wrote:2. I created a new schema 'test' and can now use TZQuery wit TZConnection but the IDE crashes with no comment when I connect a DBGrid (over TDataSource) or try to use the field-editor in TZQuery.
Please try the following: Put a connection and a query on your form. Configure that connection with your connection parameters. Link the Query to the connection and set the SQL to just "select * from yourtesttable". Put a button on your form that only does ZQuery1.Open. Please don't use the fields editor or hook up any controls. Run that small example and see if it generates an error.
Ok - so there seems to be a problem when things get bigger than 255 characters or bytes. Which is strange.MacWomble wrote:Now when I use varchar instead of Mediumtext all works fine except the varchar is greater than 255. VarChar is than handled as Blob and the exactly same problem occurs as with Mediumtext - handling Blobs is not possible with ZEOS in the moment!
Please remember: You chose to use CodeTyphoon - they combine an Alpha Version of FPC with an Alpha Version of Lazarus and throw in an Alpha Version of Zeos. It is hard for any developer to track what happens on your computer with a rolling release like that.
Can you remove the CodeTyphoon provided version of Zeos and Install the latest SVN release of Zeos 7.3?
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
It's not easy to use the SVN with CodeTyphon because they renamed all files, so I reported my problems to pilotlogic now.
I use my older version of ZEOS again witch is working fine.
I use my older version of ZEOS again witch is working fine.
Re: Crash in ZEOS in TZAbstractDataset.ApplyUpdates
Works now with ZeosDBO_SVN_5018
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
-
- Fresh Boarder
- Posts: 1
- Joined: 12.03.2020, 08:46
Re: [Solved] Crash in ZEOS in TZAbstractDataset.ApplyUpdates
I found out now that the error occurs on tables where I use Mediumtext. Changing this to Varchar in the Database makes it work.
Also Tinytext, Blobs etc won't work!
This is an error in my opinion and should be corrected in ZEOS.
Also Tinytext, Blobs etc won't work!
This is an error in my opinion and should be corrected in ZEOS.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: [Solved] Crash in ZEOS in TZAbstractDataset.ApplyUpdates
Hello,
please don't post to old threads. This one has been marked as solved. If you have a problem concerning Zeos, please answer the following questions:
- Which compiler do you use?
- Which version of Zeos do you use?
- Which database product do you use and which version does it have?
- Can you create a minimum working example that shows the problem?
Best regards,
Jan
please don't post to old threads. This one has been marked as solved. If you have a problem concerning Zeos, please answer the following questions:
- Which compiler do you use?
- Which version of Zeos do you use?
- Which database product do you use and which version does it have?
- Can you create a minimum working example that shows the problem?
Best regards,
Jan