8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:03:02 +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

@ -4916,10 +4916,16 @@ ITransaction* JStatement::execute(CheckStatusWrapper* user_status, ITransaction*
}
else if (tra && !jt)
{
apiTra = NULL; // Get ready for correct return in OOM case
jt = FB_NEW JTransaction(tra, getAttachment());
tra->setInterface(jt);
jt->addRef();
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)
{
@ -5065,10 +5071,16 @@ ITransaction* JAttachment::execute(CheckStatusWrapper* user_status, ITransaction
}
else if (tra && !jt)
{
apiTra = NULL; // Get ready for correct return in OOM case
jt = FB_NEW JTransaction(tra, getStable());
jt->addRef();
tra->setInterface(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)
{