mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:03:04 +01:00
Improvement CORE-3537 : There is no need to undo changes made in GTT created with ON COMMIT DELETE ROWS option when transaction is rolled back.
This commit is contained in:
parent
f2aaa12ce5
commit
f12c243e1c
@ -1270,6 +1270,10 @@ void TRA_rollback(thread_db* tdbb, jrd_tra* transaction, const bool retaining_fl
|
|||||||
transaction->tra_save_point = next;
|
transaction->tra_save_point = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VIO_temp_cleanup(tdbb, transaction);
|
||||||
|
}
|
||||||
|
|
||||||
// Find out if there is a transaction savepoint we can use to rollback our transaction
|
// Find out if there is a transaction savepoint we can use to rollback our transaction
|
||||||
bool tran_sav = false;
|
bool tran_sav = false;
|
||||||
|
@ -3238,6 +3238,45 @@ bool VIO_sweep(thread_db* tdbb, jrd_tra* transaction)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void VIO_temp_cleanup(thread_db* tdbb, jrd_tra* transaction)
|
||||||
|
/**************************************
|
||||||
|
*
|
||||||
|
* V I O _ t e m p _ c l e a n u p
|
||||||
|
*
|
||||||
|
**************************************
|
||||||
|
*
|
||||||
|
* Functional description
|
||||||
|
* Remove undo data for GTT ON COMMIT DELETE ROWS as they data will be released
|
||||||
|
* at transaction end anyway and we don't need to waste a time backing it out on
|
||||||
|
* rollback
|
||||||
|
*
|
||||||
|
**************************************/
|
||||||
|
{
|
||||||
|
Savepoint* sav_point = transaction->tra_save_point;
|
||||||
|
for (; sav_point; sav_point = sav_point->sav_next)
|
||||||
|
{
|
||||||
|
for (VerbAction* action = sav_point->sav_verb_actions; action; action = action->vct_next)
|
||||||
|
{
|
||||||
|
if (action->vct_relation->rel_flags & REL_temp_tran)
|
||||||
|
{
|
||||||
|
RecordBitmap::reset(action->vct_records);
|
||||||
|
if (action->vct_undo)
|
||||||
|
{
|
||||||
|
if (action->vct_undo->getFirst())
|
||||||
|
{
|
||||||
|
do {
|
||||||
|
action->vct_undo->current().release(transaction);
|
||||||
|
} while (action->vct_undo->getNext());
|
||||||
|
}
|
||||||
|
delete action->vct_undo;
|
||||||
|
action->vct_undo = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void VIO_verb_cleanup(thread_db* tdbb, jrd_tra* transaction)
|
void VIO_verb_cleanup(thread_db* tdbb, jrd_tra* transaction)
|
||||||
{
|
{
|
||||||
/**************************************
|
/**************************************
|
||||||
|
@ -61,6 +61,7 @@ void VIO_store(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*);
|
|||||||
bool VIO_sweep(Jrd::thread_db*, Jrd::jrd_tra*);
|
bool VIO_sweep(Jrd::thread_db*, Jrd::jrd_tra*);
|
||||||
void VIO_verb_cleanup(Jrd::thread_db*, Jrd::jrd_tra*);
|
void VIO_verb_cleanup(Jrd::thread_db*, Jrd::jrd_tra*);
|
||||||
IPTR VIO_savepoint_large(const Jrd::Savepoint*, IPTR);
|
IPTR VIO_savepoint_large(const Jrd::Savepoint*, IPTR);
|
||||||
|
void VIO_temp_cleanup(Jrd::thread_db*, Jrd::jrd_tra*);
|
||||||
|
|
||||||
namespace Jrd
|
namespace Jrd
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user