Skip to content

Commit

Permalink
Fixed CORE-4055: Dialect is not set in internal connections to securi…
Browse files Browse the repository at this point in the history
…ty database
  • Loading branch information
AlexPeshkoff committed Feb 26, 2013
1 parent 1ceba37 commit 87ab3bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/jrd/UserManagement.cpp
Expand Up @@ -46,6 +46,8 @@ UserManagement::UserManagement(jrd_tra* tra)
ClumpletWriter dpb(ClumpletReader::Tagged, MAX_DPB_SIZE, isc_dpb_version1);
dpb.insertByte(isc_dpb_gsec_attach, TRUE);
dpb.insertString(isc_dpb_trusted_auth, att->att_user->usr_user_name);

bool dpbHasRole = true;
if (att->att_user->usr_flags & USR_trole)
{
dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE));
Expand All @@ -58,6 +60,14 @@ UserManagement::UserManagement(jrd_tra* tra)
{
dpb.insertString(isc_dpb_sql_role_name, att->att_requested_role);
}
else
{
dpbHasRole = false;
}
if (dpbHasRole)
{
dpb.insertByte(isc_dpb_sql_dialect, 0);
}

if (isc_attach_database(status, 0, securityDatabaseName, &database,
dpb.getBufferLength(), reinterpret_cast<const char*>(dpb.getBuffer())))
Expand Down

0 comments on commit 87ab3bf

Please sign in to comment.