Skip to content
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

Deleting records from MON$ATTACHMENTS using ORDER BY clause doesn't close the corresponding attachments [CORE6266] #6508

Closed
firebird-automations opened this issue Mar 19, 2020 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @XaBbl4

Start the server.

In 1st terminal - create new database and type:
SQL> commit; select mon$attachment_id, mon$user, mon$timestamp from mon$attachments order by mon$timestamp;
Output will be 3 attachments in order: SYSDBA, Cache Writer, Garbage Collector

After connect from 2nd terminal and type in 1st terminal:
SQL> commit; select mon$attachment_id, mon$user, mon$timestamp from mon$attachments order by mon$timestamp;
Output will be 4 attachments in order:
3 SYSDBA
1 Cache Writer
2 Garbage Collector
4 SYSDBA

After type:
SQL> commit; delete from mon$attachments order by mon$timestamp;
Output no errors, but if typing:
SQL> commit; select mon$attachment_id, mon$user, mon$timestamp from mon$attachments order by mon$timestamp;
Output will be same 4 attachments, but one attachment should be closed (in the 2nd terminal).

If set breakpoint in function VirtualTable::erase (src/jrd/VirtualTable.cpp) id from all 4 times is same (the first one in the select and equal of current attachment in 1st terminal)

Commits: 471f1f5 914ae09

====== Test Details ======

Section for 4.0 (in .fbt file) intentionally contains temp message about missed implementation. Will be removed after fix for 4.0.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Fix is committed into the v3 branch, please verify.

@firebird-automations
Copy link
Collaborator Author

Commented by: @XaBbl4

Now the attachments is closing. Thanks

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Open [ 1 ] => Open [ 1 ]

QA Status: No test => Done with caveats

Test Details: Section for 4.0 (in .fbt file) intentionally contains temp message about missed implementation. Will be removed after fix for 4.0.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

Fix Version: 3.0.6 [ 10889 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

summary: Don't close attach while deleting record from MON$ATTACHMENTS using ORDER BY clause => Deleting records from MON$ATTACHMENTS using ORDER BY clause doesn't close the corresponding attachments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment