New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error "no current record to fetch" if some record is to be deleted both by the statement itself and by some trigger fired during statement execution [CORE5142] #5425
Comments
Commented by: @dyemanov Does error happen with just one connection or two independent connections? Does the second statement delete the record after the first one or concurrently? Which statement does produce the error - first or second? Any chance for a reproducible test case? |
Commented by: Olaf Kluge (okl) Hello, I get the error with one connection, the other clients does not call this stored procedure. This SP should delete all records incluedes a certain order, I think, during deleting the one record, the trigger deletes in the same table this with the referenced ID and the SP found not the marked record again and I get an error during SP-Call like this in my post. Herewith a sql file for creating test-table, insert records and execute for error. |
Modified by: Olaf Kluge (okl)Attachment: sql.txt [ 12915 ] |
Modified by: @dyemanovsummary: delete trigger during deleting (twice deleting and error no current record for fetch operation. => Error "no current record to fetch" if some record is to be deleted both by the statement itself and by some trigger fired during statement execution |
Commented by: Arioch (arioch) maybe you can workaround (not solve) it by deleting in autonomous transaction http://www.firebirdsql.org/refdocs/langrefupd25-psql-autonomous-trans.html |
Commented by: Erik Jõeveer (erikj) I have same problem with FB3.0 (no problems with FB2 or FB1.5). CREATE TABLE TEST_TABLE ( SET TERM ^ ; INSERT INTO TEST_TABLE (ID,RELATED_ID) VALUES (1,NULL); /* AND THIS WILL GIVE ERROR: */ |
Commented by: @dyemanov This issue is being worked on. |
Modified by: @dyemanovassignee: Vlad Khorsun [ hvlad ] |
Modified by: @hvladstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0.1 [ 10730 ] Fix Version: 4.0 Alpha 1 [ 10731 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done successfully |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Olaf Kluge (okl)
Relate to CORE5182
Attachments:
sql.txt
Votes: 2
A stored Procedure should delete some records.
ID some fields ID_AUTOINSERT
123 xxx null
234 xxx null
255 xxx 266
266 xxx null
Now there is a trigger after delete in this table who deletes:
if(old.ap = 69) then
begin
delete from tplan_kw_pos where id_autoinsert = http://old.id;
end
In this case, FB will delete the record with ID 266 during deleting ID 255 and the other statement intends to delete the record 266 too.
Now in FB 3 RC 2 I get this error message:
can't format message 13:492 -- message file C:\WINDOWS\SYSTEM32\firebird.msg not found.
no current record for fetch operation.
In FB 2.55, FB2.1 this was not a problem.
the trigger is required because the user can delete the one record only, in
this case the trigger deletes the referenced one with the id_autoinsert-id too. But if I delete the
entire Order, the record will be delete twice. How can I solve this in fb 3?
Commits: d5ec668 6a3d9d0
The text was updated successfully, but these errors were encountered: