8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:43:02 +01:00

Improvement #8353 : Report unique usernames for isc_info_user_names

This commit is contained in:
Vlad Khorsun 2024-12-19 00:21:20 +02:00
parent 2528942a8c
commit 7ebb66b5d3

View File

@ -633,6 +633,8 @@ void INF_database_info(thread_db* tdbb,
}
{
StrArray names;
SyncLockGuard sync(&dbb->dbb_sync, SYNC_SHARED, "INF_database_info");
for (const Jrd::Attachment* att = dbb->dbb_attachments; att; att = att->att_next)
@ -643,6 +645,13 @@ void INF_database_info(thread_db* tdbb,
{
const char* userName = user->getUserName().hasData() ?
user->getUserName().c_str() : "(Firebird Worker Thread)";
FB_SIZE_T pos;
if (names.find(userName, pos))
continue;
names.insert(pos, userName);
p = buffer;
const ULONG len = MIN(strlen(userName), MAX_UCHAR);
*p++ = static_cast<UCHAR>(len);