Skip to content

Commit f604c56

Browse files
committed
Fixed bug #8189 : Slow connection times with a lot of simultaneous connections and active trace session present
The patch by @AlexPeshkoff
1 parent cf95284 commit f604c56

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/jrd/Mapping.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,12 @@ class SysPrivCache : public PermanentStorage
10911091
return false;
10921092

10931093
MAP_DEBUG(fprintf(stderr, "granted=%d\n", granted));
1094-
return roles.getPrivileges((granted ? *sqlRole : trusted_role), system_privileges);
1094+
1095+
// Note, roles have no special entry with empty string as a key.
1096+
// Thus, don't consider it as not populated if role to check is not set (empty).
1097+
1098+
const string& roleInUse = granted ? *sqlRole : trusted_role;
1099+
return roleInUse.hasData() ? roles.getPrivileges(roleInUse, system_privileges) : true;
10951100
}
10961101

10971102
void populate(Mapping::DbHandle& iDb, const string& name, const string* sqlRole,

0 commit comments

Comments
 (0)