8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 15:23:02 +01:00

Fixed one more case of bug CORE-5087 : Database shutdown can cause server crash if multiple attachments run EXECUTE STATEMENT

This commit is contained in:
hvlad 2020-06-17 17:19:38 +03:00
parent 4d10716dca
commit 85e5b9b740

View File

@ -397,9 +397,6 @@ void InternalStatement::doPrepare(thread_db* tdbb, const string& sql)
fb_assert(!m_allocated);
}
{
EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION);
CallerName save_caller_name(tran->getHandle()->tra_caller_name);
if (m_callerPrivileges)
@ -432,12 +429,16 @@ void InternalStatement::doPrepare(thread_db* tdbb, const string& sql)
tran->getHandle()->tra_caller_name = CallerName();
}
{
EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION);
m_request.assignRefNoIncr(att->prepare(&status, tran, sql.length(), sql.c_str(),
m_connection.getSqlDialect(), 0));
}
m_allocated = (m_request != NULL);
if (tran->getHandle())
tran->getHandle()->tra_caller_name = save_caller_name;
}
if (status->getState() & IStatus::STATE_ERRORS)
raise(&status, tdbb, "JAttachment::prepare", &sql);