From: Dmitry Kovalev Date: Sat, 4 Nov 2000 12:52:06 +0000 (+0000) Subject: Add 'distinct' to sql search query to prevent duplicate entries in results (suggested... X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1659 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a9b601290b51cd8e4f16c66e60ba76ef1dc36ea4;p=openldap Add 'distinct' to sql search query to prevent duplicate entries in results (suggested by Mathieu Guillaume) --- diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index 087d623142..9cd5332589 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -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=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", ", ldap_entries.dn AS dn", NULL);