mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 07:23:03 +01:00
1) Fixed CORE-4382: User savepoints are not released on commit.
2) Respect the "no-auto-undo" option when retaining a transaction context. Thanks to Dimitry Sibiryakov.
This commit is contained in:
parent
49b203aa7d
commit
90c04f7d59
@ -448,6 +448,14 @@ void TRA_commit(thread_db* tdbb, jrd_tra* transaction, const bool retaining_flag
|
|||||||
|
|
||||||
EXT_trans_commit(transaction);
|
EXT_trans_commit(transaction);
|
||||||
|
|
||||||
|
if (transaction->tra_flags & TRA_write)
|
||||||
|
{
|
||||||
|
// Get rid of user savepoints to allow intermediate garbage collection
|
||||||
|
// in indices and BLOBs after in-place updates
|
||||||
|
while (transaction->tra_save_point && (transaction->tra_save_point->sav_flags & SAV_user))
|
||||||
|
VIO_verb_cleanup(tdbb, transaction);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef GARBAGE_THREAD
|
#ifdef GARBAGE_THREAD
|
||||||
// Flush pages if transaction logically modified data
|
// Flush pages if transaction logically modified data
|
||||||
|
|
||||||
@ -2613,9 +2621,15 @@ static void retain_context(thread_db* tdbb, jrd_tra* transaction, bool commit, S
|
|||||||
{
|
{
|
||||||
if (!(transaction->tra_save_point->sav_flags & SAV_trans_level))
|
if (!(transaction->tra_save_point->sav_flags & SAV_trans_level))
|
||||||
BUGCHECK(287); // Too many savepoints
|
BUGCHECK(287); // Too many savepoints
|
||||||
|
|
||||||
VIO_verb_cleanup(tdbb, transaction); // get rid of transaction savepoint
|
VIO_verb_cleanup(tdbb, transaction); // get rid of transaction savepoint
|
||||||
VIO_start_save_point(tdbb, transaction); // start new savepoint
|
|
||||||
transaction->tra_save_point->sav_flags |= SAV_trans_level;
|
if (!(transaction->tra_flags & TRA_no_auto_undo))
|
||||||
|
{
|
||||||
|
// start new transaction savepoint
|
||||||
|
VIO_start_save_point(tdbb, transaction);
|
||||||
|
transaction->tra_save_point->sav_flags |= SAV_trans_level;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transaction->tra_flags & TRA_precommitted)
|
if (transaction->tra_flags & TRA_precommitted)
|
||||||
|
Loading…
Reference in New Issue
Block a user