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

Fixed CORE-2173: Server crash after ubnormal disconnect with open ExecuteStatement

This commit is contained in:
alexpeshkoff 2008-11-10 10:13:46 +00:00
parent 30af81398b
commit 4f480137cf

View File

@ -89,7 +89,8 @@ void startCallback(thread_db* tdbb)
#if (defined DEV_BUILD && !defined MULTI_THREAD)
tdbb->getDatabase()->dbb_flags |= DBB_exec_statement;
#endif
tdbb->getTransaction()->tra_callback_count++;
if (tdbb->getTransaction())
tdbb->getTransaction()->tra_callback_count++;
THREAD_EXIT();
}
@ -99,7 +100,8 @@ void finishCallback(thread_db* tdbb)
#if (defined DEV_BUILD && !defined MULTI_THREAD)
tdbb->getDatabase()->dbb_flags &= ~DBB_exec_statement;
#endif
tdbb->getTransaction()->tra_callback_count--;
if (tdbb->getTransaction())
tdbb->getTransaction()->tra_callback_count--;
}
} // anonymous namespace
@ -294,15 +296,21 @@ void ExecuteStatement::Close(thread_db* tdbb)
Statement = 0;
}
char* p = reinterpret_cast<char*>(Sqlda);
delete[] p;
// if transaction is already missing, it's pool is also deleted,
// i.e. impossible and no use deleting something from it
if (tdbb->getTransaction()) {
char* p = reinterpret_cast<char*>(Sqlda);
delete[] p;
delete[] Buffer;
}
Sqlda = 0;
Buffer = 0;
if (Transaction) {
delete YValve::translate<YValve::Transaction>(&Transaction);
Transaction = 0;
}
delete[] Buffer;
Buffer = 0;
}
XSQLDA* ExecuteStatement::MakeSqlda(thread_db* tdbb, short n)