mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 12:03:02 +01:00
Fixed bug CORE-3895 : High memory usage when PSQL code SELECT's from stored procedure which modified some data
This commit is contained in:
parent
100844abf4
commit
f2216519fc
@ -3319,7 +3319,7 @@ static void release_proc_save_points(jrd_req* request)
|
|||||||
**************************************
|
**************************************
|
||||||
*
|
*
|
||||||
* Functional description
|
* Functional description
|
||||||
* Release temporary blobs assigned by this request.
|
* Release savepoints used by this request.
|
||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
Savepoint* sav_point = request->req_proc_sav_point;
|
Savepoint* sav_point = request->req_proc_sav_point;
|
||||||
|
@ -333,6 +333,12 @@ const int tra_precommitted = 5; // Transaction is precommitted
|
|||||||
class Savepoint : public pool_alloc<type_sav>
|
class Savepoint : public pool_alloc<type_sav>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
~Savepoint()
|
||||||
|
{
|
||||||
|
deleteActions(sav_verb_actions);
|
||||||
|
deleteActions(sav_verb_free);
|
||||||
|
}
|
||||||
|
|
||||||
VerbAction* sav_verb_actions; // verb action list
|
VerbAction* sav_verb_actions; // verb action list
|
||||||
VerbAction* sav_verb_free; // free verb actions
|
VerbAction* sav_verb_free; // free verb actions
|
||||||
USHORT sav_verb_count; // Active verb count
|
USHORT sav_verb_count; // Active verb count
|
||||||
@ -340,6 +346,9 @@ public:
|
|||||||
Savepoint* sav_next;
|
Savepoint* sav_next;
|
||||||
USHORT sav_flags;
|
USHORT sav_flags;
|
||||||
TEXT sav_name[MAX_SQL_IDENTIFIER_SIZE]; // Savepoint name
|
TEXT sav_name[MAX_SQL_IDENTIFIER_SIZE]; // Savepoint name
|
||||||
|
|
||||||
|
private:
|
||||||
|
void deleteActions(VerbAction* list);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Savepoint block flags.
|
// Savepoint block flags.
|
||||||
@ -487,12 +496,29 @@ typedef Firebird::BePlusTree<UndoItem, SINT64, MemoryPool, UndoItem> UndoItemTre
|
|||||||
class VerbAction : public pool_alloc<type_vct>
|
class VerbAction : public pool_alloc<type_vct>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
~VerbAction()
|
||||||
|
{
|
||||||
|
delete vct_records;
|
||||||
|
delete vct_undo;
|
||||||
|
}
|
||||||
|
|
||||||
VerbAction* vct_next; // Next action within verb
|
VerbAction* vct_next; // Next action within verb
|
||||||
jrd_rel* vct_relation; // Relation involved
|
jrd_rel* vct_relation; // Relation involved
|
||||||
RecordBitmap* vct_records; // Record involved
|
RecordBitmap* vct_records; // Record involved
|
||||||
UndoItemTree* vct_undo; // Data for undo records
|
UndoItemTree* vct_undo; // Data for undo records
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline void Savepoint::deleteActions(VerbAction* list)
|
||||||
|
{
|
||||||
|
while (list)
|
||||||
|
{
|
||||||
|
VerbAction* next = list->vct_next;
|
||||||
|
delete list;
|
||||||
|
list = next;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} //namespace Jrd
|
} //namespace Jrd
|
||||||
|
|
||||||
#endif // JRD_TRA_H
|
#endif // JRD_TRA_H
|
||||||
|
Loading…
Reference in New Issue
Block a user