8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 22:43:03 +01:00

Fixed #7446: Attempt to use data in destroyed transaction pool

This commit is contained in:
AlexPeshkoff 2023-01-10 20:07:52 +03:00
parent cb368b2a1c
commit 6c431cb465
3 changed files with 14 additions and 10 deletions

View File

@ -6048,9 +6048,12 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
defaultRequest->validateTimeStamp();
TRA_attach_request(transaction, defaultRequest);
dsc* result = EVL_expr(tdbb, defaultRequest, defaultNode);
TRA_detach_request(defaultRequest);
dsc* result = nullptr;
{ // scope
Firebird::Cleanup detach([&defaultRequest] {TRA_detach_request(defaultRequest);});
TRA_attach_request(transaction, defaultRequest);
result = EVL_expr(tdbb, defaultRequest, defaultNode);
}
if (result)
{

View File

@ -1005,13 +1005,6 @@ void EXE_unwind(thread_db* tdbb, Request* request)
request->req_sorts.unlinkAll();
if (request->req_proc_sav_point && (request->req_flags & req_proc_fetch))
{
// Release savepoints used by this request
Savepoint::destroy(request->req_proc_sav_point);
fb_assert(!request->req_proc_sav_point);
}
TRA_release_request_snapshot(tdbb, request);
TRA_detach_request(request);

View File

@ -237,6 +237,14 @@ void TRA_detach_request(Jrd::Request* request)
// Release stored looper savepoints
Savepoint::destroy(request->req_savepoints);
fb_assert(!request->req_savepoints);
// Release procedure savepoints used by this request
if (request->req_proc_sav_point && (request->req_flags & req_proc_fetch))
{
Savepoint::destroy(request->req_proc_sav_point);
fb_assert(!request->req_proc_sav_point);
}
// Remove request from the doubly linked list
if (request->req_tra_next)