8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 20:03:02 +01:00

Improvement CORE-3008 : Add attachment's CHARACTER SET name into corresponding trace records

This commit is contained in:
hvlad 2010-05-19 16:13:25 +00:00
parent d01b2580ae
commit 18ed4f65c8
5 changed files with 13 additions and 0 deletions

View File

@ -507,6 +507,7 @@ public:
}
virtual const char* getRoleName() { return m_options->dpb_role_name.c_str(); }
virtual const char* getCharSet() { return m_options->dpb_lc_ctype.c_str(); }
virtual const char* getRemoteProtocol() { return m_options->dpb_network_protocol.c_str(); }
virtual const char* getRemoteAddress() { return m_options->dpb_remote_address.c_str(); }
virtual int getRemoteProcessID() { return m_options->dpb_remote_pid; }

View File

@ -52,6 +52,7 @@ public:
virtual int getProcessID() = 0;
virtual const char* getUserName() = 0;
virtual const char* getRoleName() = 0;
virtual const char* getCharSet() = 0;
virtual const char* getRemoteProtocol() = 0;
virtual const char* getRemoteAddress() = 0;
virtual int getRemoteProcessID() = 0;

View File

@ -88,6 +88,12 @@ const char* TraceConnectionImpl::getRoleName()
return user ? user->usr_sql_role_name.c_str() : NULL;
}
const char* TraceConnectionImpl::getCharSet()
{
CharSet *cs = INTL_charset_lookup(JRD_get_thread_data(), m_att->att_charset);
return cs ? cs->getName() : NULL;
}
const char* TraceConnectionImpl::getRemoteProtocol()
{
return m_att->att_network_protocol.c_str();

View File

@ -59,6 +59,7 @@ public:
virtual const char* getDatabaseName();
virtual const char* getUserName();
virtual const char* getRoleName();
virtual const char* getCharSet();
virtual const char* getRemoteProtocol();
virtual const char* getRemoteAddress();
virtual int getRemoteProcessID();

View File

@ -948,6 +948,10 @@ void TracePluginImpl::register_connection(TraceConnection* connection)
conn_data.description->append(", <unknown_user>");
}
const char* charSet = connection->getCharSet();
tmp.printf(", %s", charSet && *charSet ? charSet : "NONE");
conn_data.description->append(tmp);
const char* remProto = connection->getRemoteProtocol();
const char* remAddr = connection->getRemoteAddress();
if (remProto && *remProto)