mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-21 15:19:34 -05:00
Add 'distinct' to sql search query to prevent duplicate entries in results (suggested by Mathieu Guillaume)
This commit is contained in:
parent
caf384a37c
commit
a9b601290b
1 changed files with 1 additions and 1 deletions
|
|
@ -284,7 +284,7 @@ char* backsql_srch_query(backsql_srch_info *bsi)
|
||||||
bsi->sel_len=bsi->from_len=bsi->jwhere_len=bsi->fwhere_len=0;
|
bsi->sel_len=bsi->from_len=bsi->jwhere_len=bsi->fwhere_len=0;
|
||||||
|
|
||||||
bsi->sel=backsql_strcat(bsi->sel,&bsi->sel_len,
|
bsi->sel=backsql_strcat(bsi->sel,&bsi->sel_len,
|
||||||
"SELECT ldap_entries.id,",bsi->oc->keytbl,".",bsi->oc->keycol,
|
"SELECT DISTINCT ldap_entries.id,",bsi->oc->keytbl,".",bsi->oc->keycol,
|
||||||
", '",bsi->oc->name,"' AS objectClass",
|
", '",bsi->oc->name,"' AS objectClass",
|
||||||
", ldap_entries.dn AS dn",
|
", ldap_entries.dn AS dn",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue