mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:43:03 +01:00
Fixed AV detected by tests bugs.core_3323, bugs.core_5645 and bugs.core_5972
This commit is contained in:
parent
7c00cea455
commit
fa572cc657
@ -1190,14 +1190,15 @@ string AlterEDSPoolSetNode::internalPrint(NodePrinter& printer) const
|
||||
|
||||
void AlterEDSPoolSetNode::execute(thread_db* tdbb, DsqlCompilerScratch* /*dsqlScratch*/, jrd_tra* /*transaction*/)
|
||||
{
|
||||
EDS::ConnectionsPool* pool = EDS::Manager::getConnPool(false);
|
||||
switch (m_param)
|
||||
{
|
||||
case POOL_SIZE:
|
||||
EDS::Manager::getConnPool()->setMaxCount(m_value);
|
||||
pool->setMaxCount(m_value);
|
||||
break;
|
||||
|
||||
case POOL_LIFETIME:
|
||||
EDS::Manager::getConnPool()->setLifeTime(m_value);
|
||||
pool->setLifeTime(m_value);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1228,17 +1229,21 @@ string AlterEDSPoolClearNode::internalPrint(NodePrinter& printer) const
|
||||
|
||||
void AlterEDSPoolClearNode::execute(thread_db* tdbb, DsqlCompilerScratch* /*dsqlScratch*/, jrd_tra* /*transaction*/)
|
||||
{
|
||||
EDS::ConnectionsPool* pool = EDS::Manager::getConnPool(false);
|
||||
if (!pool)
|
||||
return;
|
||||
|
||||
switch (m_param)
|
||||
{
|
||||
case POOL_ALL:
|
||||
{
|
||||
EDS::Manager::getConnPool()->clearIdle(tdbb, true);
|
||||
pool->clearIdle(tdbb, true);
|
||||
break;
|
||||
}
|
||||
|
||||
case POOL_OLDEST:
|
||||
{
|
||||
EDS::Manager::getConnPool()->clearIdle(tdbb, false);
|
||||
pool->clearIdle(tdbb, false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -209,8 +209,8 @@ Connection* Manager::getConnection(thread_db* tdbb, const string& dataSource,
|
||||
|
||||
// if could be pooled, ask connections pool
|
||||
|
||||
if (!m_connPool)
|
||||
m_connPool = FB_NEW_POOL(manager->getPool()) ConnectionsPool(manager->getPool());
|
||||
// Ensure pool is created
|
||||
getConnPool(true);
|
||||
|
||||
ULONG hash = 0;
|
||||
|
||||
@ -248,6 +248,14 @@ Connection* Manager::getConnection(thread_db* tdbb, const string& dataSource,
|
||||
return conn;
|
||||
}
|
||||
|
||||
ConnectionsPool* Manager::getConnPool(bool create)
|
||||
{
|
||||
if (!m_connPool && create)
|
||||
m_connPool = FB_NEW_POOL(manager->getPool()) ConnectionsPool(manager->getPool());
|
||||
|
||||
return m_connPool;
|
||||
}
|
||||
|
||||
void Manager::jrdAttachmentEnd(thread_db* tdbb, Jrd::Attachment* att, bool forced)
|
||||
{
|
||||
for (Provider* prv = m_providers; prv; prv = prv->m_next)
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
const Firebird::string& dataSource, const Firebird::string& user,
|
||||
const Firebird::string& pwd, const Firebird::string& role, TraScope tra_scope);
|
||||
|
||||
static ConnectionsPool* getConnPool() { return m_connPool; }
|
||||
static ConnectionsPool* getConnPool(bool create);
|
||||
|
||||
// Release bound external connections when some jrd attachment is about to be released
|
||||
static void jrdAttachmentEnd(Jrd::thread_db* tdbb, Jrd::Attachment* att, bool forced);
|
||||
|
Loading…
Reference in New Issue
Block a user