8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 23:23:04 +01:00
This commit is contained in:
asfernandes 2009-12-02 00:35:55 +00:00
parent 7b3fb919cb
commit 7d52a84520
8 changed files with 20 additions and 12 deletions

View File

@ -235,6 +235,8 @@ CharSetContainer* CharSetContainer::lookupCharset(thread_db* tdbb, USHORT ttype)
return cs; return cs;
} }
// Lookup a system character set without looking in the database.
bool CharSetContainer::lookupInternalCharSet(USHORT id, SubtypeInfo* info) bool CharSetContainer::lookupInternalCharSet(USHORT id, SubtypeInfo* info)
{ {
if (id == CS_UTF16) if (id == CS_UTF16)
@ -260,7 +262,7 @@ bool CharSetContainer::lookupInternalCharSet(USHORT id, SubtypeInfo* info)
if (colDef->charSetId == id && colDef->collationId == 0) if (colDef->charSetId == id && colDef->collationId == 0)
{ {
info->charsetName = csDef->name; info->charsetName = csDef->name;
info->collationName = csDef->name; info->collationName = colDef->name;
info->attributes = colDef->attributes; info->attributes = colDef->attributes;
info->ignoreAttributes = false; info->ignoreAttributes = false;
@ -278,6 +280,7 @@ bool CharSetContainer::lookupInternalCharSet(USHORT id, SubtypeInfo* info)
return false; return false;
} }
Lock* CharSetContainer::createCollationLock(thread_db* tdbb, USHORT ttype) Lock* CharSetContainer::createCollationLock(thread_db* tdbb, USHORT ttype)
{ {
/************************************** /**************************************

View File

@ -223,10 +223,8 @@ namespace
inline void validateHandle(Service* service) inline void validateHandle(Service* service)
{ {
if (service && service->checkHandle()) if (!service || !service->checkHandle())
return; status_exception::raise(Arg::Gds(isc_bad_svc_handle));
status_exception::raise(Arg::Gds(isc_bad_svc_handle));
} }
class AttachmentHolder class AttachmentHolder

View File

@ -129,16 +129,19 @@ namespace {
class ThreadIdHolder class ThreadIdHolder
{ {
public: public:
explicit ThreadIdHolder(Jrd::Service::StatusStringsHelper& p) : strHelper(&p) explicit ThreadIdHolder(Jrd::Service::StatusStringsHelper& p)
: strHelper(&p)
{ {
MutexLockGuard guard(strHelper->mtx); MutexLockGuard guard(strHelper->mtx);
strHelper->workerThread = getThreadId(); strHelper->workerThread = getThreadId();
} }
~ThreadIdHolder() ~ThreadIdHolder()
{ {
MutexLockGuard guard(strHelper->mtx); MutexLockGuard guard(strHelper->mtx);
strHelper->workerThread = 0; strHelper->workerThread = 0;
} }
private: private:
Jrd::Service::StatusStringsHelper* strHelper; Jrd::Service::StatusStringsHelper* strHelper;
}; };
@ -309,10 +312,10 @@ Service::ExistenceGuard::ExistenceGuard(Service* s)
if (! svc->locateInAllServices()) if (! svc->locateInAllServices())
{ {
// Service is so old that it's even missing in allSevrices array // Service is so old that it's even missing in allServices array
Arg::Gds(isc_bad_svc_handle).raise(); Arg::Gds(isc_bad_svc_handle).raise();
} }
if (svc->svc_flags & SVC_detached) if (svc->svc_flags & SVC_detached)
{ {
// Service was already detached // Service was already detached

View File

@ -279,6 +279,7 @@ public:
FB_THREAD_ID workerThread; FB_THREAD_ID workerThread;
Firebird::Mutex mtx; Firebird::Mutex mtx;
}; };
private: private:
StatusStringsHelper svc_thread_strings; StatusStringsHelper svc_thread_strings;
@ -289,11 +290,14 @@ private:
ExistenceGuard(Service* svc); ExistenceGuard(Service* svc);
~ExistenceGuard(); ~ExistenceGuard();
void release(); void release();
private: private:
Service* svc; Service* svc;
bool locked; bool locked;
}; };
friend class ExistenceGuard; friend class ExistenceGuard;
Firebird::Mutex svc_existence_lock; Firebird::Mutex svc_existence_lock;
ExistenceGuard* svc_current_guard; ExistenceGuard* svc_current_guard;
}; };

View File

@ -88,7 +88,7 @@ void TraceSvcJrd::startSession(TraceSession& session, bool interactive)
m_svc.printf("Can not start trace session. There are no trace plugins loaded\n"); m_svc.printf("Can not start trace session. There are no trace plugins loaded\n");
return; return;
} }
ConfigStorage* storage = TraceManager::getStorage(); ConfigStorage* storage = TraceManager::getStorage();
{ // scope { // scope

View File

@ -1636,7 +1636,7 @@ bool TracePluginImpl::checkServiceFilter(TraceService* service, bool started)
{ {
ReadLockGuard lock(servicesLock); ReadLockGuard lock(servicesLock);
ServiceData *data = NULL; ServiceData* data = NULL;
ServicesTree::Accessor accessor(&services); ServicesTree::Accessor accessor(&services);
if (accessor.locate(service->getServiceID())) if (accessor.locate(service->getServiceID()))
data = &accessor.current(); data = &accessor.current();

View File

@ -186,7 +186,7 @@ private:
void register_sql_statement(TraceSQLStatement* statement); void register_sql_statement(TraceSQLStatement* statement);
void register_blr_statement(TraceBLRStatement* statement); void register_blr_statement(TraceBLRStatement* statement);
void register_service(TraceService* service); void register_service(TraceService* service);
bool checkServiceFilter(TraceService* service, bool started); bool checkServiceFilter(TraceService* service, bool started);
// Write message to text log file // Write message to text log file

View File

@ -124,7 +124,7 @@
# default services section # default services section
# #
# List of names of currently existing Firebirds services (to use with service # List of names of currently existing Firebird services (to use with service
# filters below) : # filters below) :
# Backup Database # Backup Database
# Restore Database # Restore Database