Skip to content
Snippets Groups Projects
Unverified Commit 1bee5464 authored by eugene7646's avatar eugene7646 Committed by GitHub
Browse files

Merge pull request #2772 from gdicristofaro/OsAccountRealmFix

fix for os account realms
parents 679a9f91 6493eda1
No related branches found
No related tags found
No related merge requests found
......@@ -535,9 +535,9 @@ Optional<OsAccountRealm> getAnotherRealmByAddr(OsAccountRealm realm, String real
// If the given realm has a host id, then the other realm should have the same host id
// If the given realm has no host id, then the other realm should have no host id
String whereHostClause = (realm.getScopeHost().isEmpty())
? " realms.scope_host_id IS NULL "
: " ( realms.scope_host_id = " + realm.getScopeHost().get().getHostId() + " ) ";
String whereHostClause = realm.getScopeHost().isPresent()
? " ( realms.scope_host_id = " + realm.getScopeHost().get().getHostId() + " ) "
: " realms.scope_host_id IS NULL ";
String queryString = REALM_QUERY_STRING
+ " WHERE LOWER(realms.realm_addr) = LOWER('"+ realmAddr + "') "
+ " AND " + whereHostClause
......@@ -590,9 +590,9 @@ Optional<OsAccountRealm> getAnotherRealmByName(OsAccountRealm realm, String real
// If the given realm has a host id, then the other realm should have the same host id
// If the given realm has no host id, then the other realm should have no host id
String whereHostClause = (realm.getScopeHost().isEmpty())
? " realms.scope_host_id IS NULL "
: " ( realms.scope_host_id = " + realm.getScopeHost().get().getHostId() + " ) ";
String whereHostClause = realm.getScopeHost().isPresent()
? " ( realms.scope_host_id = " + realm.getScopeHost().get().getHostId() + " ) "
: " realms.scope_host_id IS NULL ";
String queryString = REALM_QUERY_STRING
+ " WHERE LOWER(realms.realm_name) = LOWER('" + realmName + "')"
+ " AND " + whereHostClause
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment