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

Fixed bug CORE-6254 : AV in engine when using SET TRANSACTION and ON TRANSACTION START trigger uses EXECUTE STATEMENT against current transaction

This commit is contained in:
hvlad 2020-02-20 18:32:11 +02:00
parent baf8bc1785
commit 7e5b0ce6ac

View File

@ -4915,12 +4915,18 @@ ITransaction* JStatement::execute(CheckStatusWrapper* user_status, ITransaction*
jt = NULL;
}
else if (tra && !jt)
{
jt = tra->getInterface(false);
if (jt)
tra->tra_flags &= ~TRA_own_interface;
else
{
apiTra = NULL; // Get ready for correct return in OOM case
jt = FB_NEW JTransaction(tra, getAttachment());
tra->setInterface(jt);
jt->addRef();
}
}
else if (tra && jt)
{
jt->setHandle(tra);
@ -5064,12 +5070,18 @@ ITransaction* JAttachment::execute(CheckStatusWrapper* user_status, ITransaction
jt = NULL;
}
else if (tra && !jt)
{
jt = tra->getInterface(false);
if (jt)
tra->tra_flags &= ~TRA_own_interface;
else
{
apiTra = NULL; // Get ready for correct return in OOM case
jt = FB_NEW JTransaction(tra, getStable());
jt->addRef();
tra->setInterface(jt);
}
}
else if (tra && jt)
{
jt->setHandle(tra);