FS-7217: #resolve #comment use upper when you query

This commit is contained in:
Brian West 2015-01-30 10:53:44 -06:00
parent c8f8d6b964
commit 4ed7b4811a
1 changed files with 6 additions and 2 deletions

View File

@ -3657,11 +3657,15 @@ static void select_from_profile(sofia_profile_t *profile,
if (exclude_contact) { if (exclude_contact) {
sql = switch_mprintf("select contact, profile_name, '%q' " sql = switch_mprintf("select contact, profile_name, '%q' "
"from sip_registrations where profile_name='%q' and sip_user='%q' and (sip_host='%q' or presence_hosts like '%%%q%%') " "from sip_registrations where profile_name='%q' "
"and upper(sip_user)=upper('%q') "
"and (sip_host='%q' or presence_hosts like '%%%q%%') "
"and contact not like '%%%s%%'", (concat != NULL) ? concat : "", profile->name, user, domain, domain, exclude_contact); "and contact not like '%%%s%%'", (concat != NULL) ? concat : "", profile->name, user, domain, domain, exclude_contact);
} else { } else {
sql = switch_mprintf("select contact, profile_name, '%q' " sql = switch_mprintf("select contact, profile_name, '%q' "
"from sip_registrations where profile_name='%q' and sip_user='%q' and (sip_host='%q' or presence_hosts like '%%%q%%')", "from sip_registrations where profile_name='%q' "
"and upper(sip_user)=upper('%q') "
"and (sip_host='%q' or presence_hosts like '%%%q%%')",
(concat != NULL) ? concat : "", profile->name, user, domain, domain); (concat != NULL) ? concat : "", profile->name, user, domain, domain);
} }