]> git.sur5r.net Git - openldap/commitdiff
Add 'distinct' to sql search query to prevent duplicate entries in results (suggested...
authorDmitry Kovalev <mit@openldap.org>
Sat, 4 Nov 2000 12:52:06 +0000 (12:52 +0000)
committerDmitry Kovalev <mit@openldap.org>
Sat, 4 Nov 2000 12:52:06 +0000 (12:52 +0000)
servers/slapd/back-sql/search.c

index 087d623142a8a426268faa98592c9c3e086aa366..9cd53325893adafa8716aa7531bbf0f2857b25b7 100644 (file)
@@ -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);